From f1ecdcbe59cfaaad647cb5a6c50ceb39c9496c8d Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Mon, 4 Jul 2011 22:26:29 +0200 Subject: More network tests git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@604 72836036-5685-4462-b002-a69064685172 --- .../control/network/NetworkRoundControlTest.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'test/jrummikub/control/network/NetworkRoundControlTest.java') diff --git a/test/jrummikub/control/network/NetworkRoundControlTest.java b/test/jrummikub/control/network/NetworkRoundControlTest.java index be5952e..56647ac 100644 --- a/test/jrummikub/control/network/NetworkRoundControlTest.java +++ b/test/jrummikub/control/network/NetworkRoundControlTest.java @@ -221,4 +221,35 @@ public class NetworkRoundControlTest { connectionControl.turnStartEvent.emit(); assertFalse(connectionControl.turnEnded); } + + @Test + public void testRedeal() { + gameSettings.getPlayerList().get(1).setType(Type.COMPUTER); + gameSettings.getPlayerList().get(2).setType(Type.NETWORK); + gameSettings.getPlayerList().get(3).setType(Type.COMPUTER); + + testRoundState = new RoundState(gameSettings, new GameState()); + for (int i = 0; i < 4; ++i) { + IPlayer player = testRoundState.getNthPlayer(i); + + for (int j = 0; j < 6; j++) { + player.getHand().drop(new Stone(1, StoneColor.RED), new Position(0, 0)); + } + } + testRound = new NetworkRoundControl(null, view, connectionControl, true); + + connectionControl.turnStarted = false; + connectionControl.turnEnded = false; + + testRound.startRound(); + + connectionControl.roundStateUpdateEvent.emit(testRoundState); + + + connectionControl.turnStartEvent.emit(); + + view.playerPanel.redealEvent.emit(); + + assertTrue(connectionControl.redealCalled); + } } -- cgit v1.2.3