diff options
Diffstat (limited to 'test/jrummikub')
-rw-r--r-- | test/jrummikub/model/HandTest.java | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/test/jrummikub/model/HandTest.java b/test/jrummikub/model/HandTest.java index ec619d2..b855edd 100644 --- a/test/jrummikub/model/HandTest.java +++ b/test/jrummikub/model/HandTest.java @@ -74,10 +74,34 @@ public class HandTest { Stone stone1 = new Stone(2, BLUE);
Stone stone2 = new Stone(4, BLUE);
- hand.drop(stone1, new Position(12.75f, 0));
+ hand.drop(stone1, new Position(12.75f, 1));
+ hand.drop(stone2, new Position(12.5f, 1));
+
+ assertEquals(new Position(13, 1), hand.getPosition(stone1));
+ assertEquals(new Position(12, 1), hand.getPosition(stone2));
+ }
+
+ @Test
+ public void testRightWrapDrop() {
+ Stone stone1 = new Stone(12, ORANGE);
+ Stone stone2 = new Stone(13, ORANGE);
+
+ hand.drop(stone1, new Position(13, 0));
hand.drop(stone2, new Position(12.5f, 0));
+ assertEquals(new Position(12.5f, 0), hand.getPosition(stone1));
+ assertEquals(new Position(0, 1), hand.getPosition(stone2));
+ }
+
+ @Test
+ public void testLeftWrapDrop() {
+ Stone stone1 = new Stone(1, ORANGE);
+ Stone stone2 = new Stone(2, ORANGE);
+
+ hand.drop(stone1, new Position(0, 1));
+ hand.drop(stone2, new Position(0.25f, 1));
+
assertEquals(new Position(13, 0), hand.getPosition(stone1));
- assertEquals(new Position(12, 0), hand.getPosition(stone2));
+ assertEquals(new Position(0.25f, 1), hand.getPosition(stone2));
}
}
|