Browse Source

4gewinnt: refactored calcScore testmethods

4gewinnt
Steffen Helmke 3 years ago
committed by Lorenz Hohmann
parent
commit
e2bd09d713
  1. 14
      src/test/java/de/tims/viergewinnt/ai/LogicTest.java

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

@ -68,11 +68,9 @@ class LogicTest {
assertEquals(expectedResult, realResult);
}
@Test
void calcScoreTest() {
int[][] playfield = new int[6][6];
int player = 1;
int expectedResult = 0;
@ParameterizedTest(name = "[{index}] {0} Win for Player {2} {1}")
@MethodSource("playfieldForScore")
void calcScoreTest(String testName, int[][] playfield, int player, int expectedResult) {
int realResult = testObj.calcScore(playfield, player);
@ -120,4 +118,10 @@ class LogicTest {
);
}
private static Stream<Arguments> playfieldForScore() {
return Stream.of(
Arguments.of("emptyField", new int[6][6], 1, 0)
);
}
}
Loading…
Cancel
Save