|
@ -60,6 +60,14 @@ class GameLogicTest { |
|
|
assertArrayEquals(expectedResult, realResult); |
|
|
assertArrayEquals(expectedResult, realResult); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ParameterizedTest(name = "[{index}] {0}") |
|
|
|
|
|
@MethodSource("testCasesForCheckEmptyField") |
|
|
|
|
|
void fieldIsEmptyTest(String testName, int columnToCheck, int rowToCheck, boolean expectedResult, char[][] board) { |
|
|
|
|
|
boolean realResult = this.game.fieldIsEmpty(columnToCheck, rowToCheck); |
|
|
|
|
|
|
|
|
|
|
|
assertEquals(expectedResult, realResult); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private static Stream<Arguments> testCasesForCountPlayfields() { |
|
|
private static Stream<Arguments> testCasesForCountPlayfields() { |
|
|
return Stream.of( |
|
|
return Stream.of( |
|
|
Arguments.of("1x1 board with too few fields", 1, 9), |
|
|
Arguments.of("1x1 board with too few fields", 1, 9), |
|
@ -82,5 +90,14 @@ class GameLogicTest { |
|
|
{'-', '-', '-'}}) |
|
|
{'-', '-', '-'}}) |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static Stream<Arguments> testCasesForCheckEmptyField() { |
|
|
|
|
|
return Stream.of( |
|
|
|
|
|
Arguments.of("check an empty field", 0, 0, true, new char[][] |
|
|
|
|
|
{{'-', '-', '-'}, |
|
|
|
|
|
{'-', '-', '-'}, |
|
|
|
|
|
{'-', '-', '-'}}) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |