From a2f37d2d66e3adc60590ee42935209a658312af2 Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Tue, 30 Jan 2024 16:22:33 +0100 Subject: [PATCH] Test.totalTurns --- .../de/hsfulda/onses/PlayerServiceTest.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java index 9f7dbab..0fcc5de 100644 --- a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java +++ b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java @@ -12,8 +12,7 @@ public class PlayerServiceTest { @Test @DisplayName("addPlayerToPlayerList") - void addPlayerToPlayerList() - { + void addPlayerToPlayerList() { //arrange Player input = new Player(); Player expected = input; @@ -24,10 +23,10 @@ public class PlayerServiceTest { // assert assertEquals(expected, answer); } + @Test @DisplayName("addMultiplePlayerToPlayerList") - void addMultiplePlayerToPlayerList() - { + void addMultiplePlayerToPlayerList() { //arrange Player input1 = new Player(); Player expected1 = input1; @@ -47,8 +46,7 @@ public class PlayerServiceTest { @Test @DisplayName("addAmountOfOpponents") - void addAmountOfOpponents() - { + void addAmountOfOpponents() { //arrange int input = 3; int expected = 3; @@ -64,4 +62,17 @@ public class PlayerServiceTest { assertEquals(expected, answer); } + @Test + @DisplayName("TotalTurnsEqualsAmountPlayers") + void totalTurnsEqualsAmountPlayers() { + // act + PlayerService playerservice = new PlayerService(); + playerservice.addPlayerToList(new Player()); + playerservice.addOpponents(3); + + int expected = playerservice.getPlayerList().size(); + int answer = playerservice.getTotalTurns(); + // assert + assertEquals(expected, answer); + } }