|
@ -32,4 +32,18 @@ class MatchfieldCreationTest { |
|
|
static Stream<Arguments> testMatchfieldSize() { |
|
|
static Stream<Arguments> testMatchfieldSize() { |
|
|
return Stream.of(Arguments.of("field size 10x10", 10, 100), Arguments.of("field size 15x15", 15, 225)); |
|
|
return Stream.of(Arguments.of("field size 10x10", 10, 100), Arguments.of("field size 15x15", 15, 225)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ParameterizedTest(name = "matchfield change field is correct") |
|
|
|
|
|
@MethodSource("testMatchfieldGetFieldState") |
|
|
|
|
|
void testMatchfieldGetCorrectState(String testName, int x, int y, int expectedResult) { |
|
|
|
|
|
MatchfieldCreation matchfield = new MatchfieldCreation(10); |
|
|
|
|
|
matchfield.createMatchfield(); |
|
|
|
|
|
|
|
|
|
|
|
int calcResult = matchfield.getState(x, y); |
|
|
|
|
|
assertThat(calcResult).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static Stream<Arguments> testMatchfieldGetFieldState() { |
|
|
|
|
|
return Stream.of(Arguments.of("field x:0 y:0 has initial state", 0, 0, 1)); |
|
|
|
|
|
} |
|
|
} |
|
|
} |