From 4c9bdb2f0cd796d59a1047b41cca79f283a608b4 Mon Sep 17 00:00:00 2001 From: Steffen Helmke Date: Mon, 10 Jan 2022 19:06:43 +0100 Subject: [PATCH] 4gewinnt: added playChip method --- src/main/java/de/tims/viergewinnt/ai/Logic.java | 4 ++++ src/test/java/de/tims/viergewinnt/ai/LogicTest.java | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/main/java/de/tims/viergewinnt/ai/Logic.java b/src/main/java/de/tims/viergewinnt/ai/Logic.java index 0f5f61c..139df50 100644 --- a/src/main/java/de/tims/viergewinnt/ai/Logic.java +++ b/src/main/java/de/tims/viergewinnt/ai/Logic.java @@ -13,6 +13,10 @@ import javax.swing.JPanel; public class Logic { + public int playChip(int[][] playfield, int column, int player) { + return 0; + } + 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 d6c0ad4..731b925 100644 --- a/src/test/java/de/tims/viergewinnt/ai/LogicTest.java +++ b/src/test/java/de/tims/viergewinnt/ai/LogicTest.java @@ -28,6 +28,17 @@ class LogicTest { assertEquals(expectedResult, realResult); } + @Test + void playChipTest() { + int[][] playfield = new int[6][6]; + int column = 0; + int player = 1; + int expectedResult = 0; + int realResult = testObj.playChip(playfield, column, player); + + assertEquals(expectedResult, realResult); + } + private static Stream playfieldResults() { int[][] playfield1 = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},