From 8c05b73c72e87e42b8c1d839a024a6e75760a8b4 Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Fri, 2 Feb 2024 17:09:53 +0100 Subject: [PATCH] Test.ChooseTest --- .../java/de/hsfulda/onses/GameServiceTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index c60ff9b..5c5fe84 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -209,4 +209,22 @@ public class GameServiceTest { assertEquals(expected, gameservice.getGame().getPlayerService().getCurrentTurn()); } + @Test + @DisplayName("ChooseTest") + public void ChooseTest () + { + GameService gameservice = new GameService(); + boolean expected = true; + boolean answer = false; + + gameservice.playCard(new Player(), new Card().setValue(Card.Value.CHOOSE).setColor(Card.Color.BLACK)); + + if (gameservice.getGame().getLastPlayedCard().getColor() != Card.Color.BLACK) { + answer = true; + } + + assertEquals(expected, answer); + + } + }