Browse Source

[MouseGameTest Class]: Test "contentPaneBackgroundPruefen" erstellt.

remotes/origin/MouseGame
fdai7382 2 years ago
parent
commit
4ecbe16b6f
  1. 10
      JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java
  2. 12
      JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGameTest.java

10
JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java

@ -132,6 +132,16 @@ public class MouseGame extends JFrame {
}//end standardkonstruktor }//end standardkonstruktor
public JPanel getContentPane() {
return contentPane;
}
public Color getFarbeBeige() {
return farbeBeige;
}
public int getResetX() { public int getResetX() {
return resetX; return resetX;
} }

12
JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGameTest.java

@ -3,6 +3,7 @@ package de.hs_fulda.gruppenprojekt.JavaGamelauncher;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import java.awt.AWTException; import java.awt.AWTException;
import java.awt.Color;
import java.awt.MouseInfo; import java.awt.MouseInfo;
import java.awt.Point; import java.awt.Point;
import java.awt.PointerInfo; import java.awt.PointerInfo;
@ -91,4 +92,15 @@ public class MouseGameTest {
//Then //Then
assertTrue(mg.getHoehePanel()==569); assertTrue(mg.getHoehePanel()==569);
} }
@Test
public void contentPaneBackgroundPruefen() throws AWTException {
//Given
MouseGame mg = new MouseGame();
Color farbeBeige = new Color (128,128,128);
//Then
assertEquals(farbeBeige, mg.getContentPane().getBackground());
}
} }
Loading…
Cancel
Save