def test_validate_move_possible(self): actual = validate_move([(0, 0), (0, 1), (1, 0), (1, 1)], {"Current Position": (0, 0)}, "2") expected = True self.assertEqual(expected, actual)
def test_validate_move_right_max_x(self): actual_value = validate_move({"x": 4, "y": 3}, 4) self.assertFalse(actual_value)
def test_validate_move_impossible_type(self): actual = type( validate_move([(0, 0), (0, 1), (1, 0), (1, 1)], {"Current Position": (0, 0)}, "1")) expected = type(False) self.assertEqual(expected, actual)
def test_validate_move_right_min_x(self): actual_value = validate_move({"x": 0, "y": 2}, 4) self.assertTrue(actual_value)
def test_validate_move_up_max_x(self): actual_value = validate_move({"x": 0, "y": 4}, 1) self.assertTrue(actual_value)
def test_validate_move_with_valid_input(self): moves = ('n', 's', 'e', 'w') for move in moves: self.assertTrue(validate_move(move))
def test_validate_move_with_invalid_input(self): moves = ('North', '1', 'g', 'north') for move in moves: self.assertFalse(validate_move(move))
def test_validate_move_with_valid_input_in_caps(self): moves = ('N', 'S', 'E', 'W') for move in moves: self.assertTrue(validate_move(move))