Beispiel #1
0
        public void MovingWhenAtTheEdgeShouldWrap(Rover initial, List <string> commands, Rover expected)
        {
            var commandCenter = new RoverCommandCenter(initial, 10);

            commandCenter.Execute(commands);

            commandCenter.Rover.ShouldBe(expected);
        }
Beispiel #2
0
        public void StopsAtObstacle(Rover initial, List <string> commands, Rover expected, Planet planet)
        {
            var commandCenter = new RoverCommandCenter(initial, planet);

            commandCenter.Execute(commands);

            commandCenter.Rover.ShouldBe(expected);
        }
Beispiel #3
0
        public void MarsRoverCanTurnLeft(Rover initial, List <string> commands, Rover expected)
        {
            var commandCenter = new RoverCommandCenter(initial);

            commandCenter.Execute(commands);

            commandCenter.Rover.ShouldBe(expected);
        }
Beispiel #4
0
        public void CanContinueAfterStoppingAtObstacle()
        {
            var commandCenter = new RoverCommandCenter(new Rover(new Position(0, 0), Direction.North), new Planet(10, new List <Position> {
                new Position(0, 1)
            }));

            commandCenter.Execute(new List <string> {
                "f", "l", "f", "f"
            });

            commandCenter.Execute(new List <string> {
                "l", "f", "f", "r", "f"
            });

            commandCenter.Rover.ShouldBe(new Rover(new Position(-2, 1), Direction.North));
        }
Beispiel #5
0
        public void MarsRoverPosition()
        {
            var commandCenter = new RoverCommandCenter(new Rover(new Position(5, 3), Direction.South));

            commandCenter.Rover.ShouldBe(new Rover(new Position(5, 3), Direction.South));
        }