def test_right_rotates_robot_90_degrees_to_the_right_when_facing_west( self): robot = ToyRobot(4, 4, "WEST") robot.right() self.assertEqual(robot.x, 4) self.assertEqual(robot.y, 4) self.assertEqual(robot.direction, "NORTH")
def test_right(self): toyRobot = ToyRobot() toyRobot.right() # right must not work before place self.assertEqual(toyRobot.report(), None) toyRobot.place(0, 0, Direction.NORTH) toyRobot.right() self.assertEqual(toyRobot.report(), "0, 0, EAST") toyRobot.right() self.assertEqual(toyRobot.report(), "0, 0, SOUTH") toyRobot.right() self.assertEqual(toyRobot.report(), "0, 0, WEST") toyRobot.right() self.assertEqual(toyRobot.report(), "0, 0, NORTH")