// ReSharper disable InconsistentNaming public void Undo_Expected_Positive() // ReSharper restore InconsistentNaming { ActionManager actManager = new ActionManager(); actManager.RecordAction(_mockAction.Object); actManager.Undo(); Assert.IsTrue(actManager.CanRedo); }
public void Two_Actions_One_Undo_Expected_CanUndo_true() { ActionManager actManager = new ActionManager(); actManager.RecordAction(_mockAction.Object); actManager.RecordAction(_mockAction.Object); actManager.Undo(); Assert.IsTrue(actManager.CanUndo && actManager.CanRedo); }
// ReSharper disable InconsistentNaming public void RecordAction_ExecutingAction_Expected_No_Action() // ReSharper restore InconsistentNaming { ActionManager actManager = new ActionManager { ExecuteImmediatelyWithoutRecording = true }; actManager.RecordAction(_mockAction.Object); Assert.IsTrue(!actManager.CanUndo && !actManager.CanRedo); }
// ReSharper disable InconsistentNaming public void RecordAction_Null_Action_Expected_No_Action() // ReSharper restore InconsistentNaming { ActionManager actManager = new ActionManager(); actManager.RecordAction(null); Assert.IsTrue(!actManager.CanUndo && !actManager.CanRedo); }