public void CanRedoWhenACommandHasBeenUndone() { var commandStack = new CommandStack(); var mockCommand = new Mock<ICommand>(); commandStack.Execute(mockCommand.Object); commandStack.Undo(); Assert.IsTrue(commandStack.CanRedo()); }
public void CanNotRedoWhenACommandIsUndoneThenAnotherCommandIsExecuted() { var commandStack = new CommandStack(); var mockCommand = new Mock<ICommand>(); var mockCommand2 = new Mock<ICommand>(); commandStack.Execute(mockCommand.Object); commandStack.Undo(); commandStack.Execute(mockCommand2.Object); Assert.IsFalse(commandStack.CanRedo()); }
public void CanNotRedoWhenNoCommandsHaveBeenExecuted() { var commandStack = new CommandStack(); Assert.IsFalse(commandStack.CanRedo()); }