public void RevertShouldRestoreStateFromDifferentDistances(int targetPosition) { command = new MoveCursorCommand(targetPosition); var oldState = new ControllerState(state); var applyResult = command.Apply(state); applyResult.Should().BeTrue(); var result = command.Revert(state); result.Should().BeTrue(); state.Should().Be(oldState); }
public void RevertShouldRestoreStateFromDifferentPositions(int startPosition) { state.CurrentPosition = startPosition; command = new MoveCursorCommand(1); var oldState = new ControllerState(state); var applyResult = command.Apply(state); applyResult.Should().BeTrue(); var result = command.Revert(state); result.Should().BeTrue(); state.Should().Be(oldState); }