From f5f53cb55140fdc873e3f53ebe9e0ae625b2b4f6 Mon Sep 17 00:00:00 2001 From: Bennet Gerlach Date: Mon, 9 May 2011 23:28:52 +0200 Subject: Added wrap tests on hand git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@201 72836036-5685-4462-b002-a69064685172 --- test/jrummikub/model/HandTest.java | 28 ++++++++++++++++++++++++++-- 1 file 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)); } } -- cgit v1.2.3