diff --git a/src/main/java/de/hsfulda/onses/models/Card.java b/src/main/java/de/hsfulda/onses/models/Card.java index 91cab36..2dbc3d5 100644 --- a/src/main/java/de/hsfulda/onses/models/Card.java +++ b/src/main/java/de/hsfulda/onses/models/Card.java @@ -11,6 +11,7 @@ public class Card { private Color color; private Value value; + private boolean facedown = false; public enum Color { RED, BLUE, GREEN, YELLOW, BLACK; @@ -41,6 +42,15 @@ public class Card { return this.value; } + public boolean isFacedown() { + return facedown; + } + + public Card setFacedown(boolean facedown) { + this.facedown = facedown; + return this; + } + public PropertyChangeSupport listeners() { if(this.listeners == null) { this.listeners = new PropertyChangeSupport(this); diff --git a/src/test/java/de/hsfulda/onses/CardTest.java b/src/test/java/de/hsfulda/onses/CardTest.java index a2a570a..d7ea092 100644 --- a/src/test/java/de/hsfulda/onses/CardTest.java +++ b/src/test/java/de/hsfulda/onses/CardTest.java @@ -1,6 +1,7 @@ package de.hsfulda.onses; +import de.hsfulda.onses.services.GameService; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; @@ -65,4 +66,25 @@ public class CardTest { assertEquals(expected, answer); } + @Test + @DisplayName("facedownGetter") + public void facedownGetter() { + Card card = new Card(); + boolean answer = card.isFacedown(); + boolean expected = false; + + assertEquals(expected, answer); + } + + @Test + @DisplayName("facedownSetter") + public void faceDownSetter() { + Card card = new Card(); + card.setFacedown(true); + boolean answer = card.isFacedown(); + boolean expected = true; + assertEquals(expected, answer); + + } + } \ No newline at end of file