comments (not for humans)
This may be old news for some of you, but using static non-final variables in your code can result in strange unit test behaviour. The reasoning is that states in static values may be kept between unit tests because the class or dll is not unloaded and reloaded between each unit test. This violates the principle that unit tests should be independent of each other, and can result in tests passing and failing depending on the order in which they are run.
Ole Christian L

Coincidence?

Totally found that out myself the same day you posted this. I've got some abstract superclasses which contains various useful objects. Unfortunately changes to these were kept and used for the other Unit tests also. Nice.
Comments closed for this post