Ejemplo n.º 1
0
        public void when_the_rover_is_created_and_move_so_that_facing_west_and_move_coordinates_will_be_1_0()
        {
            var commands = new List <string> {
                "0 0 N", "LMLMLMLMM"
            };

            var rover = new MarsRover(_plateau);

            rover.SetRoverDirection(commands);
            rover.TurnRight();
            rover.Forward();
            rover.Forward();
            rover.TurnRight();
            rover.TurnRight();
            Assert.That(rover.Direction, Is.TypeOf <West>());
            rover.Forward();
            Assert.That(rover.CoordinateX, Is.EqualTo(1));
            Assert.That(rover.CoordinateY, Is.EqualTo(0));
        }
Ejemplo n.º 2
0
        public void when_rover_is_created_is_facing_north_and_nav_fwd_rover_will_be_at_coords_0_1()
        {
            var commands = new List <string> {
                "0 0 N", "LMLMLMLMM"
            };

            var rover = new MarsRover(_plateau);

            rover.SetRoverDirection(commands);
            rover.Forward();
            Assert.That(rover.CoordinateX, Is.EqualTo(0));
            Assert.That(rover.CoordinateY, Is.EqualTo(1));
        }
Ejemplo n.º 3
0
        public void when__rover_is_created_turn_right_and_move_rover_will_be_at_coords_1_0()
        {
            var commands = new List <string> {
                "0 0 N", "LMLMLMLMM"
            };

            var rover = new MarsRover(_plateau);

            rover.SetRoverDirection(commands);

            rover.TurnRight();
            rover.Forward();
            Assert.That(rover.CoordinateX, Is.EqualTo(1));
            Assert.That(rover.CoordinateY, Is.EqualTo(0));
        }