예제 #1
0
        public void UndoTest()
        {
            MockUndo m1 = new MockUndo(true);
            MockUndo m2 = new MockUndo(true);

            UndoOperationSet target = new UndoOperationSet();

            target.Add(m1);
            target.Add(m2);

            target.Undo();

            Assert.IsTrue(m1.undoCalled);
            Assert.IsTrue(m2.undoCalled);
        }
예제 #2
0
        public void UndoOrderTest()
        {
            int      finalValue = 0;
            MockUndo m1         = new MockUndo(true);

            UndoOperationSet target = new UndoOperationSet();

            target.Add(m1);
            target.Add(new DelegateUndo(() => finalValue = 1));
            target.Add(new DelegateUndo(() => finalValue = 2));

            target.Undo();

            Assert.IsTrue(m1.undoCalled);
            Assert.AreEqual(1, finalValue);
        }