|
@ -42,6 +42,17 @@ class GameLogicTest { |
|
|
assertArrayEquals(expectedResult, realResult); |
|
|
assertArrayEquals(expectedResult, realResult); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void createGameLogicWithGivenBoardTest() { |
|
|
|
|
|
char[][] expectedResult = new char[][]{{'x', '-', '-'}, |
|
|
|
|
|
{'-', 'o', '-'}, |
|
|
|
|
|
{'x', '-', '-'}}; |
|
|
|
|
|
char[][] givenBoard = expectedResult; |
|
|
|
|
|
char[][] realResult = new GameLogic(givenBoard).getBoard(); |
|
|
|
|
|
|
|
|
|
|
|
assertArrayEquals(expectedResult, realResult); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ParameterizedTest(name = "[{index}] {0} -> {2} fields") |
|
|
@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) { |
|
|