Browse Source

4gewinnt: added getter method for board size

4gewinnt
Malte Schellhardt 3 years ago
committed by Lorenz Hohmann
parent
commit
2530467f14
  1. 4
      src/main/java/de/tims/viergewinnt/ai/Logic.java
  2. 16
      src/test/java/de/tims/viergewinnt/ai/LogicTest.java

4
src/main/java/de/tims/viergewinnt/ai/Logic.java

@ -30,6 +30,10 @@ public class Logic {
return board[row][column]; return board[row][column];
} }
public int getBoardSize() {
return 6;
}
public void setCurrentPlayer(int player) { public void setCurrentPlayer(int player) {
currentPlayer = player; currentPlayer = player;
} }

16
src/test/java/de/tims/viergewinnt/ai/LogicTest.java

@ -162,11 +162,19 @@ class LogicTest {
@Test @Test
void createGameLogicTest() { void createGameLogicTest() {
int size = 6;
Logic expectedResult = testObj;
Logic realResult = new Logic(size);
int size = 6;
Logic expectedResult = testObj;
Logic realResult = new Logic(size);
assertEquals(expectedResult.getClass(), realResult.getClass());
assertEquals(expectedResult.getClass(), realResult.getClass());
}
@Test
void getBoardSize() {
int expectedResult = 6;
int realResult = testObj.getBoardSize();
assertEquals(expectedResult, realResult);
} }
private static Stream<Arguments> playfieldResults() { private static Stream<Arguments> playfieldResults() {

Loading…
Cancel
Save