From b6e021276f0ad674f02810f6ff4f66f38d8376d2 Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Tue, 30 Jan 2024 15:58:27 +0100 Subject: [PATCH] Refactoring: addOpponent-test more reliable --- src/test/java/de/hsfulda/onses/PlayerServiceTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java index b5c5b3b..1e32e55 100644 --- a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java +++ b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java @@ -54,8 +54,12 @@ public class PlayerServiceTest { int expected = 3; // act PlayerService playerservice = new PlayerService(); + int before = playerservice.getPlayerList().size(); + playerservice.addOpponents(input); - int answer = playerservice.getPlayerList().size(); + + int after = playerservice.getPlayerList().size(); + int answer = after - before; // assert assertEquals(expected, answer); }