public void TestUnsetBehConf() { var ubc = new UnsetBehConf(); for (Ucbx u = Ucbx.bold; u < Ucbx.last; u++) { ubc.SetCbuFlag(u, true); ubc.SetCbuFlag(u, false); Assert.IsFalse(ubc.GetCbuFlag(u)); UndoFactory.UndoLastAction(); Assert.IsTrue(ubc.GetCbuFlag(u)); UndoFactory.RedoLastCanceledAction(); Assert.IsFalse(ubc.GetCbuFlag(u)); UndoFactory.UndoLastAction(); Assert.IsTrue(ubc.GetCbuFlag(u)); } ubc.Reset(); for (Ucbx u = Ucbx.bold; u < Ucbx.last; u++) { Assert.IsFalse(ubc.GetCbuFlag(u)); } UndoFactory.UndoLastAction(); for (Ucbx u = Ucbx.bold; u < Ucbx.last; u++) { Assert.IsTrue(ubc.GetCbuFlag(u)); } UndoFactory.RedoLastCanceledAction(); for (Ucbx u = Ucbx.bold; u < Ucbx.last; u++) { Assert.IsFalse(ubc.GetCbuFlag(u)); } }
public void TestReset() { UnsetBehConf uB = conf.unsetBeh; uB.SetCbuFlag("All", true); CheckConsistency(uB); uB.Reset(); CheckConsistency(uB); Assert.IsFalse(uB.GetCbuFlag("Bold")); Assert.IsFalse(uB.GetCbuFlag("Italic")); Assert.IsFalse(uB.GetCbuFlag("Underline")); Assert.IsFalse(uB.GetCbuFlag("Color")); Assert.IsFalse(uB.GetCbuFlag("Hilight")); Assert.IsFalse(uB.GetCbuFlag("All")); Assert.IsFalse(uB.GetCbuFlag(Ucbx.bold)); Assert.IsFalse(uB.GetCbuFlag(Ucbx.italic)); Assert.IsFalse(uB.GetCbuFlag(Ucbx.underline)); Assert.IsFalse(uB.GetCbuFlag(Ucbx.color)); Assert.IsFalse(uB.GetCbuFlag(Ucbx.hilight)); Assert.IsFalse(uB.GetCbuFlag(Ucbx.all)); }