diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-10 03:54:48 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-10 03:54:48 +0200 |
commit | 3b49b2053e9f9d26b73db0ffc8380a60706ee095 (patch) | |
tree | 9678d5abb4af070bbf0fd89c684e91f5fd472c31 /test/jrummikub/model/StoneSetTest.java | |
parent | 4a860e53cf6f2f97f18785673399498609e6504b (diff) | |
download | JRummikub-3b49b2053e9f9d26b73db0ffc8380a60706ee095.tar JRummikub-3b49b2053e9f9d26b73db0ffc8380a60706ee095.zip |
Added all missing comments
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@213 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test/jrummikub/model/StoneSetTest.java')
-rw-r--r-- | test/jrummikub/model/StoneSetTest.java | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/test/jrummikub/model/StoneSetTest.java b/test/jrummikub/model/StoneSetTest.java index b98d3d8..2575f22 100644 --- a/test/jrummikub/model/StoneSetTest.java +++ b/test/jrummikub/model/StoneSetTest.java @@ -11,21 +11,25 @@ import static jrummikub.model.StoneSet.Type.*; import org.junit.*; import static org.junit.Assert.*; +/** + * Tests for {@link StoneSet} + */ public class StoneSetTest { - // Is Valid-Test - // valid - public void assertSet(StoneSet.Type expectedType, List<Stone> stones) { + private void assertSet(StoneSet.Type expectedType, List<Stone> stones) { StoneSet set = new StoneSet(stones); assertSame(expectedType, set.classify()); } + // valid + /** */ @Test public void doubleJoker() { assertSet(GROUP, Arrays.asList(new Stone(RED), new Stone(BLACK), new Stone(1, BLACK))); } + /** */ @Test public void groups() { assertSet(GROUP, Arrays.asList(new Stone(1, RED), new Stone(1, BLACK), @@ -34,6 +38,7 @@ public class StoneSetTest { new Stone(1, BLUE), new Stone(1, ORANGE))); } + /** */ @Test public void runs() { assertSet(RUN, @@ -42,6 +47,7 @@ public class StoneSetTest { new Stone(6, BLUE))); } + /** */ @Test public void singleJoker() { assertSet(GROUP, @@ -51,17 +57,18 @@ public class StoneSetTest { } // invalid - + /** */ @Test public void outOfBounds() { - assertSet(INVALID, - Arrays.asList(new Stone(RED), new Stone(1, RED), new Stone(2, RED))); - assertSet(INVALID, - Arrays.asList(new Stone(12, RED), new Stone(13, RED), new Stone(RED))); + assertSet(INVALID, Arrays.asList(new Stone(RED), new Stone(1, RED), + new Stone(2, RED))); + assertSet(INVALID, Arrays.asList(new Stone(12, RED), + new Stone(13, RED), new Stone(RED))); assertSet(INVALID, Arrays.asList(new Stone(RED), new Stone(BLACK), new Stone(1, RED), new Stone(2, RED))); } + /** */ @Test public void sameColor() { assertSet(INVALID, @@ -70,6 +77,7 @@ public class StoneSetTest { new Stone(1, BLACK), new Stone(1, ORANGE), new Stone(RED))); } + /** */ @Test public void incorrectOrder() { assertSet(INVALID, @@ -80,6 +88,7 @@ public class StoneSetTest { Arrays.asList(new Stone(4, RED), new Stone(RED), new Stone(5, RED))); } + /** */ @Test public void otherInvalid() { @@ -91,11 +100,12 @@ public class StoneSetTest { assertSet(INVALID, Arrays.asList(new Stone(4, BLUE), new Stone(5, RED), new Stone(6, RED))); // Regression test: - assertSet(INVALID, Arrays.asList(new Stone(12, ORANGE), - new Stone(12, BLACK), new Stone(7, BLUE))); + assertSet(INVALID, Arrays.asList(new Stone(12, ORANGE), new Stone(12, + BLACK), new Stone(7, BLUE))); } // invalid Split + /** */ @Test public void testSplitInvalidLow() { StoneSet testSet = createTestSet(); @@ -103,6 +113,7 @@ public class StoneSetTest { } + /** */ @Test public void testSplitInvalidHigh() { StoneSet testSet = createTestSet(); @@ -110,6 +121,7 @@ public class StoneSetTest { } // valid Split + /** */ @Test public void testSplitValid() { StoneSet testSet = createTestSet(); @@ -133,6 +145,7 @@ public class StoneSetTest { } // join + /** */ @Test public void testJoin() { StoneSet testSet = createTestSet(); @@ -148,6 +161,7 @@ public class StoneSetTest { } // iterator + /** */ @Test public void testIterator() { StoneSet testSet = createTestSet(); |