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)
示例#2
0
 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)
示例#4
0
 def test_validate_move_right_min_x(self):
     actual_value = validate_move({"x": 0, "y": 2}, 4)
     self.assertTrue(actual_value)
示例#5
0
 def test_validate_move_up_max_x(self):
     actual_value = validate_move({"x": 0, "y": 4}, 1)
     self.assertTrue(actual_value)
示例#6
0
    def test_validate_move_with_valid_input(self):
        moves = ('n', 's', 'e', 'w')

        for move in moves:
            self.assertTrue(validate_move(move))
示例#7
0
    def test_validate_move_with_invalid_input(self):
        moves = ('North', '1', 'g', 'north')

        for move in moves:
            self.assertFalse(validate_move(move))
示例#8
0
    def test_validate_move_with_valid_input_in_caps(self):
        moves = ('N', 'S', 'E', 'W')

        for move in moves:
            self.assertTrue(validate_move(move))