diff --git a/src/main/java/de/hsfulda/onses/services/PlayerService.java b/src/main/java/de/hsfulda/onses/services/PlayerService.java index ed36463..b9d0123 100644 --- a/src/main/java/de/hsfulda/onses/services/PlayerService.java +++ b/src/main/java/de/hsfulda/onses/services/PlayerService.java @@ -18,13 +18,6 @@ public class PlayerService { totalTurns++; } - // button on gui activates it - public void addOpponents(int amount) { - for (int i=0; i 0 = main Player (skip -> 2x nextTurn()) // possible: at start of game random int generator from 0-max to decide who starts first diff --git a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java index bb1752a..02547bb 100644 --- a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java +++ b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java @@ -43,70 +43,4 @@ public class PlayerServiceTest { assertEquals(expected1, answer1); assertEquals(expected2, answer2); } - - @Test - @DisplayName("addAmountOfOpponents") - void addAmountOfOpponents() { - //arrange - int input = 3; - int expected = 3; - // act - PlayerService playerservice = new PlayerService(); - int before = playerservice.getPlayerList().size(); - - playerservice.addOpponents(input); - - int after = playerservice.getPlayerList().size(); - int answer = after - before; - // assert - 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); - } - @Test - @DisplayName("currentTurnsSwitching") - void currentTurnsSwitching4Players() { - // arrange - int expected = 2; - // act - PlayerService playerservice = new PlayerService(); - playerservice.addPlayerToList(new Player()); - playerservice.addOpponents(3); - - for (int i=0; i < expected; i++){ playerservice.nextTurn(); } - - int answer = playerservice.getCurrentTurn(); - // assert - assertEquals(expected, answer); - } - - @Test - @DisplayName("currentTurnsResettingAfterAfterTotalTurns") - void currentTurnsResettingAfterTotalTurns() { - // arrange - int expected = 0; - // act - PlayerService playerservice = new PlayerService(); - playerservice.addPlayerToList(new Player()); - playerservice.addOpponents(3); - int totalTurns = playerservice.getTotalTurns(); - - for (int i=0; i < totalTurns; i++){ playerservice.nextTurn(); } - - int answer = playerservice.getCurrentTurn(); - // assert - assertEquals(expected, answer); - } }