summaryrefslogtreecommitdiffstats
path: root/test/jrummikub
diff options
context:
space:
mode:
Diffstat (limited to 'test/jrummikub')
-rw-r--r--test/jrummikub/model/StoneTrayTest.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/jrummikub/model/StoneTrayTest.java b/test/jrummikub/model/StoneTrayTest.java
index 57f3d1a..6c1c170 100644
--- a/test/jrummikub/model/StoneTrayTest.java
+++ b/test/jrummikub/model/StoneTrayTest.java
@@ -109,6 +109,27 @@ public class StoneTrayTest {
assertEquals(1, secondPosition.getX(), 0.00001);
assertEquals(-2, secondPosition.getY(), 0.00001);
}
+
+ @Test
+ public void testDoubleShift() {
+ Thing firstThing = new Thing(5, 5);
+ testTray.drop(firstThing, new Position(0, 0));
+
+ Thing secondThing = new Thing(5, 0.1f);
+ testTray.drop(secondThing, new Position(5, 0));
+
+ Thing thirdThing = new Thing(3, 3);
+ testTray.drop(thirdThing, new Position(-2, 1));
+ Position firstPosition = testTray.getPosition(firstThing);
+ Position secondPosition = testTray.getPosition(secondThing);
+ Position thirdPosition = testTray.getPosition(thirdThing);
+ assertEquals(1, firstPosition.getX(), 0.00001);
+ assertEquals(0, firstPosition.getY(), 0.00001);
+ assertEquals(6, secondPosition.getX(), 0.00001);
+ assertEquals(0, secondPosition.getY(), 0.00001);
+ assertEquals(-2, thirdPosition.getX(), 0.00001);
+ assertEquals(1, thirdPosition.getY(), 0.00001);
+ }
@Test
public void testWrongPickUp() {
@@ -128,6 +149,7 @@ public class StoneTrayTest {
assertSame(testTray.pickUp(testPosition), firstThing);
assertNull(testTray.pickUp(testPosition));
}
+
@Test
public void testIterate() {