diff options
author | Bennet Gerlach <bennet_gerlach@web.de> | 2011-05-09 23:28:52 +0200 |
---|---|---|
committer | Bennet Gerlach <bennet_gerlach@web.de> | 2011-05-09 23:28:52 +0200 |
commit | f5f53cb55140fdc873e3f53ebe9e0ae625b2b4f6 (patch) | |
tree | f218b58087ca3c514331fb3c3c47d219cc5b5932 /test/jrummikub | |
parent | 9b307f18448e999610db82b00250f1e7d319a45c (diff) | |
download | JRummikub-f5f53cb55140fdc873e3f53ebe9e0ae625b2b4f6.tar JRummikub-f5f53cb55140fdc873e3f53ebe9e0ae625b2b4f6.zip |
Added wrap tests on hand
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@201 72836036-5685-4462-b002-a69064685172
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));
}
}
|