|
|
@ -12,23 +12,24 @@ import org.junit.jupiter.params.provider.MethodSource; |
|
|
|
|
|
|
|
class MatchfieldCreationTest { |
|
|
|
|
|
|
|
MatchfieldCreation matchfield = new MatchfieldCreation(); |
|
|
|
|
|
|
|
@Test |
|
|
|
void testMatchfieldCreateNotEmpty() { |
|
|
|
int[][] calcResult = matchfield.createMatchfield(0); |
|
|
|
MatchfieldCreation matchfield = new MatchfieldCreation(0); |
|
|
|
int[][] calcResult = matchfield.createMatchfield(); |
|
|
|
assertNotNull(calcResult); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest(name = "matchfield creation has correct size") |
|
|
|
@MethodSource("testMatchfieldSize") |
|
|
|
void testMatchfieldCreationHasCorrectSize(String testName, int size, int expectedResult) { |
|
|
|
matchfield.createMatchfield(size); |
|
|
|
MatchfieldCreation matchfield = new MatchfieldCreation(size); |
|
|
|
matchfield.createMatchfield(); |
|
|
|
|
|
|
|
int calcResult = matchfield.getSize(); |
|
|
|
assertThat(calcResult).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> testMatchfieldSize() { |
|
|
|
return Stream.of(Arguments.of("field size 10x10", 10, 10)); |
|
|
|
return Stream.of(Arguments.of("field size 10x10", 10, 100), Arguments.of("field size 15x15", 15, 225)); |
|
|
|
} |
|
|
|
} |