def test_10_move_vertical_S(self): test_bot = RobotController( fix_input_grid("5 5"), fix_input_start_pos("3 3 S"), fix_input_moves("RFLFFLRF"), ) test_bot.vertical_move() self.assertEqual(test_bot.current_row, 4)
def test_8_move_horizontal_W(self): test_bot = RobotController( fix_input_grid("5 5"), fix_input_start_pos("2 0 W"), fix_input_moves("RFLFFLRF"), ) test_bot.vertical_move() self.assertEqual(test_bot.current_column, 2)
def test_7_move_horizontal_E(self): test_bot = RobotController( fix_input_grid("5 5"), fix_input_start_pos("0 0 E"), fix_input_moves("RFLFFLRF"), ) test_bot.horizontal_move() self.assertEqual(test_bot.current_column, 1)
def test_5_turn_left(self): test_bot = RobotController( fix_input_grid("5 5"), fix_input_start_pos("0 0 E"), fix_input_moves("RFLFFLRF"), ) test_bot.turn("L") self.assertEqual(test_bot.direction, "N")
def test_3_test_robot_init(self): test_bot = RobotController( fix_input_grid("5 5"), fix_input_start_pos("0 0 E"), fix_input_moves("RFLFFLRF"), ) self.assertEqual(test_bot.current_row, 0) self.assertEqual(test_bot.current_column, 0) self.assertEqual(test_bot.direction, "E") self.assertEqual(test_bot.commands[-1], "F")
def test_14_output(self): test_bot = RobotController( fix_input_grid("5 5"), fix_input_start_pos("0 0 E"), fix_input_moves("RFLFFLRF"), ) test_bot.move() test_bot.position() self.assertEqual(test_bot.current_position, "3 1 E")