|
@ -27,7 +27,7 @@ class GameLogicTest { |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void createGameLogicTest() { |
|
|
void createGameLogicTest() { |
|
|
GameLogic expectedResult = game; |
|
|
|
|
|
|
|
|
GameLogic expectedResult = this.game; |
|
|
GameLogic realResult = new GameLogic(size); |
|
|
GameLogic realResult = new GameLogic(size); |
|
|
|
|
|
|
|
|
assertEquals(expectedResult.getClass(), realResult.getClass()); |
|
|
assertEquals(expectedResult.getClass(), realResult.getClass()); |
|
@ -36,12 +36,12 @@ class GameLogicTest { |
|
|
@Test |
|
|
@Test |
|
|
void getBoardTest() { |
|
|
void getBoardTest() { |
|
|
int[][] expectedResult = new int[3][3]; |
|
|
int[][] expectedResult = new int[3][3]; |
|
|
int[][] realResult = game.getBoard(); |
|
|
|
|
|
|
|
|
int[][] realResult = this.game.getBoard(); |
|
|
|
|
|
|
|
|
assertArrayEquals(expectedResult, realResult); |
|
|
assertArrayEquals(expectedResult, realResult); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ParameterizedTest(name = "[{index}] {0} -> {1}") |
|
|
|
|
|
|
|
|
@ParameterizedTest(name = "[{index}] {0} -> {2} fields") |
|
|
@MethodSource("testCasesForCountPlayfields") |
|
|
@MethodSource("testCasesForCountPlayfields") |
|
|
void fieldCountTest(String testName, int size, int expectedResult) { |
|
|
void fieldCountTest(String testName, int size, int expectedResult) { |
|
|
GameLogic game = new GameLogic(size); |
|
|
GameLogic game = new GameLogic(size); |
|
|