diff options
-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(); |