|
@ -236,4 +236,23 @@ class LogicTest { |
|
|
assertEquals(logic.getClearedLeft(), true); |
|
|
assertEquals(logic.getClearedLeft(), true); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void testSinkShip() { |
|
|
|
|
|
Logic logic = new Logic(); |
|
|
|
|
|
|
|
|
|
|
|
logic.setFoundShip(true); |
|
|
|
|
|
logic.setClearedAbove(true); |
|
|
|
|
|
logic.setClearedBelow(true); |
|
|
|
|
|
logic.setClearedRight(true); |
|
|
|
|
|
logic.setClearedLeft(true); |
|
|
|
|
|
|
|
|
|
|
|
logic.sinkShip(); |
|
|
|
|
|
|
|
|
|
|
|
assertEquals(logic.getFoundShip(), false); |
|
|
|
|
|
assertEquals(logic.getClearedAbove(), false); |
|
|
|
|
|
assertEquals(logic.getClearedBelow(), false); |
|
|
|
|
|
assertEquals(logic.getClearedLeft(), false); |
|
|
|
|
|
assertEquals(logic.getClearedRight(), false); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |