Exemple #1
0
 def test_add_player_to_session_with_free_seat(self):
     session = GameSession(['player1','player2','player3'])
     self.assertEqual(3, len(session.get_seat_allocations()))
     new_allocation = session.add_player_to_session('player4')
     self.assertEqual(4,len(new_allocation))
Exemple #2
0
 def test_add_player_to_session_without_seat(self):
     session = GameSession(['player1','player2','player3','player4'])
     with self.assertRaises(GameEngineException) as context:
         session.add_player_to_session('player5')
     self.assertTrue('No free position available for allocation' in str(context.exception))