From 528470310b61ae917fbf655a8312c09769b680bb Mon Sep 17 00:00:00 2001 From: fdai7793 Date: Sun, 4 Feb 2024 20:10:21 +0100 Subject: [PATCH] Test.CheckThatFirstCardGetsRemovedFromDrawCardDeck --- .../de/hsfulda/onses/GameServiceTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index df7bfdd..e2d77d4 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -312,4 +312,23 @@ public class GameServiceTest { assertEquals(7, numberOfCards); } + + @Test + @DisplayName("CheckThatFirstCardGetsRemovedFromDrawCardDeck") + public void CheckThatFirstCardGetsRemovedFromDrawCardDeck() { + GameService gameService = new GameService(); + + Card lastPlayedCard = gameService.getGame().getLastPlayedCard(); + + boolean lastPlayedCardDoesNotExistInDrawCardDeck = true; + + for (int i = 0; i < gameService.getGame().getDrawCardDeck().size(); i++) { + if (gameService.getGame().getDrawCardDeck().get(i) == lastPlayedCard) { + lastPlayedCardDoesNotExistInDrawCardDeck = false; + break; + } + } + + assertTrue(lastPlayedCardDoesNotExistInDrawCardDeck); + } }