diff options
author | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-05-31 00:58:49 +0200 |
---|---|---|
committer | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-05-31 00:58:49 +0200 |
commit | 489e7858e796a15ec1268de320525ba23bd75f5a (patch) | |
tree | b84d2e2b60593a78a9be2e4d730495de622236a0 /test/jrummikub | |
parent | 0cb36fb752120a3b052a3f25acdd075ed8f80560 (diff) | |
download | JRummikub-489e7858e796a15ec1268de320525ba23bd75f5a.tar JRummikub-489e7858e796a15ec1268de320525ba23bd75f5a.zip |
Test für mehr Steine geben
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@334 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test/jrummikub')
-rw-r--r-- | test/jrummikub/control/RoundControlTest.java | 33 |
1 files 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(); |