def test_diagonal_winner(): text = """\ OX. XOO XXO """ board = TicTacToeState(text) expected_winner = board.O_PLAYER winner = board.get_winner() assert winner == expected_winner
def test_horizontal_winner(): text = """\ XXX .OO ... """ board = TicTacToeState(text) expected_winner = board.X_PLAYER winner = board.get_winner() assert winner == expected_winner
def test_vertical_winner(): text = """\ XXO .OO XXO """ board = TicTacToeState(text) expected_winner = board.O_PLAYER winner = board.get_winner() assert winner == expected_winner
def test_no_winner(): text = """\ XX. .OO ... """ board = TicTacToeState(text) expected_winner = board.NO_PLAYER winner = board.get_winner() assert winner == expected_winner