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); }
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); }
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); }