Browse Source

4gewinnt: added getter for player1Score

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

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

@ -37,6 +37,10 @@ public class Logic {
player1Score = score;
}
public int getPlayer1Score() {
return player1Score;
}
public int playChip(int column) {
//add board update

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

@ -150,6 +150,16 @@ class LogicTest {
assertEquals(expectedResult, testObj.player1Score);
}
@Test
void getPlayer1ScoreTest() {
int expectedResult = 500;
testObj.setPlayer1Score(expectedResult);
int realResult = testObj.getPlayer1Score();
assertEquals(expectedResult, realResult);
}
private static Stream<Arguments> playfieldResults() {
int[][] playfield1 = {{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0},

Loading…
Cancel
Save