From ba3a74edb3b279db7f925dbd27c0c38740f152a9 Mon Sep 17 00:00:00 2001 From: Tobias Krause Date: Tue, 21 Dec 2021 14:34:29 +0100 Subject: [PATCH] gameexplorer: addPoints() overrides points of player --- src/main/java/de/tims/gameexplorer/Player.java | 3 +-- src/test/java/de/tims/gameexplorer/PlayerTest.java | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/tims/gameexplorer/Player.java b/src/main/java/de/tims/gameexplorer/Player.java index b0d8f52..34ede76 100644 --- a/src/main/java/de/tims/gameexplorer/Player.java +++ b/src/main/java/de/tims/gameexplorer/Player.java @@ -9,8 +9,7 @@ public class Player { } public void addPoints(int pointsToAdd) { - // TODO Auto-generated method stub - + this.points = pointsToAdd; } public int getPoints() { diff --git a/src/test/java/de/tims/gameexplorer/PlayerTest.java b/src/test/java/de/tims/gameexplorer/PlayerTest.java index 2864ecf..2711727 100644 --- a/src/test/java/de/tims/gameexplorer/PlayerTest.java +++ b/src/test/java/de/tims/gameexplorer/PlayerTest.java @@ -22,7 +22,8 @@ class PlayerTest { } private static Stream 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)); } }