From f7743efa7ddf473a9ee24bfe7b69e0ccccdeacd5 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Fri, 27 May 2011 17:54:42 +0200 Subject: Test redealing in RoundControl git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@286 72836036-5685-4462-b002-a69064685172 --- test/jrummikub/control/RoundControlTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/jrummikub') diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java index bc8dce9..68ae825 100644 --- a/test/jrummikub/control/RoundControlTest.java +++ b/test/jrummikub/control/RoundControlTest.java @@ -25,6 +25,7 @@ import jrummikub.model.Score; import jrummikub.model.Stone; import jrummikub.model.StoneSet; import jrummikub.model.Table; +import jrummikub.util.IListener; import jrummikub.util.IListener1; import jrummikub.util.Pair; import jrummikub.view.MockView; @@ -47,6 +48,7 @@ public class RoundControlTest { private boolean roundEnded; private Score roundScore; + protected boolean roundRestarted; /** * For each test create a round control initialized by a mock model and view @@ -888,4 +890,19 @@ public class RoundControlTest { assertFalse(14 == testRoundState.players.get(i).hand.getSize()); } } + + /** */ + @Test + public void testRedeal() { + testRound.getRestartRoundEvent().add(new IListener() { + @Override + public void handle() { + roundRestarted = true; + } + }); + testRound.startRound(); + view.startTurnEvent.emit(); + view.playerPanel.redealEvent.emit(); + assertTrue(roundRestarted); + } } -- cgit v1.2.3