June 13, 2007 - 21:15 UTC - Tags: testing static unit testing
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.