From 98ca34b8317fe39bfdc65657fd9b82bc1ad57e98 Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Fri, 2 Feb 2024 11:43:16 +0100 Subject: [PATCH] Test.newCurrentTurn --- .../de/hsfulda/onses/PlayerServiceTest.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java index 02547bb..08630c6 100644 --- a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java +++ b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java @@ -43,4 +43,31 @@ public class PlayerServiceTest { assertEquals(expected1, answer1); assertEquals(expected2, answer2); } + @Test + @DisplayName("checkCurrentTurnAfterNextTurn") + void checkCurrentTurnAfterNextTurn() { + //arrange + boolean expected = true; + // act + PlayerService playerservice = new PlayerService(); + playerservice.setCurrentTurn(false); + playerservice.nextTurn(); + boolean answer = playerservice.getCurrentTurn(); + // assert + assertEquals(expected, answer); + } + @Test + @DisplayName("checkCurrentTurnAfterTwoTurns") + void checkCurrentTurnAfterTwoTurns() { + //arrange + boolean expected = false; + // act + PlayerService playerservice = new PlayerService(); + playerservice.setCurrentTurn(false); + playerservice.nextTurn(); + playerservice.nextTurn(); + boolean answer = playerservice.getCurrentTurn(); + // assert + assertEquals(expected, answer); + } }