Added wrap tests on hand

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@201 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Bennet Gerlach 2011-05-09 23:28:52 +02:00
parent 9b307f1844
commit f5f53cb551

View file

@ -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));
}
}