Browse Source

created test for LosingRestartBtn

master
Ozan-Can Ekinci 2 years ago
parent
commit
1dd8b730cd
  1. 33
      src/test/java/Gui/ActionHandlerTest.java
  2. 18
      target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  3. 7
      target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst

33
src/test/java/Gui/ActionHandlerTest.java

@ -0,0 +1,33 @@
package Gui;
import static org.junit.jupiter.api.Assertions.*;
import java.awt.event.ActionEvent;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
@TestInstance(Lifecycle.PER_CLASS)
class ActionHandlerTest {
gui gui = new gui();
GameGui gameGui = new GameGui();
@BeforeAll
void setUp(){
gui.StartMainMenu();
gameGui.createGui();
gameGui.createLosingPanel();
}
@Test
public void testLosingRestartBtn() {
//arrange
int expectedNr = 1;
//act
GameGui.questionNr= 2;
ActionHandler actionHandler = new ActionHandler();
GameGui.LosingRestartBtn.doClick();
//assert
assertEquals(expectedNr, GameGui.questionNr);
}
}

18
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@ -1,9 +1,9 @@
C:\Users\Leon\MiniGameProject\src\main\java\Gui\ActionHandler.java
C:\Users\Leon\MiniGameProject\src\main\java\game\loadNextQuestion.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\GameGuiInterface.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\gui.java
C:\Users\Leon\MiniGameProject\src\main\java\game\runGame.java
C:\Users\Leon\MiniGameProject\src\main\java\main.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\StartGameGui.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\GameGui.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\GuiInterface.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\GuiInterface.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\GameGuiInterface.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\gui.java
C:\Users\ozan_\MiniGameProject\src\main\java\game\loadNextQuestion.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\ActionHandler.java
C:\Users\ozan_\MiniGameProject\src\main\java\main.java
C:\Users\ozan_\MiniGameProject\src\main\java\game\runGame.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\StartGameGui.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\GameGui.java

7
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst

@ -1,3 +1,4 @@
C:\Users\Leon\MiniGameProject\src\test\java\Gui\guiTest.java
C:\Users\Leon\MiniGameProject\src\test\java\Gui\GameGuiTest.java
C:\Users\Leon\MiniGameProject\src\test\java\game\runGameTest.java
C:\Users\ozan_\MiniGameProject\src\test\java\Gui\ActionHandlerTest.java
C:\Users\ozan_\MiniGameProject\src\test\java\Gui\GameGuiTest.java
C:\Users\ozan_\MiniGameProject\src\test\java\game\runGameTest.java
C:\Users\ozan_\MiniGameProject\src\test\java\Gui\guiTest.java
Loading…
Cancel
Save