Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }