diff --git a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java index 5dc2fd2..0bb951a 100644 --- a/src/test/java/de/hsfulda/onses/PlayerServiceTest.java +++ b/src/test/java/de/hsfulda/onses/PlayerServiceTest.java @@ -1,6 +1,8 @@ package de.hsfulda.onses; +import com.sun.tools.jconsole.JConsoleContext; +import de.hsfulda.onses.models.Card; import de.hsfulda.onses.services.PlayerService; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -90,4 +92,22 @@ public class PlayerServiceTest { assertEquals(expected, answer1); assertEquals(expected, answer2); } + + @Test + @DisplayName("CheckForCardRemoval") + void CheckForCardRemoval() { + PlayerService playerService = new PlayerService(); + + Card card1 = new Card().setColor(Card.Color.YELLOW).setValue(Card.Value.TWO); + Card card2 = new Card().setColor(Card.Color.RED).setValue(Card.Value.ONE); + + playerService.getPlayerList().getFirst().addCardToPlayerDeck(card1); + playerService.getPlayerList().getFirst().addCardToPlayerDeck(card2); + int before = playerService.getPlayerList().getFirst().getPlayerDeck().size(); + + playerService.removeCardFromPlayerDeck(card1); + int after = playerService.getPlayerList().getFirst().getPlayerDeck().size(); + + assertEquals(before - 1, after); + } }