diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index 889f4b1..728f4b6 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -243,6 +243,25 @@ public class GameServiceTest { assertEquals(expected, answer); } + @Test + @DisplayName("DrawByChoiceForceKeep") + public void DrawByChoiceForceKeep() { + + GameService gameService = new GameService(); + Card input = new Card().setColor(Card.Color.RED).setValue(Card.Value.ONE); + + gameService.drawCard(gameService.getGame().getDrawCardDeck().size()); + gameService.getGame().getPlayerService().setCurrentTurn(true); + gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.GREEN).setValue(Card.Value.SEVEN)); + gameService.getGame().addCardToDrawCardDeck(input); + gameService.getGame().getPlayerService().getPlayerList().getFirst().addCardToPlayerDeck(new Card().setColor(Card.Color.BLUE).setValue(Card.Value.TWO)); + gameService.drawCard(1); + + Card answer = gameService.getGame().getPlayerService().getPlayerList().getFirst().getPlayerDeck().getLast(); + + assertEquals(input, answer); + } + @Test @DisplayName("DrawCardPlayerDeckBot") public void DrawCardPlayerDeckBot() {