From d3ec638be0ecbb16c33af687fd80d2b52860bd97 Mon Sep 17 00:00:00 2001 From: Steffen Helmke Date: Wed, 2 Feb 2022 15:34:46 +0100 Subject: [PATCH] 4gewinnt: added checkButtons method --- src/main/java/de/tims/viergewinnt/ai/Logic.java | 4 ++++ src/test/java/de/tims/viergewinnt/ai/LogicTest.java | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/de/tims/viergewinnt/ai/Logic.java b/src/main/java/de/tims/viergewinnt/ai/Logic.java index 922f32f..5773da8 100644 --- a/src/main/java/de/tims/viergewinnt/ai/Logic.java +++ b/src/main/java/de/tims/viergewinnt/ai/Logic.java @@ -86,6 +86,10 @@ public class Logic { return 0; } + public boolean checkButtons() { + return true; + } + JPanel contentPanel; JPanel buttonPanel; JPanel playfieldPanel; diff --git a/src/test/java/de/tims/viergewinnt/ai/LogicTest.java b/src/test/java/de/tims/viergewinnt/ai/LogicTest.java index 3e27f5c..c2f308a 100644 --- a/src/test/java/de/tims/viergewinnt/ai/LogicTest.java +++ b/src/test/java/de/tims/viergewinnt/ai/LogicTest.java @@ -226,6 +226,16 @@ class LogicTest { assertEquals(testObj.getBoardSize() - 3, testObj.getFreePlace(0)); } + @Test + void checkButtonsTest() { + testObj.create4gewinntGui(); + boolean expectedResult = true; + + boolean realResult = testObj.checkButtons(); + + assertEquals(expectedResult, realResult); + } + private static Stream playfieldResults() { int[][] playfield1 = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},