Exemplo n.º 1
0
    def testAnyHutWithMoreThanSevenResources(self):
        hut = AnyHut()
        resources = [Resource.wood,Resource.wood,Resource.wood,Resource.stone,Resource.stone,Resource.stone,Resource.stone,Resource.stone]
        
        self.assertEqual([], hut.missing(resources))
        self.assertEqual(0, hut.value(), "value should be 0 before cost is calculated")

        self.assertEqual([Resource.wood,Resource.wood,Resource.wood,Resource.stone,Resource.stone,Resource.stone,Resource.stone], hut.costs(resources))
        self.assertEqual(29, hut.value(), "value should be 29")
Exemplo n.º 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")
Exemplo n.º 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))
Exemplo n.º 4
0
 def testAnyHutWithJokerResource(self):
     hut = AnyHut()
     resources = [Resource.joker]
     
     self.assertEqual([], hut.missing(resources))
     self.assertEqual([Resource.gold], hut.costs(resources))
Exemplo n.º 5
0
 def testAnyHutWithNoResources(self):
     hut = AnyHut()
     resources = []
     
     self.assertEqual([Resource.wood], hut.missing(resources))
Exemplo n.º 6
0
 def testAnyHutWithOnlyFood(self):
     hut = AnyHut()
     resources = [Resource.food,Resource.food]
     
     self.assertEqual([Resource.wood], hut.missing(resources))
     self.assertEqual([], hut.costs(resources))
Exemplo n.º 7
0
 def testAnyHutWithOnlyFood(self):
     hut = AnyHut()
     resources = [2,2]
     
     self.assertEqual([3], hut.missing(resources))
     self.assertEqual([], hut.costs(resources))
Exemplo n.º 8
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))
Exemplo n.º 9
0
    def testAnyHutWithOnlyFood(self):
        hut = AnyHut()
        resources = [2, 2]

        self.assertEqual([3], hut.missing(resources))
        self.assertEqual([], hut.costs(resources))
Exemplo n.º 10
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))
Exemplo n.º 11
0
    def testAnyHutWithNoResources(self):
        hut = AnyHut()
        resources = []

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