From f4c05a9e2f606f71648cb99516ba4bc3f06d427f Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Sat, 14 Jan 2017 19:19:01 +0000 Subject: [PATCH] Added Card tests. --- .../co/neviyn/pokergame/model/CardTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/test/java/uk/co/neviyn/pokergame/model/CardTest.java diff --git a/src/test/java/uk/co/neviyn/pokergame/model/CardTest.java b/src/test/java/uk/co/neviyn/pokergame/model/CardTest.java new file mode 100644 index 0000000..ec0a973 --- /dev/null +++ b/src/test/java/uk/co/neviyn/pokergame/model/CardTest.java @@ -0,0 +1,30 @@ +package uk.co.neviyn.pokergame.model; + +import org.junit.Test; + +import static org.junit.Assert.*; + +public class CardTest { + + Card card = new Card(Suit.CLUBS, Value.ACE); + + @Test + public void testGetName() throws Exception { + assertEquals(Value.ACE.toString() + " of " + Suit.CLUBS.toString(), card.getName()); + } + + @Test + public void testGetShortName() throws Exception { + assertEquals("" + Value.ACE.getValue() + Suit.CLUBS.getRepresentation(), card.getShortName()); + } + + @Test + public void testGetValue() throws Exception { + assertEquals(Value.ACE, card.getValue()); + } + + @Test + public void testGetSuit() throws Exception { + assertEquals(Suit.CLUBS, card.getSuit()); + } +} \ No newline at end of file