|
|
@ -60,6 +60,14 @@ class GameLogicTest { |
|
|
|
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() { |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("1x1 board with too few fields", 1, 9), |
|
|
@ -83,4 +91,13 @@ class GameLogicTest { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
private static Stream<Arguments> testCasesForCheckEmptyField() { |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("check an empty field", 0, 0, true, new char[][] |
|
|
|
{{'-', '-', '-'}, |
|
|
|
{'-', '-', '-'}, |
|
|
|
{'-', '-', '-'}}) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |