From b3e8d49aecad149c0b4af2bb8787c159837d3e6b Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Fri, 2 Feb 2024 11:25:49 +0100 Subject: [PATCH] remove AddOpponents + Tests --- .../hsfulda/onses/services/PlayerService.java | 7 -- .../de/hsfulda/onses/PlayerServiceTest.java | 66 ------------------- 2 files changed, 73 deletions(-) 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); - } }