Browse Source

Added arrange and act in testRun

master
Leon Montag 2 years ago
parent
commit
511e090a54
  1. 1
      src/test/java/Gui/guiTest.java
  2. 21
      src/test/java/game/runGameTest.java

1
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

21
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);
}
}
Loading…
Cancel
Save