def test_facing_west_decrements_x(self): robot = Robot(WEST, 0, 0) robot.move("A") self.assertEqual(robot.coordinates, (-1, 0)) self.assertEqual(robot.direction, WEST)
def test_facing_south_decrements_y(self): robot = Robot(SOUTH, 0, 0) robot.move("A") self.assertEqual(robot.coordinates, (0, -1)) self.assertEqual(robot.direction, SOUTH)
def test_facing_east_increments_x(self): robot = Robot(EAST, 0, 0) robot.move("A") self.assertEqual(robot.coordinates, (1, 0)) self.assertEqual(robot.direction, EAST)
def test_changes_south_to_east(self): robot = Robot(SOUTH, 0, 0) robot.move("L") self.assertEqual(robot.coordinates, (0, 0)) self.assertEqual(robot.direction, EAST)
def test_moving_west_and_north(self): robot = Robot(NORTH, 0, 0) robot.move("LAAARALA") assert robot.coordinates == (-4, 1) assert robot.direction == WEST
def test_moving_west_and_south(self): robot = Robot(EAST, 2, -7) robot.move("RRAAAAALA") self.assertEqual(robot.coordinates, (-3, -8)) self.assertEqual(robot.direction, SOUTH)
def test_changes_north_to_west(self): robot = Robot(NORTH, 0, 0) robot.move("L") self.assertEqual(robot.coordinates, (0, 0)) self.assertEqual(robot.direction, WEST)
def test_changes_east_to_north(self): robot = Robot(EAST, 0, 0) robot.move("L") assert robot.coordinates == (0, 0) assert robot.direction == NORTH
def test_facing_north_increments_y(self): robot = Robot(NORTH, 0, 0) robot.move("A") assert robot.coordinates == (0, 1) assert robot.direction == NORTH
def test_changes_west_to_south(self): robot = Robot(WEST, 0, 0) robot.move("L") assert robot.coordinates == (0, 0) assert robot.direction == SOUTH
def test_changes_south_to_east(self): robot = Robot(SOUTH, 0, 0) robot.move("L") assert robot.coordinates == (0, 0) assert robot.direction == EAST
def test_changes_north_to_west(self): robot = Robot(NORTH, 0, 0) robot.move("L") assert robot.coordinates == (0, 0) assert robot.direction == WEST
def test_moving_east_and_north(self): robot = Robot(SOUTH, 8, 4) robot.move("LAAARRRALLLL") assert robot.coordinates == (11, 5) assert robot.direction == NORTH
def test_moving_west_and_south(self): robot = Robot(EAST, 2, -7) robot.move("RRAAAAALA") assert robot.coordinates == (-3, -8) assert robot.direction == SOUTH
def test_moving_east_and_north_from_readme(self): robot = Robot(NORTH, 7, 3) robot.move("RAALAL") self.assertEqual(robot.coordinates, (9, 4)) self.assertEqual(robot.direction, WEST)
def test_facing_south_decrements_y(self): robot = Robot(SOUTH, 0, 0) robot.move("A") assert robot.coordinates == (0, -1) assert robot.direction == SOUTH
def test_moving_west_and_north(self): robot = Robot(NORTH, 0, 0) robot.move("LAAARALA") self.assertEqual(robot.coordinates, (-4, 1)) self.assertEqual(robot.direction, WEST)
def test_facing_east_increments_x(self): robot = Robot(EAST, 0, 0) robot.move("A") assert robot.coordinates == (1, 0) assert robot.direction == EAST
def test_moving_east_and_north(self): robot = Robot(SOUTH, 8, 4) robot.move("LAAARRRALLLL") self.assertEqual(robot.coordinates, (11, 5)) self.assertEqual(robot.direction, NORTH)
def test_facing_west_decrements_x(self): robot = Robot(WEST, 0, 0) robot.move("A") assert robot.coordinates == (-1, 0) assert robot.direction == WEST
def test_changes_west_to_south(self): robot = Robot(WEST, 0, 0) robot.move("L") self.assertEqual(robot.coordinates, (0, 0)) self.assertEqual(robot.direction, SOUTH)
def test_facing_north_increments_y(self): robot = Robot(NORTH, 0, 0) robot.move("A") self.assertEqual(robot.coordinates, (0, 1)) self.assertEqual(robot.direction, NORTH)
def test_changes_east_to_north(self): robot = Robot(EAST, 0, 0) robot.move("L") self.assertEqual(robot.coordinates, (0, 0)) self.assertEqual(robot.direction, NORTH)
def test_moving_east_and_north_from_readme(self): robot = Robot(NORTH, 7, 3) robot.move("RAALAL") assert robot.coordinates == (9, 4) assert robot.direction == WEST