From 258c69122f343946fb01efa01b22c1dc7b53637f Mon Sep 17 00:00:00 2001 From: fdai7793 Date: Mon, 5 Feb 2024 19:48:11 +0100 Subject: [PATCH] Test.CheckIfBotMovesAutomaticallyAfterPlayer --- .../java/de/hsfulda/onses/GameServiceTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index d54b1cc..de47a5e 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -459,4 +459,19 @@ public class GameServiceTest { assertTrue(gameService.getTest()); } + + @Test + @DisplayName("CheckIfBotMovesAutomaticallyAfterPlayer") + public void CheckIfBotMovesAutomaticallyAfterPlayer() { + GameService gameService = new GameService(); + + Card card = new Card().setColor(Card.Color.BLUE).setValue(Card.Value.ONE); + gameService.getGame().getPlayerService().getPlayerList().getLast().getPlayerDeck().add(new Card().setColor(Card.Color.BLUE).setValue(Card.Value.FIVE)); + + gameService.playCard(card); + + boolean answer = gameService.getGame().getLastPlayedCard() != card; + + assertTrue(answer); + } }