Example #1
0
 def test_start_game_action_is_not_legal_for_less_then_three_players(self):
     for i in range(0, 3):
         game = Game()
         for n in range(0, i):
             game.create_player('Player %d' % n)
         with self.assertRaises(IllegalActionException):
             self.action.assert_legal(game)
Example #2
0
 def test_existing_player_is_enforced(self):
     game = Game()
     pa = PlayerAction('red')
     with self.assertRaises(IllegalActionException):
         pa.assert_legal(game)
     game.create_player('redPlayer', 'red')
     pa.assert_legal(game)
Example #3
0
 def setUp(self):
     self.game = Game()
     self.game.create_player('playerOne', 'red')
     self.game.create_player('playerTwo')
     self.game.create_player('playerThree')
     self.action = StartGameAction('red')
Example #4
0
 def setUp(self):
     self.game = Game()
     self.game.create_player('bluePlayer', 'blue')
     self.action = PlayerAction('blue')