|
|
@ -86,4 +86,21 @@ class AIHardTest { |
|
|
|
1, 'o', 2)); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("testCasesForCountCharsInCol") |
|
|
|
void countCharsInColTest(String testName, char[][] board, int rowNum, char charToCount, int expectedResult) { |
|
|
|
doReturn(board).when(gl).getBoard(); |
|
|
|
|
|
|
|
AIHard ai = new AIHard(gl); |
|
|
|
int realResult = ai.countCharsInCol(rowNum, charToCount); |
|
|
|
|
|
|
|
assertThat(realResult).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
private static Stream<Arguments> testCasesForCountCharsInCol() { |
|
|
|
return Stream.of(Arguments.of("EmptyFieldReturns0", |
|
|
|
new char[][] { {'-', '-', '-'}, {'-', '-', '-'}, {'-', '-', '-'} }, |
|
|
|
0, 'o', 0)); |
|
|
|
} |
|
|
|
|
|
|
|
} |