diff --git a/src/test/java/Gui/guiTest.java b/src/test/java/Gui/guiTest.java index 5ea01fc..0a6b092 100644 --- a/src/test/java/Gui/guiTest.java +++ b/src/test/java/Gui/guiTest.java @@ -11,6 +11,7 @@ class guiTest { static void setUp() { GuiInterface StartGui = new gui(); StartGui.StartMainMenu(); + gui.Frame.setVisible(false); } @Test diff --git a/src/test/java/game/runGameTest.java b/src/test/java/game/runGameTest.java index 52b7c87..05af9ca 100644 --- a/src/test/java/game/runGameTest.java +++ b/src/test/java/game/runGameTest.java @@ -9,8 +9,13 @@ import java.io.IOException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import Gui.GameGui; +import Gui.gui; + class runGameTest { + GameGui game = new GameGui(); + gui Gui = new gui(); @BeforeEach void setUp() throws Exception { } @@ -60,4 +65,20 @@ class runGameTest { assertEquals("4", parts[3]); } + @Test + public void testRun() { + //arrange + Gui.StartMainMenu(); + game.createGui(); + gui.Frame.setVisible(false); + //act + runGame.arrQuestions = new String[]{"Frage 1", "Frage 2"}; + runGame.arrAnswers = new String[]{"Antw. 1,Antw. 2,Antw. 3,Antw. 4", + "Antw. 5,Antw. 6,Antw. 7,Antw. 8"}; + runGame game = new runGame(); + game.run(0); + + + } + }