Beispiel #1
0
 def test_possibleLongestRoadLength_one_road_in_each_direction(self):
     setupAddingRoad = Road(Point(1,1), Point(2,0), -1)
     setupExistingRoad = [Road(Point(1,0), Point(1,1), 1), \
                              Road(Point(2,0), Point(2,1), 1)]
     player = Player(1)
     result = player.possibleLongestRoadLength(setupAddingRoad,\
                          setupExistingRoad)
     self.assertEqual(result, 3)
Beispiel #2
0
 def test_possibleLongestRoadLength_cycle(self):
     setupAddingRoad = Road(Point(1,1), Point(2,0), -1)
     setupExistingRoad = [Road(Point(1,0), Point(1,1), 1), \
                              Road(Point(0,1), Point(1,1), 1), \
                              Road(Point(0,2), Point(1,1), 1), \
                              Road(Point(1,2), Point(1,1), 1), \
                              Road(Point(2,1), Point(1,1), 1)]
     player = Player(1)
     result = player.possibleLongestRoadLength(setupAddingRoad,\
                          setupExistingRoad)
     self.assertEqual(result, 6)
Beispiel #3
0
 def test_possibleLongestRoadLength_base_case_add_one(self):
     setupAddingRoad = Road(Point(1,1), Point(2,0), 1)
     setupExistingRoad = [Road(Point(1,1), Point(2,1), 1)]
     player = Player(1)
     result = player.possibleLongestRoadLength(setupAddingRoad, setupExistingRoad)
     self.assertEqual(result, 2)