DEV Community

Discussion on: How to use reflection to test private and protected methods

Collapse
 
andrewmclagan profile image
Andrew McLagan

Whatever you do... disregard this article. You should NEVER in no circumstances ... any ... never .. don't .. ever:

NEVER test private or protected methods. This is not a controversial topic. You are testing implementation details, those can and will change. Unit testing tests the public API of units of software.

FFS... articles like this are so so so dangerous when they posit such things are correct.