From 9284d001e853935271c286378d4a8e3c19436bc8 Mon Sep 17 00:00:00 2001 From: fdai7793 Date: Wed, 7 Feb 2024 16:57:19 +0100 Subject: [PATCH] Test.CheckIfCardsPlayedByBotWillTurnFaceUp --- .../java/de/hsfulda/onses/GameServiceTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index df554ba..a27b039 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -504,4 +504,21 @@ public class GameServiceTest { assertTrue(gameService.getGame().getPlayerService().getPlayerList().getLast().getPlayerDeck().get(i).isFacedown()); } } + + @Test + @DisplayName("CheckIfCardsPlayedByBotWillTurnFaceUp") + public void CheckIfCardsPlayedByBotWillTurnFaceUp() { + GameService gameService = new GameService(); + + Card card = new Card().setColor(Card.Color.GREEN).setValue(Card.Value.FOUR).setFacedown(true); + + gameService.getGame().getPlayerService().setCurrentTurn(false); + gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.GREEN).setValue(Card.Value.FIVE)); + gameService.getGame().getPlayerService().getPlayerList().getLast().getPlayerDeck().clear(); + gameService.getGame().getPlayerService().getPlayerList().getLast().getPlayerDeck().add(card); + + gameService.getGame().getPlayerService().botMove(); + + assertFalse(gameService.getGame().getLastPlayedCard().isFacedown()); + } }