示例#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")
示例#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")
示例#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))
示例#4
0
 def testAnyHutWithJokerResource(self):
     hut = AnyHut()
     resources = [Resource.joker]
     
     self.assertEqual([], hut.missing(resources))
     self.assertEqual([Resource.gold], hut.costs(resources))
示例#5
0
 def testAnyHutWithNoResources(self):
     hut = AnyHut()
     resources = []
     
     self.assertEqual([Resource.wood], hut.missing(resources))
示例#6
0
 def testAnyHutWithOnlyFood(self):
     hut = AnyHut()
     resources = [Resource.food,Resource.food]
     
     self.assertEqual([Resource.wood], hut.missing(resources))
     self.assertEqual([], hut.costs(resources))
示例#7
0
 def testAnyHutWithOnlyFood(self):
     hut = AnyHut()
     resources = [2,2]
     
     self.assertEqual([3], hut.missing(resources))
     self.assertEqual([], hut.costs(resources))
示例#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))
示例#9
0
    def testAnyHutWithOnlyFood(self):
        hut = AnyHut()
        resources = [2, 2]

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

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