From 64bbcd9d768eb891f6beb1001ff422a5e9b54e85 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 12:02:01 +0100 Subject: [PATCH] =?UTF-8?q?[SnakeGameTest=20Class]:=20einf=C3=BCgen=20von?= =?UTF-8?q?=20@Test.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/GamelauncherMain.java | 4 ++-- .../JavaGamelauncher/SnakeGameTest.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java index f5aaf5c..c573970 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java @@ -109,8 +109,8 @@ public class GamelauncherMain extends JFrame {//class public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub - //SnakeGame frameSnake = new SnakeGame(); - //frameSnake.setVisible(true); + SnakeGame frameSnake = new SnakeGame(); + frameSnake.setVisible(true); } }); diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 8663f7f..d2a25e7 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -6,88 +6,106 @@ import org.junit.Test; public class SnakeGameTest { SnakeGame snek = new SnakeGame(); + @Test public void test() { assertTrue(true); } + @Test public void hoeheTest() { assertTrue(snek.hoehe == 600); } + @Test public void breiteTest() { assertTrue(snek.breite == 1200); } + @Test public void titelTest() { assertTrue(snek.titel == "Snake"); } + @Test public void hoehePanelTest() { int hoehe = 100; assertTrue(snek.getHoeheP1() == hoehe ); } + @Test public void breitePanelTest() { int breite = 100; assertTrue(snek.getBreiteP1() == breite ); } + @Test public void hoehePane2Test() { int hoehe = 100; assertTrue(snek.getHoeheP2() == hoehe ); } + @Test public void breitePane2Test() { int breite = 100; assertTrue(snek.getBreiteP2() == breite ); } + @Test public void hoehePane3Test() { int hoehe = 100; assertTrue(snek.getHoeheP3() == hoehe ); } + @Test public void breitePane3Test() { int breite = 100; assertTrue(snek.getBreiteP3() == breite ); } + @Test public void hoehePane4Test() { int hoehe = 100; assertTrue(snek.getHoeheP4() == hoehe ); } + @Test public void breitePane4Test() { int breite = 100; assertTrue(snek.getBreiteP4() == breite ); } + @Test public void xCords1Test() { int Cords = 300; assertTrue(snek.getxCords1() == Cords ); } + @Test public void xCords2Test() { int Cords = 400; assertTrue(snek.getxCords2() == Cords ); } + @Test public void xCords3Test() { int Cords = 500; assertTrue(snek.getxCords3() == Cords ); } + @Test public void xCords4Test() { int Cords = 600; assertTrue(snek.getxCords4() == Cords ); } + @Test public void xCords5Test() { int Cords = 700; assertTrue(snek.getxCords5() == Cords ); } + @Test public void xCords6Test() { int Cords = 800; assertTrue(snek.getxCords6() == Cords );