Browse Source

update UnitTest Ship

main
fdai4581 2 years ago
parent
commit
9e96ed7d92
  1. 7
      src/test_/java/ShipTest.java

7
src/test_/java/ShipTest.java

@ -1,8 +1,7 @@
import BattleShip.Ship; import BattleShip.Ship;
import org.junit.jupiter.api.Test; 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 { class ShipTest {
@Test @Test
@ -19,5 +18,9 @@ class ShipTest {
ship.counter(); ship.counter();
assertFalse(ship.isKilled()); assertFalse(ship.isKilled());
assertEquals(2, ship.numOfHits); assertEquals(2, ship.numOfHits);
ship.counter();
assertTrue(ship.isKilled());
assertEquals(3, ship.numOfHits);
} }
} }
Loading…
Cancel
Save