diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/jrummikub/control/RoundControlTest.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java index b170581..9e3948c 100644 --- a/test/jrummikub/control/RoundControlTest.java +++ b/test/jrummikub/control/RoundControlTest.java @@ -21,6 +21,7 @@ import java.util.Set; import jrummikub.model.GameSettings; import jrummikub.model.Hand; import jrummikub.model.IHand; +import jrummikub.model.IPlayer; import jrummikub.model.ITable; import jrummikub.model.MockRoundState; import jrummikub.model.MockTable; @@ -679,4 +680,24 @@ public class RoundControlTest { assertTrue(vanishedSets.isEmpty()); assertEquals(1, newSets.size()); } + + @Test + public void heapIsEmpty() { + roundState.getGameHeap().drawStones(106 - 14 * 4 - 1); + + roundControl.startRound(); + + IPlayer player1 = roundState.getActivePlayer(); + + view.startTurnEvent.emit(); + view.playerPanel.endTurnEvent.emit(); // player 1 draws a card here + + assertSame(player1, roundState.getActivePlayer()); + + for (int i = 0; i < 4; i++) { + view.startTurnEvent.emit(); + view.playerPanel.endTurnEvent.emit(); + } + assertTrue(view.displayWinPanel); + } } |