Skip to content
loading...

re: How to use reflection to test private and protected methods VIEW POST

TOP OF THREAD FULL DISCUSSION
re: This is a highly opinion-based topic, if you should or shouldn't test private/protected methods, just see the discussion here: stackoverflow.com/qu...
 

The stackoverflow link you posted shows that the winner of the discussion (marked as accepted and higher votes) is the answer that tells you NOT to test private methods.

If a private method is changed, the tests for the public methods should pick it up, via a difference in the expected output of the public methods that use the private method.

code of conduct - report abuse