From 1ee0fd37be0ac3eaafb9a5b3b7e94973ecc2f73c Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Thu, 25 Jan 2024 13:16:38 +0100 Subject: [PATCH] Test.GetDrawCardDeck --- src/main/java/de/hsfulda/onses/models/Game.java | 5 +++++ src/test/java/de/hsfulda/onses/GameTest.java | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/hsfulda/onses/models/Game.java b/src/main/java/de/hsfulda/onses/models/Game.java index be6f1e1..e5066bc 100644 --- a/src/main/java/de/hsfulda/onses/models/Game.java +++ b/src/main/java/de/hsfulda/onses/models/Game.java @@ -19,4 +19,9 @@ public class Game { public ArrayList getDrawCardDeck() { return drawCardDeck; } + + public void addCardToDrawCardDeck(Card card) { + drawCardDeck.add(card); + } + } diff --git a/src/test/java/de/hsfulda/onses/GameTest.java b/src/test/java/de/hsfulda/onses/GameTest.java index 3ca4fd3..dc55137 100644 --- a/src/test/java/de/hsfulda/onses/GameTest.java +++ b/src/test/java/de/hsfulda/onses/GameTest.java @@ -16,6 +16,18 @@ public class GameTest { game.setLastPlayedCard(card); - assertEquals(card, answer); + assertEquals(game.getLastPlayedCard(), answer); + } + + @Test + @DisplayName("GetDrawCardDeck") + public void GetDrawCardDeck() { + Game game = new Game(); + Card card = new Card().setColor(Card.Color.RED).setValue(Card.Value.EIGHT); + Card answer = card; + + game.addCardToDrawCardDeck(card); + + assertEquals(game.getDrawCardDeck().getFirst(), answer); } }