From f006baa48fbda4dfb79c0c60d24e922e69950c84 Mon Sep 17 00:00:00 2001 From: fdai7382 Date: Fri, 27 Jan 2023 23:23:55 +0100 Subject: [PATCH] [MouseGameTest Class]: Test: "resetXPruefen" erstellt. --- .../gruppenprojekt/JavaGamelauncher/MouseGame.java | 7 ++++++- .../gruppenprojekt/JavaGamelauncher/MouseGameTest.java | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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 177b942..83ad7f3 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 @@ -121,10 +121,15 @@ public class MouseGame extends JFrame { - }//end standardkonstruktor + public int getResetX() { + return resetX; + } + + + private void reset(JPanel panel) { panel.addMouseListener(new MouseAdapter() { @Override 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 759c21d..5e0c3d9 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 @@ -38,4 +38,13 @@ public class MouseGameTest { assertTrue(mg.getTitle()=="Mouse Game"); } + @Test + public void resetXPruefen() throws AWTException { + //Given + MouseGame mg = new MouseGame(); + + //Then + assertTrue(mg.getResetX()==200); + } + }