fixed SPRNET-1128

This commit is contained in:
eeichinger
2008-12-02 20:19:45 +00:00
parent 4d98672d39
commit 085464919f
3 changed files with 91 additions and 16 deletions

View File

@@ -229,5 +229,16 @@ namespace Spring.Context.Support
MockApplicationContext duplicate = new MockApplicationContext("original");
ContextRegistry.RegisterContext(duplicate);
}
[Test]
public void RemovesContextFromRegistryWhenContextCloses()
{
StaticApplicationContext appCtx = new StaticApplicationContext();
appCtx.Name = "myCtx";
ContextRegistry.RegisterContext(appCtx);
Assert.IsTrue(ContextRegistry.IsContextRegistered(appCtx.Name));
appCtx.Dispose();
Assert.IsFalse(ContextRegistry.IsContextRegistered(appCtx.Name));
}
}
}