From 549aa37d20d5f73a1559bf033a9e45a25e0de5ac Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Tue, 30 Jan 2024 15:32:37 +0100 Subject: [PATCH] Test.playerList2Player --- .../de/hsfulda/onses/PlayerServiceTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java index 2ccdb19..fc77680 100644 --- a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java +++ b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java @@ -24,5 +24,25 @@ public class PlayerServiceTest { // assert assertEquals(expected, answer); } + @Test + @DisplayName("addMultiplePlayerToPlayerList") + void addMultiplePlayerToPlayerList() + { + //arrange + Player input1 = new Player(); + Player expected1 = input1; + Player input2 = new Player(); + Player expected2 = input2; + // act + PlayerService playerservice = new PlayerService(); + playerservice.addPlayerToList(input1); + playerservice.addPlayerToList(input2); + + Player answer1 = playerservice.getPlayerList().getFirst(); + Player answer2 = playerservice.getPlayerList().get(1); + // assert + assertEquals(expected1, answer1); + assertEquals(expected2, answer2); + } }