예제 #1
0
    def test_move_unavailable_west(self):

        plateau = Plateau(5, 10)
        rover = MarsRover(0, 10, 'W', plateau)
        rover.move()
        result = plateau.check_move_available(rover)
        self.assertEqual(result, True)
예제 #2
0
    def rotate_left_from_east(self):

        plateau = Plateau(30, 30)
        rover = MarsRover(20, 20, 'E', plateau)
        rover.rotate_left()
        self.assertEqual(rover.heading, 'N')
예제 #3
0
    def test_move_forward_west(self):

        plateau = Plateau(30, 30)
        rover = MarsRover(20, 20, 'W', plateau)
        rover.move()
        self.assertEqual(rover.X, 19)
예제 #4
0
    def test_move_forward_south(self):

        plateau = Plateau(30, 30)
        rover = MarsRover(20, 20, 'S', plateau)
        rover.move()
        self.assertEqual(rover.Y, 19)
예제 #5
0
    def rotate_right_from_west(self):

        plateau = Plateau(30, 30)
        rover = MarsRover(20, 20, 'W', plateau)
        rover.rotate_right()
        self.assertEqual(rover.heading, 'N')