Write an application and unit tests to handle the rules for a game of tic tac toe.
Rules:
-
Player 'X' always goes first
-
Players alternate placing Xs and Os on the board until either:
- One player has three in a row, horizontally, vertically or diagonally
- All nine squares are filled.
-
If a player is able to draw three Xs or three Os in a row, then that player wins
-
If all nine squares are filled and neither player has three in a row, the game is a draw.