From 4870017d27c5ed9357e4807ce83a80609b13e14b Mon Sep 17 00:00:00 2001 From: Bennet Gerlach Date: Wed, 4 May 2011 16:45:09 +0200 Subject: Fix StoneTrayTest git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@105 72836036-5685-4462-b002-a69064685172 --- test/jrummikub/model/StoneTrayTest.java | 25 +++++++++++-------------- 1 file 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 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 trayCopy = testTray.clone(); - + IStoneTray trayCopy = testTray.clone(); testTray.pickUp(firstThing); for (Pair i : testTray) { assertSame(i.getFirst(), secondThing); } assertTrue(testTray.iterator().hasNext()); - + trayCopy.pickUp(secondThing); for (Pair i : trayCopy) { assertSame(i.getFirst(), firstThing); -- cgit v1.2.3