diff options
-rw-r--r-- | test/jrummikub/control/network/NetworkRoundControlTest.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/jrummikub/control/network/NetworkRoundControlTest.java b/test/jrummikub/control/network/NetworkRoundControlTest.java index b388998..82f4dc7 100644 --- a/test/jrummikub/control/network/NetworkRoundControlTest.java +++ b/test/jrummikub/control/network/NetworkRoundControlTest.java @@ -38,15 +38,18 @@ public class NetworkRoundControlTest { gameSettings.getPlayerList().add(new PlayerSettings("Jannis", Color.GREEN)); gameSettings.getPlayerList().add(new PlayerSettings("Bennet", Color.BLACK)); + gameSettings.getPlayerList().get(1).setType(Type.COMPUTER); + gameSettings.getPlayerList().get(2).setType(Type.NETWORK); + gameSettings.getPlayerList().get(3).setType(Type.COMPUTER); + view = new MockView(); connectionControl = new MockConnectionControl(); } @Test public void testHostRound() { - gameSettings.getPlayerList().get(1).setType(Type.COMPUTER); - gameSettings.getPlayerList().get(2).setType(Type.NETWORK); - gameSettings.getPlayerList().get(3).setType(Type.COMPUTER); + connectionControl.nickname = gameSettings.getPlayerList().get(0).getName(); + testRoundState = new RoundState(gameSettings, null); testRound = new NetworkRoundControl(testRoundState, view, connectionControl, true); @@ -119,9 +122,8 @@ public class NetworkRoundControlTest { @Test public void testClientRound() { - gameSettings.getPlayerList().get(0).setType(Type.NETWORK); - gameSettings.getPlayerList().get(1).setType(Type.COMPUTER); - gameSettings.getPlayerList().get(3).setType(Type.COMPUTER); + connectionControl.nickname = gameSettings.getPlayerList().get(2).getName(); + testRoundState = new RoundState(gameSettings, null); for (int i = 0; i < 4; ++i) { IPlayer player = testRoundState.getNthPlayer(i); |