From cb192c6951886ed541872335e48a522593e2935f Mon Sep 17 00:00:00 2001 From: Ozan-Can Ekinci Date: Mon, 16 Jan 2023 21:45:42 +0100 Subject: [PATCH] created test for checking WinningRestartBtn --- src/test/java/Gui/ActionHandlerTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/Gui/ActionHandlerTest.java b/src/test/java/Gui/ActionHandlerTest.java index f798a3a..f333dd9 100644 --- a/src/test/java/Gui/ActionHandlerTest.java +++ b/src/test/java/Gui/ActionHandlerTest.java @@ -17,6 +17,7 @@ class ActionHandlerTest { gui.StartMainMenu(); gameGui.createGui(); gameGui.createLosingPanel(); + gameGui.createWinningPanel(); } @Test @@ -30,4 +31,16 @@ class ActionHandlerTest { //assert 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); + } } \ No newline at end of file