diff --git a/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractSpringContextTests.cs b/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractSpringContextTests.cs index 9e4e45dd..8f95bec8 100644 --- a/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractSpringContextTests.cs +++ b/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractSpringContextTests.cs @@ -105,7 +105,21 @@ namespace Spring.Testing.NUnit /// Locations protected void SetDirty(string[] locations) { - String keyString = ContextKeyString(locations); + SetDirty((object)locations); + } + + /// + /// Set context with dirty. This will cause + /// it to be reloaded from the cache before the next test case is executed. + /// + /// + /// Call this method only if you change the state of a singleton + /// object, potentially affecting future tests. + /// + /// Locations + protected void SetDirty(object contextKey) + { + String keyString = ContextKeyString(contextKey); IConfigurableApplicationContext ctx = (IConfigurableApplicationContext) contextKeyToContextMap[keyString]; contextKeyToContextMap.Remove(keyString);