From 050ae5f2247ef073ad92b5ad084a4e3816f35da9 Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Mon, 9 May 2011 20:54:17 +0200 Subject: =?UTF-8?q?Angefangener=20Test=20f=C3=BCr=20Hand-Steine-verschwind?= =?UTF-8?q?en-fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@194 72836036-5685-4462-b002-a69064685172 --- test/jrummikub/control/RoundControlTest.java | 30 ++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'test/jrummikub') diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java index 38060c0..f183505 100644 --- a/test/jrummikub/control/RoundControlTest.java +++ b/test/jrummikub/control/RoundControlTest.java @@ -49,7 +49,8 @@ public class RoundControlTest { - testGameState.table.getSize(), testGameState.getGameHeap() .getSize()); for (int i = 0; i < testGameState.getPlayerCount(); i++) { - assertEquals(14, testGameState.getNthNextPlayer(i).getHand().getSize()); + assertEquals(14, testGameState.getNthNextPlayer(i).getHand() + .getSize()); } } @@ -67,8 +68,8 @@ public class RoundControlTest { private void checkTableDisplay() { Iterator> stoneSetsView = view.tablePanel.stoneSets .iterator(); - Iterator> stoneSetsModel = testGameState.table.clone().sets - .iterator(); + Iterator> stoneSetsModel = testGameState.table + .clone().sets.iterator(); while (stoneSetsView.hasNext()) { assertTrue(stoneSetsModel.hasNext()); @@ -85,6 +86,17 @@ public class RoundControlTest { view.displayStartTurnPanel = false; } + // TODO hier weitermachen + @Test + public void testDealStone() { + testRound.deal(); + checkCorrectlyDealed(); + for (int i = 0; i < 28 - 14; i++) { + testRound.dealStone(); + } + assertEquals(28, testGameState.getActivePlayer().getHand().getSize()); + } + @Test public void testDeal() { testRound.deal(); @@ -136,7 +148,8 @@ public class RoundControlTest { view.startTurnEvent.emit(); assertFalse(view.displayStartTurnPanel); - Stone stone = testGameState.players.get(0).hand.stones.remove(0).getFirst(); + Stone stone = testGameState.players.get(0).hand.stones.remove(0) + .getFirst(); newTable.drop(new StoneSet(stone), new Position(0, 0)); resetTurnStart(); view.getPlayerPanel().endTurnEvent.emit(); @@ -194,7 +207,8 @@ public class RoundControlTest { view.startTurnEvent.emit(); assertFalse(view.displayStartTurnPanel); - Stone stone = testGameState.players.get(0).hand.stones.remove(0).getFirst(); + Stone stone = testGameState.players.get(0).hand.stones.remove(0) + .getFirst(); newTable.drop(new StoneSet(stone), new Position(0, 0)); testGameState.players.get(0).hand.stones.clear(); resetTurnStart(); @@ -224,13 +238,13 @@ public class RoundControlTest { blueThree)); newTable.drop(newSet1, new Position(0, 0)); newTable.drop(newSet2, new Position(0, 0)); - + Set expectedStones = new HashSet(); expectedStones.add(blueThree); expectedStones.add(blueFour); - + Set stones = RoundControl.tableDifference(oldTable, newTable); - + assertTrue(expectedStones.containsAll(stones)); assertTrue(stones.containsAll(expectedStones)); } -- cgit v1.2.3