예제 #1
0
 @Test
 public void testIfGameIsWonByODiagonalTopRightToBottomLeft() {
   TicTacToeGUI board = new TicTacToeGUI();
   board.setMarkO(0, 2);
   board.setMarkO(1, 1);
   if (board.checkWinner() != Mark.EMPTY) {
     assertEquals(0, 1);
   }
   board.setMarkO(2, 0);
   assertEquals(Mark.O_MARK, board.checkWinner());
 }
예제 #2
0
 @Test
 public void testIfGameIsWonByOOnMiddleColDown() {
   TicTacToeGUI board = new TicTacToeGUI();
   board.setMarkO(0, 1);
   board.setMarkO(1, 1);
   if (board.checkWinner() != Mark.EMPTY) {
     assertEquals(0, 1);
   }
   board.setMarkO(2, 1);
   assertEquals(Mark.O_MARK, board.checkWinner());
 }
예제 #3
0
 @Test
 public void testMarkOInBottomLeftCorner() {
   TicTacToeGUI board = new TicTacToeGUI();
   board.setMarkO(2, 0);
   assertEquals(Mark.O_MARK, board.getMark(2, 0));
 }
예제 #4
0
 @Test
 public void testGettingMarkInBottomLeftAndReturningAsAString() {
   TicTacToeGUI board = new TicTacToeGUI();
   board.setMarkO(2, 0);
   assertEquals("O", board.getMarkInString(2, 0));
 }