Browse Source

created test for setting new highscore

master
Ozan-Can Ekinci 2 years ago
parent
commit
c908aaa471
  1. 10
      src/test/java/Gui/GameGuiTest.java

10
src/test/java/Gui/GameGuiTest.java

@ -20,6 +20,7 @@ class GameGuiTest {
void setUp(){ void setUp(){
Gui.StartMainMenu(); Gui.StartMainMenu();
gameGui.createGui(); gameGui.createGui();
gameGui.createLosingPanel();
} }
@Test @Test
@ -31,4 +32,13 @@ class GameGuiTest {
assertEquals(new Insets(10, 10, 10, 10), gameGui.gbc.insets); assertEquals(new Insets(10, 10, 10, 10), gameGui.gbc.insets);
} }
@Test
public void testHighScoreChange() {
int expectedHighScore = 7;
gameGui.highScore = 0;
gameGui.questionNr = 7;
gameGui.highScore();
assertEquals(expectedHighScore, gameGui.highScore);
}
} }
Loading…
Cancel
Save