4 ms·
How do you write unit tests for classes like this? A lot of reflection I assume?
by pan69 12y ago
How do you write unit tests for classes like this? A lot of reflection I assume?
- martinnormark 12y agoI only test against the final result, that I expect any public method to produce. The unit test should pay no consideration to the implementation details such as private methods. If you want to test the fragments in isolation, split it out into a separate class that you use as a dependency. Your desire to do so is often a good indication that you should split up the responsibility.
- joshka 12y agohttps://gist.github.com/joshka/54548c3dfb9a4ebcdea9 https://gist.github.com/joshka/54548c3dfb9a4ebcdea9