From 65f5bad7ae8793fae1277b589328a6027a8ebb91 Mon Sep 17 00:00:00 2001 From: fdai7382 Date: Tue, 31 Jan 2023 11:02:36 +0100 Subject: [PATCH] [MouseGameTest Class]: Test: "contentPaneForegroundPruefen" erstellt. --- .../gruppenprojekt/JavaGamelauncher/MouseGame.java | 3 ++- .../JavaGamelauncher/MouseGameTest.java | 11 +++++++++++ 2 files changed, 13 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 9db8538..277fecc 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 @@ -22,6 +22,7 @@ public class MouseGame extends JFrame { public Robot robot = new Robot(); public Color farbeBeige = new Color(128, 128, 128); + public Color farbeSchwarz = new Color(0, 0, 0); int resetX = 200; int resetY = 170; @@ -64,7 +65,7 @@ public class MouseGame extends JFrame { setForeground(Color.GRAY); setBackground(Color.DARK_GRAY); - contentPane.setForeground(new Color(0, 0, 0)); + contentPane.setForeground(farbeSchwarz); contentPane.setBackground(farbeBeige); JLabel labelStart = new JLabel("Start"); 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 3498c19..7befbb2 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 @@ -103,4 +103,15 @@ public class MouseGameTest { assertEquals(farbeBeige, mg.getContentPane().getBackground()); } + + @Test + public void contentPaneForegroundPruefen() throws AWTException { + //Given + MouseGame mg = new MouseGame(); + Color farbeSchwarz = new Color (0,0,0); + + //Then + assertEquals(farbeSchwarz, mg.getContentPane().getForeground()); + + } }