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 UndoTest() { var mock1 = new MockUndo(true); var mock2 = new MockUndo(true); var operationSet = new OperationSet(this); operationSet.Add(mock1); operationSet.Add(mock2); operationSet.Undo(); Assert.IsTrue(mock1.UndoCalled); Assert.IsTrue(mock2.UndoCalled); }
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); }