summaryrefslogtreecommitdiffstats
path: root/test/jrummikub/control/network/NetworkRoundControlTest.java
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-07-04 22:26:29 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-07-04 22:26:29 +0200
commitf1ecdcbe59cfaaad647cb5a6c50ceb39c9496c8d (patch)
tree8ed56faebc6194bb92c620916bed8c19dc15a521 /test/jrummikub/control/network/NetworkRoundControlTest.java
parentce6cc738adb3c923b3e993adf5c338327df6ecf2 (diff)
downloadJRummikub-f1ecdcbe59cfaaad647cb5a6c50ceb39c9496c8d.tar
JRummikub-f1ecdcbe59cfaaad647cb5a6c50ceb39c9496c8d.zip
More network tests
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@604 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test/jrummikub/control/network/NetworkRoundControlTest.java')
-rw-r--r--test/jrummikub/control/network/NetworkRoundControlTest.java31
1 files changed, 31 insertions, 0 deletions
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);
+ }
}