From 8c2eaa77ba752e786cf76419c3dac5cf898d2589 Mon Sep 17 00:00:00 2001 From: fdai4581 Date: Wed, 8 Feb 2023 21:26:43 +0100 Subject: [PATCH 1/5] add UnitTest BShipTest --- src/test_/java/BShipTest.java | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/test_/java/BShipTest.java diff --git a/src/test_/java/BShipTest.java b/src/test_/java/BShipTest.java new file mode 100644 index 0000000..ed84387 --- /dev/null +++ b/src/test_/java/BShipTest.java @@ -0,0 +1,3 @@ +class BShipTest { + +} \ No newline at end of file From c935119171601f1b9286060b4d16b8245eb66b9e Mon Sep 17 00:00:00 2001 From: fdai4581 Date: Wed, 8 Feb 2023 21:28:30 +0100 Subject: [PATCH 2/5] update UnitTest BShipTest --- src/test_/java/BShipTest.java | 8 +++++++- target/test-classes/AIGridGUITest.class | Bin 1271 -> 1606 bytes 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test_/java/BShipTest.java b/src/test_/java/BShipTest.java index ed84387..996c69e 100644 --- a/src/test_/java/BShipTest.java +++ b/src/test_/java/BShipTest.java @@ -1,3 +1,9 @@ -class BShipTest { +import BattleShip.BShip; +import org.junit.jupiter.api.Test; +class BShipTest { + @Test + public void testStartGame() { + BShip bShip = new BShip(); + } } \ No newline at end of file diff --git a/target/test-classes/AIGridGUITest.class b/target/test-classes/AIGridGUITest.class index 073325ff600470d7b2f75da47b7e4737bf6dd72c..50abe400f8ff72bc7d3ff3debf8bbc84effcb23d 100644 GIT binary patch delta 807 zcmb7?Uu)A)7{;HIbgd0p%{uL5R*ho2w%J<$R$ZKS)2h>gVnNU=V|GYWLpze=bi3(? z=qDM<922}$@C$h-z9$Vshc}XN&LQW0e$Vs1Zn^BfNS9DZSW5@=6B=~@b5yQz&-`R2+?}Q&TR>RQQ?$DjBVG&Ci)O9p) ziDC91H4Lf9-{A~urMi9$R~YPP=Ue61-*&Bxb z&Tt@{ps~e6;k!;ym-(*gxQ-@)1^*xz@{?$RGw>Q+5&8pT^7y-Q zp)KokP-&eeT@D70$C^USm`OBp<}Iv}c8x02wBL(K_Y+cGwU|AArJim}zZyA%dYJfW z#56ENnrV94L{TuC@YEx`2MO;$t#)Oyd`v1*2WRMfmWFdKPG`o6PbCgI-A^3yq?b9B zBix6F++yzh%2aV5gk`LM(Jq{F}GzfP439{&bH CntdVw delta 469 zcmb7=%}&BV6ot>776?r#v>Ix(f*7hm{Y79`cio%t7Os2)mOenAgt##-Si0Z^d=z)Y zGs6TUJ2RO(H#7Hq_ssqDzw6$5^RWVuW4iQa^7f==BK`8!NwbvK9u#8@F6y{o=0g|{ zafty>!4Oqe^vf^jywLRl9L5H90a|DpP1`U+tMN!1A*1$+l~tbChIC^|k8UPu`Rtw) zy5ESMf#aRFMQTV*gX@+Qg#*iT_IP)ew|0kf?JP2+gg-cC-a(A6ad&1MAK4B*-?tqi z>a|a`$GzWilc1MZl6SP1#4DubOC?@t)Bi<|w@4~8ZarYJNTzy1`r&u_V!i&I-vg@@ GWby-z+#+}Y From b8daca88a7a72a5d66e17498aab442dfe3f7760d Mon Sep 17 00:00:00 2001 From: fdai4581 Date: Wed, 8 Feb 2023 21:29:21 +0100 Subject: [PATCH 3/5] update UnitTest BShipTest --- src/test_/java/BShipTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test_/java/BShipTest.java b/src/test_/java/BShipTest.java index 996c69e..1c5aa32 100644 --- a/src/test_/java/BShipTest.java +++ b/src/test_/java/BShipTest.java @@ -5,5 +5,7 @@ class BShipTest { @Test public void testStartGame() { BShip bShip = new BShip(); + + bShip.autoPlacement = true; } } \ No newline at end of file From 0f077b0c14a8b8b1ed8e4cb16febbe863a855e29 Mon Sep 17 00:00:00 2001 From: fdai4581 Date: Wed, 8 Feb 2023 21:29:55 +0100 Subject: [PATCH 4/5] update UnitTest BShipTest --- src/test_/java/BShipTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test_/java/BShipTest.java b/src/test_/java/BShipTest.java index 1c5aa32..b5d7487 100644 --- a/src/test_/java/BShipTest.java +++ b/src/test_/java/BShipTest.java @@ -7,5 +7,7 @@ class BShipTest { BShip bShip = new BShip(); bShip.autoPlacement = true; + + bShip.startGame(); } } \ No newline at end of file From cbc1c09d4b4bbf263c2ff81eaa5b631f0263189c Mon Sep 17 00:00:00 2001 From: fdai4581 Date: Wed, 8 Feb 2023 21:30:31 +0100 Subject: [PATCH 5/5] update UnitTest BShipTest --- src/test_/java/BShipTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test_/java/BShipTest.java b/src/test_/java/BShipTest.java index b5d7487..9b5813a 100644 --- a/src/test_/java/BShipTest.java +++ b/src/test_/java/BShipTest.java @@ -1,6 +1,8 @@ import BattleShip.BShip; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertNotNull; + class BShipTest { @Test public void testStartGame() { @@ -9,5 +11,8 @@ class BShipTest { bShip.autoPlacement = true; bShip.startGame(); + + assertNotNull(bShip.grid1); + assertNotNull(bShip.grid2); } } \ No newline at end of file