Browse Source

4gewinnt: testForWin emtpy Field

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

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

@ -1,5 +1,7 @@
package de.tims.viergewinnt.ai;
public class Logic {
public boolean testForWin(int[][] playfield, int player) {
return true;
}
}

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

@ -6,14 +6,22 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
class LogicTest {
private Logic testObj;
@BeforeEach
void setUp() throws Exception {
testObj = new Logic();
}
@Test
void test() {
fail("Not yet implemented");
void testForWinTest() {
int[][] testField = new int[6][6];
boolean expectedResult = false;
boolean realResult = testObj.testForWin(testField, 1);
assertEquals(expectedResult, realResult);
}
}
Loading…
Cancel
Save