From 9e96ed7d9255dacb89f8a8dafa9023dc5ed19064 Mon Sep 17 00:00:00 2001 From: fdai4581 Date: Wed, 8 Feb 2023 21:24:05 +0100 Subject: [PATCH] update UnitTest Ship --- src/test_/java/ShipTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test_/java/ShipTest.java b/src/test_/java/ShipTest.java index 4924e8b..83efd75 100644 --- a/src/test_/java/ShipTest.java +++ b/src/test_/java/ShipTest.java @@ -1,8 +1,7 @@ import BattleShip.Ship; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.*; class ShipTest { @Test @@ -19,5 +18,9 @@ class ShipTest { ship.counter(); assertFalse(ship.isKilled()); assertEquals(2, ship.numOfHits); + + ship.counter(); + assertTrue(ship.isKilled()); + assertEquals(3, ship.numOfHits); } } \ No newline at end of file