From e56c6802351f3efd8085f4aaace07969e9b65d9e Mon Sep 17 00:00:00 2001 From: fdai7736 Date: Thu, 8 Feb 2024 12:14:02 +0100 Subject: [PATCH] add test for player set card player --- src/test/java/de/hsfulda/onses/PlayerTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/PlayerTest.java b/src/test/java/de/hsfulda/onses/PlayerTest.java index 9ce04fd..7dab45d 100644 --- a/src/test/java/de/hsfulda/onses/PlayerTest.java +++ b/src/test/java/de/hsfulda/onses/PlayerTest.java @@ -114,4 +114,15 @@ public class PlayerTest { player.setCurrentCard(card); assertEquals(card, player.getCurrentCard()); } + + @Test + @DisplayName("Set Player by Card") + void testPlayerSetByCard() { + Player player = new Player(); + Card card = new Card(); + + assertNull(card.getPlayer()); + player.addCardToPlayerDeck(card); + assertEquals(player, card.getPlayer()); + } }