public void Redo_PerformsRedo() { var commandExecutionManager = new CommandExecutionManager(); var commandMock = new Mock <ICommand>(); commandExecutionManager.ExecuteCommand(commandMock.Object); commandExecutionManager.Undo(); commandExecutionManager.Redo(); commandMock.Verify(c => c.Execute(), Times.Exactly(2)); }
public void ExecuteCommand_ClearsUndoHistory() { var commandExecutionManager = new CommandExecutionManager(); var commandMock = new Mock <ICommand>(); commandExecutionManager.ExecuteCommand(commandMock.Object); commandExecutionManager.Undo(); commandExecutionManager.ExecuteCommand(commandMock.Object); Assert.Throws <InvalidOperationException>(() => commandExecutionManager.Redo()); }
public void Redo_NothingToRedo_InvalidOperationException() { var commandExecutionManager = new CommandExecutionManager(); Assert.Throws <InvalidOperationException>(() => commandExecutionManager.Redo()); }