示例#1
0
 def setUp(self):
     """ Build the Player and Phase List for the test """
     self.match1 = NumberSet(1)
     self.match2 = NumberSet(1)
     self.phase1 = Phase([self.match1, self.match2])
     self.phase2 = Phase([])
     self.phaseList = PhaseList([self.phase1, self.phase2])
     self.player = Player("", self.phaseList)
示例#2
0
    def setUp(self):
        """ Build the Round and Players for the test """
        self.player1 = Player("", StandardPhaseList)
        self.player2 = Player("", StandardPhaseList)
        self.round = Round([self.player1, self.player2])

        self.player1 = self.round.players[0]
        self.player2 = self.round.players[1]
示例#3
0
class completePhase(unittest.TestCase):
    """ Test cases of completePhase """
    def setUp(self):
        """ Build the Player and Phase List for the test """
        self.match1 = NumberSet(1)
        self.match2 = NumberSet(1)
        self.phase1 = Phase([self.match1, self.match2])
        self.phase2 = Phase([])
        self.phaseList = PhaseList([self.phase1, self.phase2])
        self.player = Player("", self.phaseList)

    def nextPhase(self):
        """ Test that the player is now on the next phase """
        self.player.completePhase()
        assert self.player.phase == self.phase2, "Player should now be on the next phase"
示例#4
0
class completePhase(unittest.TestCase):
    """ Test cases of completePhase """
    
    def  setUp(self):
        """ Build the Player and Phase List for the test """
        self.match1 = NumberSet(1)
        self.match2 = NumberSet(1)
        self.phase1 = Phase([self.match1, self.match2])
        self.phase2 = Phase([])
        self.phaseList = PhaseList([self.phase1, self.phase2])
        self.player = Player("", self.phaseList)
        
    def nextPhase(self):
        """ Test that the player is now on the next phase """
        self.player.completePhase()
        assert self.player.phase == self.phase2, "Player should now be on the next phase"
示例#5
0
 def  setUp(self):
     """ Build the Player and Phase List for the test """
     self.match1 = NumberSet(1)
     self.match2 = NumberSet(1)
     self.phase1 = Phase([self.match1, self.match2])
     self.phase2 = Phase([])
     self.phaseList = PhaseList([self.phase1, self.phase2])
     self.player = Player("", self.phaseList)
 def setUp(self):
     """ Build the Player Round Wrapper for the test """
     self.match1 = NumberSet(1)
     self.match2 = NumberSet(1)
     self.phase1 = Phase([self.match1, self.match2])
     self.phase2 = Phase([])
     self.phaseList = PhaseList([self.phase1, self.phase2])
     self.player = Player("", self.phaseList)
     self.matchPileManager = MatchPileManager()
     self.hand = [NumberCard(1, None), NumberCard(2, None)]
     self.playerRoundWrapper = PlayerRoundWrapper(self.player, self.hand,
                                                  self.matchPileManager)
示例#7
0
文件: game.py 项目: cloew/KaoPhaseTen
 def __init__(self, numberOfPlayers, names, phaseList=StandardPhaseList):
     """ Initialize the game """
     self.players = []
     for i in range(numberOfPlayers):
         self.players.append(Player(names[i], phaseList))