From 4e93ab5038f77968088ca905f7b6362b40bb0526 Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Wed, 31 Jan 2024 14:48:14 +0100 Subject: [PATCH] Test.legalMoveColorBlackChoosedraw --- .../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 a951735..7397d79 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -109,4 +109,19 @@ public class GameServiceTest { assertEquals(expected, answer); } + @Test + @DisplayName("legalMoveColorBlackCHOOSEDRAW") + public void legalMoveColorBlackCHOOSEDRAW() { + // arrange + Card input = new Card().setColor(Card.Color.BLACK).setValue(Card.Value.CHOOSEDRAW); + boolean expected = true; + // act + GameService gameService = new GameService(); + gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.GREEN).setValue(Card.Value.FIVE)); + + boolean answer = gameService.legalMove(new Player(), input); + // assert + assertEquals(expected, answer); + } + }