示例#1
0
    def test_draw(self):
        player1 = StrategyPlayer('player1', 'X', [1, 3, 6, 8])
        player2 = StrategyPlayer('player2', 'O', [2, 4, 5, 7, 9])

        game = Game(player1, player2)
        game.current_player = player2
        result = game.enter_game_loop()
        self.assertEqual(result, None)
示例#2
0
    def test_winner(self):
        losing_player = StrategyPlayer('loser', 'X', [1, 4, 7])
        winning_player = StrategyPlayer('winner', 'O', [2, 5, 8])

        game = Game(losing_player, winning_player)
        game.current_player = winning_player
        winner = game.enter_game_loop()
        self.assertEqual(winner, winning_player)