From 6660d94a147f1f229882bd42d216e38c52a9a3a4 Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Wed, 31 Jan 2024 14:28:26 +0100 Subject: [PATCH] Test.legalMoveSameValueOne --- .../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 8a22108..f3190a1 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -64,4 +64,19 @@ public class GameServiceTest { assertEquals(expected, answer); } + @Test + @DisplayName("legalMoveSameValueOne") + public void legalMoveSameValueOne() { + // arrange + Card input = new Card().setColor(Card.Color.RED).setValue(Card.Value.ONE); + boolean expected = true; + // act + GameService gameService = new GameService(); + gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.YELLOW).setValue(Card.Value.ONE)); + + boolean answer = gameService.legalMove(new Player(), input); + // assert + assertEquals(expected, answer); + } + }