|
@ -152,4 +152,12 @@ class MatchfieldShipTest { |
|
|
Arguments.of("one of the coordinates is hit, others on free fields", new Coordinate(5, 5), 1, 3, |
|
|
Arguments.of("one of the coordinates is hit, others on free fields", new Coordinate(5, 5), 1, 3, |
|
|
new Coordinate[] { new Coordinate(5, 7), new Coordinate(5, 8), new Coordinate(5, 9) }, false)); |
|
|
new Coordinate[] { new Coordinate(5, 7), new Coordinate(5, 8), new Coordinate(5, 9) }, false)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void testIfRandomShipPositioningIsWorking() { |
|
|
|
|
|
for (int shipLength = 2; shipLength <= 5; shipLength++) { |
|
|
|
|
|
boolean calculatedResult = matchfield.setShipOnRandomPosition(shipLength); |
|
|
|
|
|
assertTrue(calculatedResult); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |