Пример #1
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()
Пример #2
0
    def test__setUpKingdomCards(self):
        dominion_data.decks['first-game'] = ['cellar',
                                             'market',
                                             'militia',
                                             'mine',
                                             'moat',]
        self.mocker.StubOutWithMock(Game, '_makePile')
        for cardName in dominion_data.decks['first-game']:
            Game._makePile(dominion_data.cards[cardName], dominion_rules.GAME_SETUP.KINGDOM_CARDS).AndReturn("%s pile" % cardName)
        self.mocker.ReplayAll()

        game = Game()
        game._setUpKingdomCards()
        self.assertEqual(len(game.SupplyArea.KingdomPiles), 5)
        self.assertEqual(game.SupplyArea.KingdomPiles['Cellar'], "cellar pile")
        self.assertEqual(game.SupplyArea.KingdomPiles['Market'], "market pile")
        self.assertEqual(game.SupplyArea.KingdomPiles['Militia'], "militia pile")
        self.assertEqual(game.SupplyArea.KingdomPiles['Mine'], "mine pile")
        self.assertEqual(game.SupplyArea.KingdomPiles['Moat'], "moat pile")
        self.mocker.VerifyAll()