|
@ -79,4 +79,18 @@ class MatchfieldCreationTest { |
|
|
matchfield.getField(6, 5)), |
|
|
matchfield.getField(6, 5)), |
|
|
Arguments.of("above from (0/5) - should be null", matchfield, new Coordinate(0, 5), null)); |
|
|
Arguments.of("above from (0/5) - should be null", matchfield, new Coordinate(0, 5), null)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ParameterizedTest(name = "Get the Coordinate below") |
|
|
|
|
|
@MethodSource("getCoordinateBelow") |
|
|
|
|
|
void testGetBelow(String testName, Matchfield matchfield, Coordinate center, Coordinate expectedResult) { |
|
|
|
|
|
|
|
|
|
|
|
Coordinate result = matchfield.getBelow(center); |
|
|
|
|
|
assertThat(result).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static Stream<Arguments> getCoordinateBelow() { |
|
|
|
|
|
Matchfield matchfield = new Matchfield(10); |
|
|
|
|
|
return Stream.of(Arguments.of("bewlow from (5/5) - should be (4,5)", matchfield, new Coordinate(5, 5), |
|
|
|
|
|
matchfield.getField(4, 5))); |
|
|
|
|
|
} |
|
|
} |
|
|
} |