From 7e3afbee5bf4e79776299b4ee80000bff640f08d Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Wed, 31 Jan 2024 14:45:01 +0100 Subject: [PATCH] Test.legalMoveColorBlackChoose --- .../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 ba7059d..a951735 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -94,4 +94,19 @@ public class GameServiceTest { assertEquals(expected, answer); } + @Test + @DisplayName("legalMoveColorBlack") + public void legalMoveColorBlack() { + // arrange + Card input = new Card().setColor(Card.Color.BLACK).setValue(Card.Value.CHOOSE); + boolean expected = true; + // act + GameService gameService = new GameService(); + gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.YELLOW).setValue(Card.Value.THREE)); + + boolean answer = gameService.legalMove(new Player(), input); + // assert + assertEquals(expected, answer); + } + }