Browse Source

gameexplorer: addPoints() overrides points of player

Tobias Krause 3 years ago
committed by Lorenz Hohmann
parent
commit
8e8f4376ef
  1. 3
      src/main/java/de/tims/gameexplorer/Player.java
  2. 3
      src/test/java/de/tims/gameexplorer/PlayerTest.java

3
src/main/java/de/tims/gameexplorer/Player.java

@ -9,8 +9,7 @@ public class Player {
} }
public void addPoints(int pointsToAdd) { public void addPoints(int pointsToAdd) {
// TODO Auto-generated method stub
this.points = pointsToAdd;
} }
public int getPoints() { public int getPoints() {

3
src/test/java/de/tims/gameexplorer/PlayerTest.java

@ -22,7 +22,8 @@ class PlayerTest {
} }
private static Stream<Arguments> testCasesForAddPoints() { private static Stream<Arguments> testCasesForAddPoints() {
return Stream.of(Arguments.of("NoPointsBeforeGet0Points", 0, 0, 0));
return Stream.of(Arguments.of("NoPointsBeforeGet0Points", 0, 0, 0),
Arguments.of("NoPointsBeforeGet10Points", 0, 10, 10));
} }
} }
Loading…
Cancel
Save