Exemple #1
0
    def test_move_directions(self):
        move = MarsRoverInstructions.move_direction('E')
        self.assertEqual(move, (1, 0))

        move = MarsRoverInstructions.move_direction('W')
        self.assertEqual(move, (-1, 0))

        move = MarsRoverInstructions.move_direction('N')
        self.assertEqual(move, (0, 1))

        move = MarsRoverInstructions.move_direction('S')
        self.assertEqual(move, (0, -1))
    def test_move_directions(self):
        move = MarsRoverInstructions.move_direction('E')
        self.assertEqual(move, (1, 0))

        move = MarsRoverInstructions.move_direction('W')
        self.assertEqual(move, (-1, 0))

        move = MarsRoverInstructions.move_direction('N')
        self.assertEqual(move, (0, 1))

        move = MarsRoverInstructions.move_direction('S')
        self.assertEqual(move, (0, -1))
Exemple #3
0
 def test_move_directions_keyerror(self):
     with self.assertRaises(KeyError):
         MarsRoverInstructions.move_direction('NW')
 def test_move_directions_keyerror(self):
     with self.assertRaises(KeyError):
         MarsRoverInstructions.move_direction('NW')