diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-03 17:13:11 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-03 17:13:11 +0200 |
commit | 2b09ff6ec52037f73060849b6627a8cda53e7ea0 (patch) | |
tree | 9d8fde5509946c7f51ad45c79df7348ea583172d /test/jrummikub/model | |
parent | 42a8b91c4da3f98312ce444cca157b7d9b8e729f (diff) | |
download | JRummikub-2b09ff6ec52037f73060849b6627a8cda53e7ea0.tar JRummikub-2b09ff6ec52037f73060849b6627a8cda53e7ea0.zip |
pickUp(object) in StoneTray implementiert und getestet
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@78 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test/jrummikub/model')
-rw-r--r-- | test/jrummikub/model/StoneTrayTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/jrummikub/model/StoneTrayTest.java b/test/jrummikub/model/StoneTrayTest.java index 6c1c170..23d9ea0 100644 --- a/test/jrummikub/model/StoneTrayTest.java +++ b/test/jrummikub/model/StoneTrayTest.java @@ -131,6 +131,7 @@ public class StoneTrayTest { assertEquals(1, thirdPosition.getY(), 0.00001); } + @Test public void testWrongPickUp() { Thing firstThing = new Thing(5, 5); @@ -138,6 +139,18 @@ public class StoneTrayTest { Position testPosition = new Position(-2, -2); assertNull(testTray.pickUp(testPosition)); } + + @Test + public void testPickUpByObject() { + Thing firstThing = new Thing(5,5); + testTray.drop(firstThing, new Position(0, 0)); + Thing secondThing = new Thing(5,5); + testTray.drop(secondThing, new Position(5, 0)); + testTray.pickUp(firstThing); + for (Pair<Thing, Position> i : testTray) { + assertSame(i.getFirst(), secondThing); + } + } @Test public void testRightPickUp() { |