summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/jrummikub/control/network/GameOfferControlTest.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/jrummikub/control/network/GameOfferControlTest.java b/test/jrummikub/control/network/GameOfferControlTest.java
index 105c435..57e68ac 100644
--- a/test/jrummikub/control/network/GameOfferControlTest.java
+++ b/test/jrummikub/control/network/GameOfferControlTest.java
@@ -53,10 +53,31 @@ public class GameOfferControlTest {
assertEquals(SettingsMode.NETWORK_OFFER,
view.settingsPanel.settingsMode);
view.settingsPanel.changePlayerColorEvent.emit(0, Color.PINK);
- assertEquals(Color.PINK, mockConnection.playerColor);
+ assertEquals(Color.PINK, mockConnection.playerColor);
view.settingsPanel.backEvent.emit();
assertFalse(view.isSettingsPanelVisible);
assertTrue(view.isGameListPanelVisible);
}
+
+ /** */
+ @Test
+ public void getJoinLeaveTest(){
+ view.gameListPanel.openNewGameEvent.emit();
+ view.settingsPanel.offerGameEvent.emit();
+
+ mockConnection.gameJoinEvent.emit("Berta");
+
+ assertEquals("Berta", mockConnection.offeredGame.getGameSettings().getPlayerList().get(1).getName());
+ assertSame(Type.NETWORK, mockConnection.offeredGame.getGameSettings().getPlayerList().get(1).getType());
+
+ mockConnection.changeColorEvent.emit("Berta", Color.BLUE);
+
+ assertEquals(Color.BLUE, mockConnection.offeredGame.getGameSettings().getPlayerList().get(1).getColor());
+
+ mockConnection.gameLeaveEvent.emit("Berta");
+
+ assertEquals("Offen", mockConnection.offeredGame.getGameSettings().getPlayerList().get(1).getName());
+ assertSame(Type.VACANT, mockConnection.offeredGame.getGameSettings().getPlayerList().get(1).getType());
+ }
}