private Player CheckCurrentStatus(Game ticTacToe) { Player winner = Player.None; for (int i = 0; i < ticTacToe.Dimensions; i++) { winner = TicTacToeHelper.CheckRow(ticTacToe, i); if (winner == Player.None) { winner = TicTacToeHelper.CheckColumn(ticTacToe, i); if (winner != Player.None) { return(winner); } } else { break; } } if (winner == Player.None) { winner = TicTacToeHelper.CheckDiagonal(ticTacToe); } return(winner); }
public void CheckRowTest() { CreateInstance(Constants.FILE_INPUT_PATH_CHECKROW); var expectedWinner = Player.X; var actualWinner = TicTacToeHelper.CheckRow(_game, 0); Assert.AreEqual(expectedWinner, actualWinner); }