diff options
Diffstat (limited to 'test/jrummikub/model/TableTest.java')
-rw-r--r-- | test/jrummikub/model/TableTest.java | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/test/jrummikub/model/TableTest.java b/test/jrummikub/model/TableTest.java index a806e14..0d53aed 100644 --- a/test/jrummikub/model/TableTest.java +++ b/test/jrummikub/model/TableTest.java @@ -12,22 +12,28 @@ import java.util.Arrays; import org.junit.Before; import org.junit.Test; +/** + * Tests for {@link Table} + */ public class TableTest { Table testTable; + /** */ @Before public void setup() { testTable = new Table(); } + /** */ @Test public void testIsValid() { testTable.drop( - new StoneSet(Arrays.asList(new Stone(RED), new Stone(BLACK), new Stone( - 1, BLACK))), new Position(0, 0)); + new StoneSet(Arrays.asList(new Stone(RED), new Stone(BLACK), + new Stone(1, BLACK))), new Position(0, 0)); testTable.drop( - new StoneSet(Arrays.asList(new Stone(1, RED), new Stone(2, RED), - new Stone(3, RED))), new Position(0, 0)); + new StoneSet(Arrays.asList(new Stone(1, RED), + new Stone(2, RED), new Stone(3, RED))), new Position(0, + 0)); assertTrue(testTable.isValid()); testTable.drop(new StoneSet(Arrays.asList(new Stone(5, RED))), @@ -35,18 +41,20 @@ public class TableTest { assertFalse(testTable.isValid()); } + /** */ @Test public void testEmptyIsValid() { assertTrue(testTable.isValid()); } + /** */ @Test @SuppressWarnings("unused") public void testPickUpStoneGroup() { Stone targetStone = new Stone(BLACK); testTable.drop( - new StoneSet(Arrays.asList(new Stone(RED), targetStone, new Stone(1, - BLACK))), new Position(0, 0)); + new StoneSet(Arrays.asList(new Stone(RED), targetStone, + new Stone(1, BLACK))), new Position(0, 0)); assertTrue(testTable.isValid()); testTable.pickUpStone(targetStone); assertFalse(testTable.isValid()); @@ -58,6 +66,7 @@ public class TableTest { assertEquals(1, counter); } + /** */ @Test public void testPickLonelyStone() { Stone targetStone = new Stone(BLACK); @@ -66,6 +75,7 @@ public class TableTest { assertEquals(0, testTable.getSize()); } + /** */ @Test public void testPickStoneFromEmptyTable() { Stone targetStone = new Stone(BLACK); @@ -73,6 +83,7 @@ public class TableTest { assertEquals(0, testTable.getSize()); } + /** */ @Test public void testPickNonexistentStone() { Stone targetStone = new Stone(BLACK); @@ -84,13 +95,14 @@ public class TableTest { assertSame(testTable.findStoneSet(droppedStone), set); } + /** */ @Test @SuppressWarnings("unused") public void testPickUpStoneRun() { Stone targetStone = new Stone(BLACK); testTable.drop( - new StoneSet(Arrays.asList(new Stone(1, RED), targetStone, new Stone(3, - RED))), new Position(0, 0)); + new StoneSet(Arrays.asList(new Stone(1, RED), targetStone, + new Stone(3, RED))), new Position(0, 0)); assertTrue(testTable.isValid()); testTable.pickUpStone(targetStone); assertFalse(testTable.isValid()); @@ -102,6 +114,7 @@ public class TableTest { assertEquals(2, counter); } + /** */ @Test public void testFindSet() { Stone targetStone = new Stone(BLACK); |