From 34bee5e69cf9cd6ac7884585172646b6fab88a05 Mon Sep 17 00:00:00 2001 From: fdai7382 Date: Mon, 30 Jan 2023 11:33:59 +0100 Subject: [PATCH] [MouseGameTest Class]: Test: "boundsHoehePruefen" erstellt. --- .../gruppenprojekt/JavaGamelauncher/MouseGame.java | 5 +++++ .../gruppenprojekt/JavaGamelauncher/MouseGameTest.java | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java index 7d94087..70fc42b 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java @@ -140,6 +140,11 @@ public class MouseGame extends JFrame { return breite; } + + public int getHoehe() { + return hoehe; + } + private void reset(JPanel panel) { panel.addMouseListener(new MouseAdapter() { diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGameTest.java index 6c1d51a..5a36659 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGameTest.java @@ -56,4 +56,12 @@ public class MouseGameTest { assertTrue(mg.getResetY()==170); } + @Test + public void boundsHoehePruefen() throws AWTException { + //Given + MouseGame mg = new MouseGame(); + + //Then + assertTrue(mg.getHoehe()==650); + } }