From b9fbe279c3d6e750f7c90ad0b244d315c9744bb2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 9 May 2011 00:33:31 +0200 Subject: Another fix for the Table pickUpStone method git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@179 72836036-5685-4462-b002-a69064685172 --- test/jrummikub/model/TableTest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test/jrummikub/model') diff --git a/test/jrummikub/model/TableTest.java b/test/jrummikub/model/TableTest.java index e113ba7..a806e14 100644 --- a/test/jrummikub/model/TableTest.java +++ b/test/jrummikub/model/TableTest.java @@ -67,12 +67,23 @@ public class TableTest { } @Test - public void testPickNonexistentStone() { + public void testPickStoneFromEmptyTable() { Stone targetStone = new Stone(BLACK); testTable.pickUpStone(targetStone); assertEquals(0, testTable.getSize()); } + @Test + public void testPickNonexistentStone() { + Stone targetStone = new Stone(BLACK); + Stone droppedStone = new Stone(RED); + StoneSet set = new StoneSet(droppedStone); + testTable.drop(set, new Position(0, 0)); + testTable.pickUpStone(targetStone); + assertEquals(1, testTable.getSize()); + assertSame(testTable.findStoneSet(droppedStone), set); + } + @Test @SuppressWarnings("unused") public void testPickUpStoneRun() { -- cgit v1.2.3