From 8daba2ef47419d49f94232704db94f80cde710da Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Sun, 4 Feb 2024 20:29:07 +0100 Subject: [PATCH] Test.DrawCardBotDeck --- src/test/java/de/hsfulda/onses/GameServiceTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index 87071b9..208dac7 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -243,6 +243,19 @@ public class GameServiceTest { assertEquals(expected, answer); } + @Test + @DisplayName("DrawCardPlayerDeckBot") + public void DrawCardPlayerDeckBot() { + GameService gameService = new GameService(); + gameService.getGame().getPlayerService().setCurrentTurn(false); + int before = gameService.getGame().getPlayerService().getPlayerList().getLast().getPlayerDeck().size(); + gameService.drawCard(2); + int after = gameService.getGame().getPlayerService().getPlayerList().getLast().getPlayerDeck().size(); + + int expected = 2; + int answer = after - before; + assertEquals(expected, answer); + } @Test @DisplayName("DrawCardDeckTest")