예제 #1
0
    def test_executeCommand_for_R_executes_spinRight(self):
        # arrange
        rover = Rover(0, 0, "N")

        # act
        rover.executeCommand("R")

        # assert
        self.assertEqual(
            rover.orientation,
            "E",
        )
예제 #2
0
    def test_executeCommand_for_L_executes_spinLeft(self):
        # arrange
        rover = Rover(0, 0, "N")

        # act
        rover.executeCommand("L")

        # assert
        self.assertEqual(
            rover.orientation,
            "W",
        )
예제 #3
0
    def test_executeCommand_for_M_executes_move(self):
        # arrange
        x = 2
        y = 2
        rover = Rover(x, y, "N")

        # act
        rover.executeCommand("M")

        # assert
        self.assertEqual(
            rover.yCoord,
            y + 1,
        )