Category Archives: testing

Unit testing private methods using reflection (and other solutions)

When it comes to unit testing you might find yourself wanting to test private methods. Here’s four solutions, some much better than others. 1. Don’t test private methods (refactor!) If you find yourself needing to test private methods, you’re code is trying to tell you something – listen up! Unit tests should test the behavior… Read More »