diff --git a/src/main/java/de/tims/tictactoe/GameLogic.java b/src/main/java/de/tims/tictactoe/GameLogic.java index 4a7c6d8..14de497 100644 --- a/src/main/java/de/tims/tictactoe/GameLogic.java +++ b/src/main/java/de/tims/tictactoe/GameLogic.java @@ -1,5 +1,7 @@ package de.tims.tictactoe; +import javax.swing.JPanel; + public class GameLogic { private static final char PLAYER_1 = 'x'; @@ -94,4 +96,9 @@ public class GameLogic { return checkForWin(PLAYER_1) || checkForWin(PLAYER_2); } + public JPanel generateGUI() { + // TODO Auto-generated method stub + return new JPanel(); + } + } diff --git a/src/test/java/de/tims/tictactoe/GameLogicTest.java b/src/test/java/de/tims/tictactoe/GameLogicTest.java index fbceac8..a9fb9bd 100644 --- a/src/test/java/de/tims/tictactoe/GameLogicTest.java +++ b/src/test/java/de/tims/tictactoe/GameLogicTest.java @@ -5,6 +5,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.stream.Stream; +import javax.swing.JPanel; + import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; @@ -53,6 +55,14 @@ class GameLogicTest { assertArrayEquals(expectedResult, realResult); } + @Test + void generateGUITest() { + JPanel expectedResult = new JPanel(); + JPanel realResult = game.generateGUI(); + + assertEquals(expectedResult.getClass(), realResult.getClass()); + } + @ParameterizedTest(name = "[{index}] {0} -> {2} fields") @MethodSource("testCasesForCountPlayfields") void fieldCountTest(String testName, int size, int expectedResult) {