From 600ba3cb7488313f3b17723b8962f9a31796cad2 Mon Sep 17 00:00:00 2001 From: fdai7382 Date: Fri, 27 Jan 2023 23:34:10 +0100 Subject: [PATCH] [MouseGameTest Class]: Test: "resetYPruefen" erstellt. --- .../gruppenprojekt/JavaGamelauncher/MouseGame.java | 4 ++++ .../gruppenprojekt/JavaGamelauncher/MouseGameTest.java | 9 +++++++++ 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 565279a..aeacbb7 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 @@ -130,6 +130,10 @@ public class MouseGame extends JFrame { } + public int getResetY() { + return resetY; + } + 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 5e0c3d9..6c1d51a 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 @@ -47,4 +47,13 @@ public class MouseGameTest { assertTrue(mg.getResetX()==200); } + @Test + public void resetYPruefen() throws AWTException { + //Given + MouseGame mg = new MouseGame(); + + //Then + assertTrue(mg.getResetY()==170); + } + }