Browse Source

created test for checking WinningRestartBtn

master
Ozan-Can Ekinci 2 years ago
parent
commit
cb192c6951
  1. 13
      src/test/java/Gui/ActionHandlerTest.java

13
src/test/java/Gui/ActionHandlerTest.java

@ -17,6 +17,7 @@ class ActionHandlerTest {
gui.StartMainMenu(); gui.StartMainMenu();
gameGui.createGui(); gameGui.createGui();
gameGui.createLosingPanel(); gameGui.createLosingPanel();
gameGui.createWinningPanel();
} }
@Test @Test
@ -30,4 +31,16 @@ class ActionHandlerTest {
//assert //assert
assertEquals(expectedNr, GameGui.questionNr); assertEquals(expectedNr, GameGui.questionNr);
} }
@Test
public void testWinningRestartBtn() {
//arrange
int expectedNr = 1;
//act
GameGui.questionNr= 2;
ActionHandler actionHandler = new ActionHandler();
GameGui.WinningRestartBtn.doClick();
//assert
assertEquals(expectedNr, GameGui.questionNr);
}
} }
Loading…
Cancel
Save