|
|
@ -68,12 +68,10 @@ class LogicTest { |
|
|
|
assertEquals(expectedResult, realResult); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void calcScoreTest() { |
|
|
|
int[][] playfield = new int[6][6]; |
|
|
|
int player = 1; |
|
|
|
int expectedResult = 0; |
|
|
|
|
|
|
|
@ParameterizedTest(name = "[{index}] {0} Win for Player {2} {1}") |
|
|
|
@MethodSource("playfieldForScore") |
|
|
|
void calcScoreTest(String testName, int[][] playfield, int player, int expectedResult) { |
|
|
|
|
|
|
|
int realResult = testObj.calcScore(playfield, player); |
|
|
|
|
|
|
|
assertEquals(expectedResult, realResult); |
|
|
@ -119,5 +117,11 @@ class LogicTest { |
|
|
|
Arguments.of("4 diagonal left player1", playfield5, 1, true) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
private static Stream<Arguments> playfieldForScore() { |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("emptyField", new int[6][6], 1, 0) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |