Пример #1
0
def checkGameOver(game):
  for i in range(8):
    assert(d.isGameOver(game) == 0)
    d.gainCard(c.province,game,0,0)
  assert(d.isGameOver(game) == 1)

  print "TEST CASE PASSED"
Пример #2
0
def checkGameOver2(game):
  for i in range(10):
    assert(d.isGameOver(game) == 0)
    d.gainCard(c.ambassador,game,0,0)
  for i in range(10):
    assert(d.isGameOver(game) == 0)
    d.gainCard(c.adventurer,game,0,0)
  for i in range(10):
    assert(d.isGameOver(game) == 0)
    d.gainCard(c.baron,game,0,0)
  assert(d.isGameOver(game) == 1)
  
  print "TEST CASE PASSED"
Пример #3
0
def test_isGameOver():
    ##kingdomCards = [d.Adventurer, d.Ambassador, d.Baron, d.Council_Room, d.Cutpurse, d.Embargo, d.Feast, d.Gardens, d.Great_Hall, d.Village]
    print("Tetsing isGameOver")
    r = d.initializeGame(numPlayers, kingdomCards,randomSeed)
    r.supplyCount[d.Province] = 0
    s = d.isGameOver(r)
    assert(s == 1)
    print ("Game Over: SUpply of province exhausted")
    print "Supply of province:"
    print r.supplyCount[d.Province]

    r = d.initializeGame(2, kingdomCards,111)
    r.supplyCount[d.Duchy] = 0
    r.supplyCount[d.Estate] = 0
    r.supplyCount[d.Village] = 0
    s = d.isGameOver(r)
    assert(s == 1)
    print ("Game Over:Supply of 3 piles is empty")
    print r.supplyCount[d.Duchy]
    print r.supplyCount[d.Estate]
    print r.supplyCount[d.Village]
Пример #4
0
   def act55(self):
      if self.__collectCov:
         self.__cov.start()
      try:
         __result = mydom.isGameOver(self.p_GAME[0])

      finally:
         if self.__collectCov:
            self.__cov.stop()
            self.__updateCov()
      __result_REF = otherdom.isGameOver(self.p_GAME_REF[0])

      assert __result == __result_REF, " (%s) == (%s) " % (__result, __result_REF)