From 6cb972cf78abacec803203b1fdeca3c26e6c2144 Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Fri, 2 Feb 2024 17:23:14 +0100 Subject: [PATCH] Test.ChooseDrawTest --- .../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 5c5fe84..f54dee2 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -227,4 +227,22 @@ public class GameServiceTest { } + @Test + @DisplayName("ChooseDrawTest") + public void ChooseDrawTest () + { + GameService gameservice = new GameService(); + boolean expected = true; + boolean answer = false; + + gameservice.playCard(new Player(), new Card().setValue(Card.Value.CHOOSEDRAW).setColor(Card.Color.BLACK)); + + if (gameservice.getGame().getLastPlayedCard().getColor() != Card.Color.BLACK) { + answer = true; + } + + assertEquals(expected, answer); + + } + }