From 489e7858e796a15ec1268de320525ba23bd75f5a Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Tue, 31 May 2011 00:58:49 +0200 Subject: =?UTF-8?q?Test=20f=C3=BCr=20mehr=20Steine=20geben?= 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@334 72836036-5685-4462-b002-a69064685172 --- test/jrummikub/control/RoundControlTest.java | 33 +++++++++++++++++++--------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java index f5afeea..1ec91ca 100644 --- a/test/jrummikub/control/RoundControlTest.java +++ b/test/jrummikub/control/RoundControlTest.java @@ -78,13 +78,19 @@ public class RoundControlTest { roundControl = new RoundControl(roundState, view); } - private void checkCorrectlyDealed() { - assertEquals(106 - testRoundState.getPlayerCount() * 14 - - testRoundState.table.getSize(), testRoundState.getGameHeap() - .getSize()); + private void checkCorrectlyDealt() { + int totalStones = gameSettings.getHighestCard() + * gameSettings.getStoneSetNumber() + * gameSettings.getStoneColors().size() + + gameSettings.getJokerNumber(); + assertEquals( + totalStones - testRoundState.getPlayerCount() + * gameSettings.getNumberOfStonesDealt() + - testRoundState.table.getSize(), testRoundState + .getGameHeap().getSize()); for (int i = 0; i < testRoundState.getPlayerCount(); i++) { - assertEquals(14, testRoundState.getNthNextPlayer(i).getHand() - .getSize()); + assertEquals(gameSettings.getNumberOfStonesDealt(), testRoundState + .getNthNextPlayer(i).getHand().getSize()); } } @@ -116,6 +122,13 @@ public class RoundControlTest { view.displayStartTurnPanel = false; } + @Test + public void checkCorrectlyDealtMoreStones() { + gameSettings.setNumberOfStonesDealt(15); + roundControl.startRound(); + checkCorrectlyDealt(); + } + // laidOut test cases /** Threshold=30 */ @Test @@ -482,7 +495,7 @@ public class RoundControlTest { @Test public void testDealStones() { testRound.deal(); - checkCorrectlyDealed(); + checkCorrectlyDealt(); for (int i = 0; i < 14; i++) { testRound.dealStones(2); } @@ -494,14 +507,14 @@ public class RoundControlTest { @Test public void testDeal() { testRound.deal(); - checkCorrectlyDealed(); + checkCorrectlyDealt(); } /** */ @Test public void testStartRound() { testRound.startRound(); - checkCorrectlyDealed(); + checkCorrectlyDealt(); checkTurnStartSetUp(); } @@ -510,7 +523,7 @@ public class RoundControlTest { @Test public void testTableDisplay() { testRound.startRound(); - checkCorrectlyDealed(); + checkCorrectlyDealt(); view.startTurnEvent.emit(); checkTableDisplay(); view.getPlayerPanel().endTurnEvent.emit(); -- cgit v1.2.3