summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/jrummikub/model/TableTest.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/jrummikub/model/TableTest.java b/test/jrummikub/model/TableTest.java
index 44605e2..e113ba7 100644
--- a/test/jrummikub/model/TableTest.java
+++ b/test/jrummikub/model/TableTest.java
@@ -23,12 +23,11 @@ public class TableTest {
@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))),
@@ -46,8 +45,8 @@ public class TableTest {
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());
@@ -68,12 +67,19 @@ public class TableTest {
}
@Test
+ public void testPickNonexistentStone() {
+ Stone targetStone = new Stone(BLACK);
+ testTable.pickUpStone(targetStone);
+ assertEquals(0, testTable.getSize());
+ }
+
+ @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());