Пример #1
0
def checkScore(game):
  score = d.scoreFor(0,game)
  assert(score == 3)
  d.updateCoins(0,game,20)
  d.buyCard(c.province,game)
  d.endTurn(game)
  d.updateCoins(0,game,20)
  d.buyCard(c.duchy,game)
  score = d.scoreFor(0,game)
  assert(score == 9)
  score = d.scoreFor(1,game)
  assert(score == 6)
  d.endTurn(game)
  d.updateCoins(0,game,20)
  d.buyCard(c.great_hall,game)
  d.endTurn(game)
  d.updateCoins(0,game,20)
  d.buyCard(c.gardens,game)
  score = d.scoreFor(0,game)
  assert(score == 10)
  for i in range(10):
    d.gainCard(c.silver,game,1,1)
  score = d.scoreFor(1,game)
  assert(score == 7)
  
  print "TEST CASE PASSED"  
Пример #2
0
def test_getWinners():
    ##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 getWinners")
    p = d.initializeGame(numPlayers, kingdomCards,randomSeed)
    p.discard[0].append(d.Province)
    p.discard[1].append(d.Province)
    for player in range(numPlayers):
        print "Score of Player: %d" %player
        print d.scoreFor(player,p)
    r = d.getWinners(p)
    assert(r!=-1)
    print("Player Won:")
    print r
Пример #3
0
   def act54(self):
      if self.__collectCov:
         self.__cov.start()
      try:
         __result = mydom.scoreFor (self.p_PLAYER[0],self.p_GAME[0])

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

      assert __result == __result_REF, " (%s) == (%s) " % (__result, __result_REF)
Пример #4
0
def test_scoreFor():
    kingdomCards = [d.Adventurer, d.Ambassador, d.Baron, d.Council_Room, d.Cutpurse, d.Embargo, d.Feast, d.Gardens, d.Great_Hall, d.Village]
    print("Testing scoreFor()")
    r = d.initializeGame(2, kingdomCards,111)
    assert(r!=-1)
    print "Hand"
    print r.hand[0]
    print "Deck"
    print r.deck[0]
    print "Discard"
    print r.discard[0]
    x = d.scoreFor(0,r)
    assert(x!= -1)
    print ("Score for player : 0 is:")
    print x
Пример #5
0
def test_scoreFor():
    ##kingdomCards = [d.Adventurer, d.Ambassador, d.Baron, d.Council_Room, d.Cutpurse, d.Embargo, d.Feast, d.Gardens, d.Great_Hall, d.Village]
    print("Testing scoreFor()")
    r = d.initializeGame(numPlayers, kingdomCards,randomSeed)
    assert(r!=-1)
    for player in range(numPlayers):
        print "Hand: %d" %player
        print r.hand[player]
        print "Deck: %d" %player
        print r.deck[player]
        print "Discard: %d" %player
        print r.discard[player]
        x = d.scoreFor(player,r)
        assert(x!= -1)
        print ("Score for player : %d is:" %player)
        print x