|
|
@ -130,4 +130,14 @@ class MatchfieldShipTest { |
|
|
|
boolean calulatedResult = matchfield.areAllShipsHit(); |
|
|
|
assertFalse(calulatedResult); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void testMatchfieldIsFreePositionWithNonFreeField() { |
|
|
|
Matchfield matchfield = new Matchfield(10); |
|
|
|
matchfield.createMatchfield(); |
|
|
|
matchfield.setState(new Coordinate(0, 0), Coordinate.SHIP); |
|
|
|
|
|
|
|
boolean calculatedResult = matchfield.isFreePosition(new Coordinate(0, 0), 2, 1); |
|
|
|
assertFalse(calculatedResult); |
|
|
|
} |
|
|
|
} |