コード例 #1
0
 def test_rotatesPlayersCorrectly(self):
     game = Game("SomeGameName", self.m)
     game.addPlayer(self.j)
     game.beginGame()
     self.assertRegex(game.currentPlayer.name, self.j.name)
     game.rotateCurrentPlayer()
     self.assertRegex(game.currentPlayer.name, self.m.name)
コード例 #2
0
 def test_rotatesPlayersCorrectly(self):
     game = Game("SomeGameName", self.m)
     game.addPlayer(self.j)
     game.beginGame()
     self.assertRegex(game.currentPlayer.name, self.j.name)
     game.rotateCurrentPlayer()
     self.assertRegex(game.currentPlayer.name, self.m.name)
コード例 #3
0
 def test_returnsRotationOfPlayers(self):
     game = Game("SomeGame", self.m)
     game.addPlayer(self.j)
     game.beginGame()
     self.assertEqual(len(game.currentTurn), 1)
     self.assertRegex(game.currentPlayer.name, self.j.name)
     nextPlayer = game.getNextPlayer()
     self.assertRegex(nextPlayer.name, self.m.name)
     nextPlayer = game.getNextPlayer()
     self.assertRegex(nextPlayer.name, self.j.name)
コード例 #4
0
 def test_returnsRotationOfPlayers(self):
     game = Game("SomeGame", self.m)
     game.addPlayer(self.j)
     game.beginGame()
     self.assertEqual(len(game.currentTurn), 1)
     self.assertRegex(game.currentPlayer.name, self.j.name)
     nextPlayer = game.getNextPlayer()
     self.assertRegex(nextPlayer.name, self.m.name)
     nextPlayer = game.getNextPlayer()
     self.assertRegex(nextPlayer.name, self.j.name)
コード例 #5
0
 def test_dealCardsDealsCorrectly(self):
     deck = Deck()
     game = Game('SomeGameName', self.m)
     game.addPlayer(self.j)  # This isn't really necessary.
     game.dealCards([self.m, self.j], deck)
     self.assertEqual(self.m.hand.size(), 3)
     self.assertEqual(self.m.up.size(), 3)
     self.assertEqual(self.m.down.size(), 3)
     self.assertEqual(self.j.hand.size(), 3)
     self.assertEqual(self.j.up.size(), 3)
     self.assertEqual(self.m.down.size(), 3)
     self.assertEqual(deck.size(), (52 - 18))
コード例 #6
0
 def test_dealCardsDealsCorrectly(self):
     deck = Deck()
     game = Game('SomeGameName', self.m)
     game.addPlayer(self.j)  # This isn't really necessary.
     game.dealCards([self.m, self.j], deck)
     self.assertEqual(self.m.hand.size(), 3)
     self.assertEqual(self.m.up.size(), 3)
     self.assertEqual(self.m.down.size(), 3)
     self.assertEqual(self.j.hand.size(), 3)
     self.assertEqual(self.j.up.size(), 3)
     self.assertEqual(self.m.down.size(), 3)
     self.assertEqual(deck.size(), (52 - 18))