@Test public void testIfGameIsWonByXDiagonalTopLeftToBottomRight() { TicTacToeGUI board = new TicTacToeGUI(); board.setMarkX(0, 0); board.setMarkX(1, 1); if (board.checkWinner() != Mark.EMPTY) { assertEquals(0, 1); } board.setMarkX(2, 2); assertEquals(Mark.X_MARK, board.checkWinner()); }
@Test public void testIfGameIsWonByXOnTopRowAcross() { TicTacToeGUI board = new TicTacToeGUI(); board.setMarkX(0, 0); board.setMarkX(0, 1); if (board.checkWinner() != Mark.EMPTY) { assertEquals(0, 1); } board.setMarkX(0, 2); assertEquals(Mark.X_MARK, board.checkWinner()); }