Browse Source

add fillDrawCardDeck to Constuctor

main
fdai7906 11 months ago
parent
commit
a9e53387a2
  1. 2
      src/main/java/de/hsfulda/onses/services/GameService.java
  2. 2
      src/test/java/de/hsfulda/onses/GameServiceTest.java

2
src/main/java/de/hsfulda/onses/services/GameService.java

@ -11,6 +11,8 @@ public class GameService {
public GameService(Game game) { public GameService(Game game) {
this.game = game; this.game = game;
this.game.setGameService(this); this.game.setGameService(this);
fillDrawDeck();
shuffleDeck();
} }
public GameService() { public GameService() {
this(new Game()); this(new Game());

2
src/test/java/de/hsfulda/onses/GameServiceTest.java

@ -68,7 +68,7 @@ public class GameServiceTest {
@DisplayName("FillDrawCardDeck") @DisplayName("FillDrawCardDeck")
public void FillDrawCardDeck() { public void FillDrawCardDeck() {
GameService gameService = new GameService(); GameService gameService = new GameService();
int expected = 112;
int expected = gameService.getGame().getDrawCardDeck().size() + 112;
gameService.fillDrawDeck(); gameService.fillDrawDeck();
int answer = gameService.getGame().getDrawCardDeck().size(); int answer = gameService.getGame().getDrawCardDeck().size();

Loading…
Cancel
Save