|
@ -66,7 +66,7 @@ class MatchfieldCreationTest { |
|
|
|
|
|
|
|
|
@ParameterizedTest(name = "Get the Coordinate right") |
|
|
@ParameterizedTest(name = "Get the Coordinate right") |
|
|
@MethodSource("getCoordinateRight") |
|
|
@MethodSource("getCoordinateRight") |
|
|
void testGetAbove(String testName, Matchfield matchfield, Coordinate center, Coordinate expectedResult) { |
|
|
|
|
|
|
|
|
void testGetRight(String testName, Matchfield matchfield, Coordinate center, Coordinate expectedResult) { |
|
|
|
|
|
|
|
|
Coordinate result = matchfield.getRight(center); |
|
|
Coordinate result = matchfield.getRight(center); |
|
|
assertThat(result).describedAs(testName).isEqualTo(expectedResult); |
|
|
assertThat(result).describedAs(testName).isEqualTo(expectedResult); |
|
@ -82,7 +82,7 @@ class MatchfieldCreationTest { |
|
|
|
|
|
|
|
|
@ParameterizedTest(name = "Get the Coordinate left") |
|
|
@ParameterizedTest(name = "Get the Coordinate left") |
|
|
@MethodSource("getCoordinateLeft") |
|
|
@MethodSource("getCoordinateLeft") |
|
|
void testGetBelow(String testName, Matchfield matchfield, Coordinate center, Coordinate expectedResult) { |
|
|
|
|
|
|
|
|
void testGetLeft(String testName, Matchfield matchfield, Coordinate center, Coordinate expectedResult) { |
|
|
|
|
|
|
|
|
Coordinate result = matchfield.getLeft(center); |
|
|
Coordinate result = matchfield.getLeft(center); |
|
|
assertThat(result).describedAs(testName).isEqualTo(expectedResult); |
|
|
assertThat(result).describedAs(testName).isEqualTo(expectedResult); |
|
@ -95,4 +95,18 @@ class MatchfieldCreationTest { |
|
|
matchfield.getField(4, 5)), |
|
|
matchfield.getField(4, 5)), |
|
|
Arguments.of("left from (0/5) - should be null", matchfield, new Coordinate(0, 5), null)); |
|
|
Arguments.of("left from (0/5) - should be null", matchfield, new Coordinate(0, 5), null)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@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) - should be (5,6)", matchfield, new Coordinate(5, 5), |
|
|
|
|
|
matchfield.getField(5, 6))); |
|
|
|
|
|
} |
|
|
} |
|
|
} |