From c34b4d38849e756b7c831c61f8398e4d0649a4b2 Mon Sep 17 00:00:00 2001 From: fdai7906 <finn.kraemer@informatik.hs-fulda.de> Date: Wed, 31 Jan 2024 14:33:47 +0100 Subject: [PATCH] Test.legalMoveSameValueThree --- .../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 f3190a1..ba7059d 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -79,4 +79,19 @@ public class GameServiceTest { assertEquals(expected, answer); } + @Test + @DisplayName("legalMoveSameValueThree") + public void legalMoveSameValueThree() { + // arrange + Card input = new Card().setColor(Card.Color.GREEN).setValue(Card.Value.THREE); + 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); + } + }