From d512947cdea4e1ee3fe558562d547654ffd73fbe Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Tue, 30 Jan 2024 15:51:47 +0100 Subject: [PATCH] Test.addOpponents --- .../java/de/hsfulda/onses/PlayerServiceTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java index fc77680..b5c5b3b 100644 --- a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java +++ b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java @@ -45,4 +45,19 @@ public class PlayerServiceTest { assertEquals(expected2, answer2); } + @Test + @DisplayName("addPlayerToPlayerList") + void addAmountOfOpponents() + { + //arrange + int input = 3; + int expected = 3; + // act + PlayerService playerservice = new PlayerService(); + playerservice.addOpponents(input); + int answer = playerservice.getPlayerList().size(); + // assert + assertEquals(expected, answer); + } + }