예제 #1
0
            public void CanRedoNak()
            {
                var mock1 = new MockUndo(true);
                var mock2 = new MockUndo();

                var operationSet = new OperationSet(this);

                operationSet.Add(mock1);
                operationSet.Add(mock2);

                Assert.IsFalse(operationSet.CanRedo);
            }
예제 #2
0
            public void RedoTest()
            {
                var mock1 = new MockUndo(true);
                var mock2 = new MockUndo(true);

                var operationSet = new OperationSet(this);

                operationSet.Add(mock1);
                operationSet.Add(mock2);

                operationSet.Redo();
                Assert.IsTrue(mock1.RedoCalled);
                Assert.IsTrue(mock2.RedoCalled);
            }
예제 #3
0
            public void UndoOrderTest()
            {
                var finalValue = 0;
                var mock1      = new MockUndo(true);

                var operationSet = new OperationSet(this);

                operationSet.Add(mock1);
                operationSet.Add(new ActionUndo(this, () => finalValue = 1));
                operationSet.Add(new ActionUndo(this, () => finalValue = 2));

                operationSet.Undo();

                Assert.IsTrue(mock1.UndoCalled);
                Assert.AreEqual(1, finalValue);
            }