Exemplo n.º 1
0
        public void ExecuteCommand_Command_ReturnsCorrectPositionAndDirection(string input, string output, int positionX, int positionY, char direction)
        {
            Rover rover = new Rover(positionX, positionY, direction);

            rover.ExecuteCommands(input);

            Assert.Equal(output, rover.Output());
        }
Exemplo n.º 2
0
        public void  MoveRover_GivenSingleCommand_ReturnCorrectPosition(string[] input, string expectedRoverPosition)
        {
            var   plateau       = CommandHelper.GetPlateauFromCommandText(input[0]);
            var   roverPosition = CommandHelper.GetRoverPositionFromCommandText(input[1]);
            var   roverCommands = CommandHelper.GetRoverCommandsFromCommandText(input[2]);
            Rover rover         = new Rover(plateau, roverPosition);

            rover.ExecuteCommands(roverCommands);

            Assert.Equal(rover.GetRoverPositionDetailedString(), expectedRoverPosition);
        }