Browse Source

[MouseGameTest Class]: Test: "contentPaneForegroundPruefen" erstellt.

remotes/origin/MouseGame
fdai7382 2 years ago
parent
commit
65f5bad7ae
  1. 3
      JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java
  2. 11
      JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGameTest.java

3
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");

11
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());
}
}
Loading…
Cancel
Save