diff --git a/src/main/java/de/tims/tictactoe/GameLogic.java b/src/main/java/de/tims/tictactoe/GameLogic.java index 07e2998..a449fdb 100644 --- a/src/main/java/de/tims/tictactoe/GameLogic.java +++ b/src/main/java/de/tims/tictactoe/GameLogic.java @@ -2,7 +2,11 @@ package de.tims.tictactoe; public class GameLogic { - private int[][] board = new int[3][3]; + private int[][] board; + + public GameLogic(int size) { + this.board = new int[size][size]; + } public int[][] getBoard() { return this.board; diff --git a/src/test/java/de/tims/tictactoe/GameLogicTest.java b/src/test/java/de/tims/tictactoe/GameLogicTest.java index ac43308..d6d7176 100644 --- a/src/test/java/de/tims/tictactoe/GameLogicTest.java +++ b/src/test/java/de/tims/tictactoe/GameLogicTest.java @@ -8,7 +8,8 @@ import org.junit.jupiter.api.Test; class GameLogicTest { - private GameLogic game = new GameLogic(); + private int size = 3; + private GameLogic game = new GameLogic(size); @BeforeAll static void setUpBeforeClass() throws Exception { @@ -21,7 +22,7 @@ class GameLogicTest { @Test void createGameLogicTest() { GameLogic expectedResult = game; - GameLogic realResult = new GameLogic(); + GameLogic realResult = new GameLogic(size); assertEquals(expectedResult.getClass(), realResult.getClass()); }