Beispiel #1
0
 @Test
 public void testMarkXInMiddleAndOInBottomRightCorner() {
   TicTacToeGUI board = new TicTacToeGUI();
   board.setMark(1, 1);
   board.setMark(2, 2);
   if (board.getMark(1, 1) == Mark.X_MARK) {
     if (board.getMark(2, 2) == Mark.O_MARK) {
       assertTrue(true);
     } else {
       assertEquals(0, 1);
     }
   } else {
     assertEquals(0, 2);
   }
 }
Beispiel #2
0
 @Test
 public void testInitialBoardIsEmpty() {
   TicTacToeGUI board = new TicTacToeGUI();
   for (int row = 0; row < 3; row++) {
     for (int col = 0; col < 3; col++) {
       assertEquals(Mark.EMPTY, board.getMark(row, col));
     }
   }
 }
Beispiel #3
0
 @Test
 public void testMarkOInBottomLeftCorner() {
   TicTacToeGUI board = new TicTacToeGUI();
   board.setMarkO(2, 0);
   assertEquals(Mark.O_MARK, board.getMark(2, 0));
 }
Beispiel #4
0
 @Test
 public void testMarkXInUpperRightCorner() {
   TicTacToeGUI board = new TicTacToeGUI();
   board.setMark(0, 2);
   assertEquals(Mark.X_MARK, board.getMark(0, 2));
 }