Exemple #1
0
    def testAnyHutWithMoreThanSevenResources(self):
        hut = AnyHut()
        resources = [3,3,3,5,5,5,5,5]
        
        self.assertEqual([], hut.missing(resources))
        self.assertEqual(0, hut.value(), "value should be 0 before cost is calculated")

        self.assertEqual([3,3,3,5,5,5,5], hut.costs(resources))
        self.assertEqual(29, hut.value(), "value should be 29")
Exemple #2
0
    def testAnyHutWithMoreThanSevenResources(self):
        hut = AnyHut()
        resources = [3, 3, 3, 5, 5, 5, 5, 5]

        self.assertEqual([], hut.missing(resources))
        self.assertEqual(0, hut.value(),
                         "value should be 0 before cost is calculated")

        self.assertEqual([3, 3, 3, 5, 5, 5, 5], hut.costs(resources))
        self.assertEqual(29, hut.value(), "value should be 29")
Exemple #3
0
 def testAnyHutWithResources(self):
     hut = AnyHut()
     resources = [Resource.food,Resource.food,Resource.wood,Resource.stone,Resource.stone]
     
     self.assertEqual([], hut.missing(resources))
     self.assertEqual([Resource.wood,Resource.stone,Resource.stone], hut.costs(resources))
Exemple #4
0
 def testAnyHutWithJokerResource(self):
     hut = AnyHut()
     resources = [Resource.joker]
     
     self.assertEqual([], hut.missing(resources))
     self.assertEqual([Resource.gold], hut.costs(resources))
Exemple #5
0
 def testAnyHutWithOnlyFood(self):
     hut = AnyHut()
     resources = [Resource.food,Resource.food]
     
     self.assertEqual([Resource.wood], hut.missing(resources))
     self.assertEqual([], hut.costs(resources))
Exemple #6
0
 def testAnyHutWithOnlyFood(self):
     hut = AnyHut()
     resources = [2,2]
     
     self.assertEqual([3], hut.missing(resources))
     self.assertEqual([], hut.costs(resources))
Exemple #7
0
 def testAnyHutWithResources(self):
     hut = AnyHut()
     resources = [2,2,3,5,5]
     
     self.assertEqual([], hut.missing(resources))
     self.assertEqual([3,5,5], hut.costs(resources))
Exemple #8
0
    def testAnyHutWithOnlyFood(self):
        hut = AnyHut()
        resources = [2, 2]

        self.assertEqual([3], hut.missing(resources))
        self.assertEqual([], hut.costs(resources))
Exemple #9
0
    def testAnyHutWithResources(self):
        hut = AnyHut()
        resources = [2, 2, 3, 5, 5]

        self.assertEqual([], hut.missing(resources))
        self.assertEqual([3, 5, 5], hut.costs(resources))