aboutsummaryrefslogtreecommitdiffstats
path: root/test/eu/equalparts/cardbase
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2016-06-05 21:06:09 +0200
committerEduardo Pedroni <e.pedroni91@gmail.com>2016-06-05 21:06:09 +0200
commit500fa2144514e7cb23a3072aae9c96acb4424f84 (patch)
tree1d41a16fb9517d2a360ddcd0f7bb181477ce1933 /test/eu/equalparts/cardbase
parenta9c2129f36f468852f7f8d5325ab9b681aa4e6b7 (diff)
Implemented deck class, now need to think a bit about the interface before continuing
Diffstat (limited to 'test/eu/equalparts/cardbase')
-rw-r--r--test/eu/equalparts/cardbase/CardbaseTest.java8
-rw-r--r--test/eu/equalparts/cardbase/decks/ReferenceDeckTest.java45
2 files changed, 53 insertions, 0 deletions
diff --git a/test/eu/equalparts/cardbase/CardbaseTest.java b/test/eu/equalparts/cardbase/CardbaseTest.java
index 47ad027..832880a 100644
--- a/test/eu/equalparts/cardbase/CardbaseTest.java
+++ b/test/eu/equalparts/cardbase/CardbaseTest.java
@@ -181,4 +181,12 @@ public class CardbaseTest {
exception.expect(NullPointerException.class);
uut = Cardbase.load(null);
}
+
+ /***********************************************************************************
+ * Deck tests
+ ***********************************************************************************/
+ @Test
+ public void test() throws Exception {
+
+ }
}
diff --git a/test/eu/equalparts/cardbase/decks/ReferenceDeckTest.java b/test/eu/equalparts/cardbase/decks/ReferenceDeckTest.java
new file mode 100644
index 0000000..928c167
--- /dev/null
+++ b/test/eu/equalparts/cardbase/decks/ReferenceDeckTest.java
@@ -0,0 +1,45 @@
+package eu.equalparts.cardbase.decks;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import eu.equalparts.cardbase.cardstorage.ReferenceCardContainer;
+
+public class ReferenceDeckTest {
+ private ReferenceDeck uut;
+
+ @Before
+ public void setUp() throws Exception {
+ uut = new ReferenceDeck();
+ }
+
+ /***********************************************************************************
+ * Typing
+ ***********************************************************************************/
+ @Test
+ public void deckIsReferenceCardContainer() throws Exception {
+ assertTrue("Deck should be instance of ReferenceCardContainer.", uut instanceof ReferenceCardContainer);
+ }
+
+ /***********************************************************************************
+ * Name tests
+ ***********************************************************************************/
+ @Test
+ public void deckHasName() throws Exception {
+ assertEquals("Deck should not have a name to begin with.", "", uut.getName());
+
+ uut.setName("Test Name");
+
+ assertEquals("Wrong name.", "Test Name", uut.getName());
+ }
+
+ @Test
+ public void deckNameInConstructor() throws Exception {
+ uut = new ReferenceDeck("Another Test");
+
+ assertEquals("Deck should have a name to begin with.", "Another Test", uut.getName());
+ }
+}