4 ms·
When talking about this common scenario, there are two ways of think. Some people argue that you shouldn't expose private methods only to test them. You should
by pauloortins 13y ago
When talking about this common scenario, there are two ways of think. Some people argue that you shouldn't expose private methods only to test them. You should do it through the public method to keep the encapsulation. Others argue that yes, you should expose these methods to make easier to write tests and to identify possible bugs.
It depends, we have to analyze each case and choose the advantages and disadvantages.