|
|
@ -63,4 +63,17 @@ class MatchfieldCreationTest { |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("field x:0 y:0 has state SHIP after setState()", 0, 0, Coordinate.SHIP, Coordinate.SHIP)); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest(name = "Get the Coordinate above") |
|
|
|
@MethodSource("getCoordinateAbove") |
|
|
|
void testGetAbove(String testName, Matchfield matchfield, Coordinate center, Coordinate expectedResult) { |
|
|
|
|
|
|
|
Coordinate result = matchfield.getAbove(center); |
|
|
|
assertThat(result).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> getCoordinateAbove() { |
|
|
|
Matchfield matchfield = new Matchfield(10); |
|
|
|
return Stream.of(Arguments.of("above from (5/5)", matchfield, new Coordinate(5, 5), matchfield.getField(6, 5))); |
|
|
|
} |
|
|
|
} |