Structuring Unit Tests

A very fine idea for naming and nesting unit tests:

To have a nested class for each method being tested.


This little trick, this one simple sentence, is like a missing piece in the jigsaw. I liked it from the very start. It fits very well alongside guides for naming of testing methods, like expressed in this article:


I just wonder how this practice could fit into JUnit. Will have to try.

Also on the same page: