diff options
Diffstat (limited to 'test/jrummikub/model')
-rw-r--r-- | test/jrummikub/model/StoneTrayTest.java | 25 |
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); |