protected override void Because() { _removePartialStabiCommand.RestoreExecutionData(_executionContext); _restorePartialStabiCommand = _removePartialStabiCommand.InverseCommand(_executionContext); _restorePartialStabiCommand.Execute(_executionContext); }
protected override void Because() { _removePartialStabiCommand.RestoreExecutionData(_executionContext); _restorePartialStabiCommand = _removePartialStabiCommand.InverseCommand(_executionContext).DowncastTo <IReversibleCommand <IExecutionContext> >(); _restorePartialStabiCommand.Execute(_executionContext); }
public void AddExecute(IReversibleCommand command) { command.Execute(); this.UndoCommands.Push(command); // Too simple? this.RedoCommands.Clear(); }
protected override void Context() { base.Context(); //Add sut.Execute(_executionContext); //Remove sut.RestoreExecutionData(_executionContext); _removePartialStabiCommand = sut.InverseCommand(_executionContext); _removePartialStabiCommand.Execute(_executionContext); }
public void ExecuteCommand(IReversibleCommand command) { if (command == null) { throw new ArgumentNullException(nameof(command)); } command.Execute(); this.undoCommandStack.Push(command); }
protected override void Context() { base.Context(); sut.Execute(_executionContext); sut.RestoreExecutionData(_executionContext); _inverseCommand = sut.InverseCommand(_executionContext).DowncastTo <IReversibleCommand <IExecutionContext> >(); _inverseCommand.Execute(_executionContext); _inverseCommand.RestoreExecutionData(_executionContext); _redoCommand = _inverseCommand.InverseCommand(_executionContext).DowncastTo <IReversibleCommand <IExecutionContext> >(); }
protected override void Context() { base.Context(); sut.Execute(_executionContext); sut.RestoreExecutionData(_executionContext); _inverseCommand = sut.InverseCommand(_executionContext); _inverseCommand.Execute(_executionContext); _inverseCommand.RestoreExecutionData(_executionContext); _redoCommand = _inverseCommand.InverseCommand(_executionContext); }
public void Redo() { if (redoList.Count == 0) { return; } IReversibleCommand reversibleCommand = redoList.First.Value; redoList.RemoveFirst(); reversibleCommand.Execute(); undoList.AddFirst(reversibleCommand); }
public static IReversibleCommand <IOSPSuiteExecutionContext> ExecuteAndInvokeInverse(this IReversibleCommand <IOSPSuiteExecutionContext> command, IOSPSuiteExecutionContext context) { command.Execute(context); return(command.InvokeInverse(context)); }
public void should_execute_the_inverse_command() { A.CallTo(() => _inverseCommand.Execute(_executionContext)).MustHaveHappened(); }
protected override void Because() { _result = sut.InverseCommand(_executionContext); _result.Execute(_executionContext); }
protected override void Because() { _inverseCommand.Execute(_executionContext); }
public static ICommand <IMoBiContext> ExecuteAndInvokeInverse(this IReversibleCommand <IMoBiContext> command, IMoBiContext context) { command.Execute(context); return(command.InvokeInverse(context)); }
public void AddToActionAndExecute(IReversibleCommand reversibleCommand) { currentActionStack.Push(reversibleCommand); reversibleCommand.Execute(); }