Skip to main content

Validate private methods using public methods

While is it possible to test private methods individually, it is good a practice to "cover" them by testing only the public methods.

Private methods will never exist alone in an application but will most likely be used by one or more public methods as part of their implementation.

You should however try to achieve high coverage in terms of lines of code, branches and of course, private methods.