public void ContextKeeperTest() { Console.WriteLine(@"ContextKeeperTest"); IContextKeeper keeper = new ContextKeeper(); Assert.IsFalse(keeper.ContainsContext("ContextName")); keeper.CreateNewContext("ContextName"); Assert.IsTrue(keeper.ContainsContext("ContextName")); }
public void ContextKeeperRemoveTest() { Console.WriteLine(@"ContextKeeperRemoveTest"); var keeper = new ContextKeeper(); Context context = keeper.CreateNewContext("ContextName"); Assert.AreEqual("ContextName", context.ContextName); Assert.IsTrue(keeper.ContainsContext("ContextName")); keeper.Remove("ContextName"); Assert.IsFalse(keeper.ContainsContext("ContextName")); }
public void ContextKeeperUsingTest() { Console.WriteLine(@"ContextKeeperUsingTest"); IContextKeeper keeper = new ContextKeeper(); using (keeper.CreateNewContext("ContextName")) { Assert.IsTrue(keeper.ContainsContext("ContextName")); keeper.CreateNewContext(ContextValue.DefineBinding); using (keeper.CreateNewContext("ContextName")) { Assert.IsTrue(keeper.ContainsContext("ContextName")); } Assert.IsTrue(keeper.ContainsContext("ContextName")); } keeper.CreateNewContext(ContextValue.OpenEditor); Assert.IsFalse(keeper.ContainsContext("ContextName")); }