public void Redo_MultipleActions_RedoesActionsInOriginalOrder() { var action = new UndoActionSequence <IUndoAction>(NewAction("a"), NewAction("b"), NewAction("c")); Assert.IsTrue(action.Redo()); Assert.AreEqual(3, m_actionsTaken.Count); int i = 0; Assert.AreEqual("Redo a", m_actionsTaken[i++]); Assert.AreEqual("Redo b", m_actionsTaken[i++]); Assert.AreEqual("Redo c", m_actionsTaken[i++]); }
public void Redo_OneActionCannotBeRedone_UndoesActionsThatWereRedoneToGetBackToStateBeforeCallingRedo() { var action = new UndoActionSequence <IUndoAction>(NewAction("a"), NewAction("b"), NewAction("c", true, false)); Assert.IsFalse(action.Redo()); Assert.AreEqual(5, m_actionsTaken.Count); int i = 0; Assert.AreEqual("Redo a", m_actionsTaken[i++]); Assert.AreEqual("Redo b", m_actionsTaken[i++]); Assert.AreEqual("Failed to redo c", m_actionsTaken[i++]); Assert.AreEqual("Undo b", m_actionsTaken[i++]); Assert.AreEqual("Undo a", m_actionsTaken[i++]); }