From a9e53387a2bd6f7a322fa0253688c794674d685f Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Fri, 2 Feb 2024 18:16:25 +0100 Subject: [PATCH] add fillDrawCardDeck to Constuctor --- src/main/java/de/hsfulda/onses/services/GameService.java | 2 ++ src/test/java/de/hsfulda/onses/GameServiceTest.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/hsfulda/onses/services/GameService.java b/src/main/java/de/hsfulda/onses/services/GameService.java index 3f32a14..3ca661d 100644 --- a/src/main/java/de/hsfulda/onses/services/GameService.java +++ b/src/main/java/de/hsfulda/onses/services/GameService.java @@ -11,6 +11,8 @@ public class GameService { public GameService(Game game) { this.game = game; this.game.setGameService(this); + fillDrawDeck(); + shuffleDeck(); } public GameService() { this(new Game()); diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index f54dee2..1fb6e98 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -68,7 +68,7 @@ public class GameServiceTest { @DisplayName("FillDrawCardDeck") public void FillDrawCardDeck() { GameService gameService = new GameService(); - int expected = 112; + int expected = gameService.getGame().getDrawCardDeck().size() + 112; gameService.fillDrawDeck(); int answer = gameService.getGame().getDrawCardDeck().size();