Browse Source

tictactoe: added getter for game board

tictactoe
Malte Schellhardt 3 years ago
committed by Lorenz Hohmann
parent
commit
d6b0153491
  1. 6
      src/main/java/de/tims/tictactoe/GameLogic.java
  2. 8
      src/test/java/de/tims/tictactoe/GameLogicTest.java

6
src/main/java/de/tims/tictactoe/GameLogic.java

@ -1,5 +1,11 @@
package de.tims.tictactoe;
public class GameLogic {
private int[][] board = new int[3][3];
public int[][] getBoard() {
return this.board;
}
}

8
src/test/java/de/tims/tictactoe/GameLogicTest.java

@ -26,4 +26,12 @@ class GameLogicTest {
assertEquals(expectedResult.getClass(), realResult.getClass());
}
@Test
void getBoardTest() {
int[][] expectedResult = new int[3][3];
int[][] realResult = game.getBoard();
assertArrayEquals(expectedResult, realResult);
}
}
Loading…
Cancel
Save