Browse Source

4gewinnt: added playChip method

4gewinnt
Steffen Helmke 3 years ago
committed by Lorenz Hohmann
parent
commit
4c9bdb2f0c
  1. 4
      src/main/java/de/tims/viergewinnt/ai/Logic.java
  2. 11
      src/test/java/de/tims/viergewinnt/ai/LogicTest.java

4
src/main/java/de/tims/viergewinnt/ai/Logic.java

@ -13,6 +13,10 @@ import javax.swing.JPanel;
public class Logic { public class Logic {
public int playChip(int[][] playfield, int column, int player) {
return 0;
}
JPanel contentPanel; JPanel contentPanel;
JPanel buttonPanel; JPanel buttonPanel;
JPanel playfieldPanel; JPanel playfieldPanel;

11
src/test/java/de/tims/viergewinnt/ai/LogicTest.java

@ -28,6 +28,17 @@ class LogicTest {
assertEquals(expectedResult, realResult); 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<Arguments> playfieldResults() { private static Stream<Arguments> playfieldResults() {
int[][] playfield1 = {{0, 0, 0, 0, 0, 0}, int[][] playfield1 = {{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},

Loading…
Cancel
Save