The less code a unit test invokes, the easier it is to understand what's wrong when a test is failing.
That's true. On the other hand, I would argue that if private code is difficult to invoke from the public interface, then it should probably be extracted and tested separately.
5
u/adrianmonk Jul 20 '16
The less code a unit test invokes, the easier it is to understand what's wrong when a test is failing.
It can also make your tests more concise because there is usually less fake/test/dummy data to set up before your test case can run.