summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBennet Gerlach <bennet_gerlach@web.de>2011-05-04 16:45:09 +0200
committerBennet Gerlach <bennet_gerlach@web.de>2011-05-04 16:45:09 +0200
commit4870017d27c5ed9357e4807ce83a80609b13e14b (patch)
tree0c740e859a1f00317c968983ed5e29b2035b0ff2
parentc9843770ddee02dca46c6ba5d81cc84da32d06d4 (diff)
downloadJRummikub-4870017d27c5ed9357e4807ce83a80609b13e14b.tar
JRummikub-4870017d27c5ed9357e4807ce83a80609b13e14b.zip
Fix StoneTrayTest
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@105 72836036-5685-4462-b002-a69064685172
-rw-r--r--test/jrummikub/model/StoneTrayTest.java25
1 files changed, 11 insertions, 14 deletions
diff --git a/test/jrummikub/model/StoneTrayTest.java b/test/jrummikub/model/StoneTrayTest.java
index 7ae711c..1c8b241 100644
--- a/test/jrummikub/model/StoneTrayTest.java
+++ b/test/jrummikub/model/StoneTrayTest.java
@@ -49,10 +49,10 @@ public class StoneTrayTest {
assertEquals(42, secondPosition.getX(), 0.00001);
assertEquals(8.5, secondPosition.getY(), 0.00001);
}
-
+
@Test
public void testDropNull() {
- testTray.drop(null, new Position(0,0));
+ testTray.drop(null, new Position(0, 0));
assertFalse(testTray.iterator().hasNext());
}
@@ -115,15 +115,15 @@ 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);
@@ -137,7 +137,6 @@ public class StoneTrayTest {
assertEquals(1, thirdPosition.getY(), 0.00001);
}
-
@Test
public void testWrongPickUp() {
Thing firstThing = new Thing(5, 5);
@@ -145,12 +144,12 @@ public class StoneTrayTest {
Position testPosition = new Position(-2, -2);
assertNull(testTray.pickUp(testPosition));
}
-
+
@Test
public void testPickUpByObject() {
- Thing firstThing = new Thing(5,5);
+ Thing firstThing = new Thing(5, 5);
testTray.drop(firstThing, new Position(0, 0));
- Thing secondThing = new Thing(5,5);
+ Thing secondThing = new Thing(5, 5);
testTray.drop(secondThing, new Position(5, 0));
testTray.pickUp(firstThing);
for (Pair<Thing, Position> i : testTray) {
@@ -169,7 +168,6 @@ public class StoneTrayTest {
assertSame(testTray.pickUp(testPosition), firstThing);
assertNull(testTray.pickUp(testPosition));
}
-
@Test
public void testIterate() {
@@ -192,22 +190,21 @@ public class StoneTrayTest {
assertTrue(testThings.isEmpty());
assertTrue(testPositions.isEmpty());
}
-
+
@Test
public void testClone() {
Thing firstThing = new Thing(5, 5);
testTray.drop(firstThing, new Position(0, 0));
Thing secondThing = new Thing(3, 3);
testTray.drop(secondThing, new Position(-5, -5));
- StoneTray<Thing> trayCopy = testTray.clone();
-
+ IStoneTray<Thing> trayCopy = testTray.clone();
testTray.pickUp(firstThing);
for (Pair<Thing, Position> i : testTray) {
assertSame(i.getFirst(), secondThing);
}
assertTrue(testTray.iterator().hasNext());
-
+
trayCopy.pickUp(secondThing);
for (Pair<Thing, Position> i : trayCopy) {
assertSame(i.getFirst(), firstThing);