示例#1
0
    def test__setUpInitialDecks(self):
        game = Game()
        game.addPlayer(Player(name="Player 1"))
        game.addPlayer(Player(name="Player 2"))
        game.SupplyArea.EstatePile = game._makePile(dominion_data.cards['estate'], 20)
        game.SupplyArea.CopperPile = game._makePile(dominion_data.cards['copper'], 20)

        game._setUpInitialDecks()
        for player in game.Players:
            self.assertEqual(player.DrawPile.len(), 10)
        self.assertEqual(game.SupplyArea.EstatePile.len(), (20 - (dominion_rules.FIRST_DECK.ESTATE_CARDS * 2)))
        self.assertEqual(game.SupplyArea.CopperPile.len(), (20 - (dominion_rules.FIRST_DECK.COPPER_CARDS * 2)))
示例#2
0
    def test_setUpGame(self):
        self.mocker.StubOutWithMock(Game, '_setUpTreasureCards')
        Game._setUpTreasureCards()
        self.mocker.StubOutWithMock(Game, '_setUpVictoryCards')
        Game._setUpVictoryCards()
        self.mocker.StubOutWithMock(Game, '_setUpCurseCards')
        Game._setUpCurseCards()
        self.mocker.StubOutWithMock(Game, '_setUpKingdomCards')
        Game._setUpKingdomCards()
        self.mocker.StubOutWithMock(Game, '_setUpInitialDecks')
        Game._setUpInitialDecks()
        self.mocker.StubOutWithMock(Game, '_drawFirstHands')
        Game._drawFirstHands()
        self.mocker.ReplayAll()

        game = Game()
        game.setUpGame()
        self.mocker.VerifyAll()