From 954a1d75c55f96838bf380208909cf25b82634d4 Mon Sep 17 00:00:00 2001 From: fdai7793 Date: Wed, 24 Jan 2024 15:16:22 +0100 Subject: [PATCH] test_AddMultipleCardsToPlayerDeck --- src/test/java/de/hsfulda/onses/PlayerTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/PlayerTest.java b/src/test/java/de/hsfulda/onses/PlayerTest.java index 010b5a3..80c68d5 100644 --- a/src/test/java/de/hsfulda/onses/PlayerTest.java +++ b/src/test/java/de/hsfulda/onses/PlayerTest.java @@ -25,4 +25,22 @@ public class PlayerTest { // assert assertEquals(testCard, firstCardPlayerDeck); } + + @Test + @DisplayName("AddMultipleCardsToPlayerDeck") + public void AddMultipleCardsToPlayerDeck() { + + // arrange + Player player = new Player(); + Card testCard1 = new Card().setColor(Card.Color.BLACK).setValue(Card.Value.FIVE); + Card testCard2 = new Card().setColor(Card.Color.YELLOW).setValue(Card.Value.FIVE); + // act + player.addCardToPlayerDeck(testCard1); + player.addCardToPlayerDeck(testCard2); + Card firstCardPlayerDeck = player.getPlayerDeck().getFirst(); + Card secondCardPlayerDeck = player.getPlayerDeck().get(1); + // assert + assertEquals(testCard1, firstCardPlayerDeck); + assertEquals(testCard2, secondCardPlayerDeck); + } }