2 ms·
Yeah - the alternative is often to make your non-test code worse to make it more testable. Test private methods when you have sufficient behavior in them that
by Groxx 3y ago
Yeah - the alternative is often to make your non-test code worse to make it more testable.
Test private methods when you have sufficient behavior in them that it's worth testing in isolation.
- appplication 3y agoThis is all there is to it. The dogma around not testing private methods is entirely unconvincing. I have some very complex private methods that it’s just easier to write some thorough unit tests for, and it guarantees the contract my public methods rely on. I really do not see why that is controversial.