Highscores.txt hinzufügen

continueCode
Vickvick2002 2025-01-05 17:06:19 +01:00
parent f7868e042f
commit 01e77b1824
2 changed files with 0 additions and 57 deletions

View File

@ -1,4 +0,0 @@
package PR2.HitoriSpiel.test.GUI;
public class PauseMenuTest {
}

View File

@ -1,53 +0,0 @@
package GUI;
import PR2.HitoriSpiel.GUI.StartMenu;
import org.assertj.swing.edt.GuiActionRunner;
import org.assertj.swing.fixture.FrameFixture;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import javax.swing.*;
import static org.assertj.core.api.Assertions.assertThat;
public class StartMenuTest {
private FrameFixture window;
@BeforeEach
public void setUp() {
JFrame frame = GuiActionRunner.execute(() -> {
JFrame testFrame = new JFrame();
testFrame.add(new StartMenu(testFrame));
testFrame.pack();
testFrame.setVisible(true);
return testFrame;
});
window = new FrameFixture(frame);
}
@AfterEach
public void tearDown() {
window.cleanUp();
}
@Test
public void testButtonsExist() {
// Buttons über ihre Namen finden und testen
assertThat(window.button("continueButton")).isNotNull();
assertThat(window.button("selectBoardButton")).isNotNull();
assertThat(window.button("randomBoardButton")).isNotNull();
assertThat(window.button("highscorelistButton")).isNotNull();
assertThat(window.button("exitButton")).isNotNull();
}
@Test
public void testButtonActions() {
window.button("continueButton").click();
window.button("selectBoardButton").click();
window.button("randomBoardButton").click();
window.button("highscorelistButton").click();
window.button("exitButton").click();
}
}