diff options
author | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-06-19 12:34:13 +0200 |
---|---|---|
committer | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-06-19 12:34:13 +0200 |
commit | 0506b7f154a816d591f580466a294e1b6820774b (patch) | |
tree | 1dc2033c7571094a12c970ebed2c3d6e61776b12 /test | |
parent | f0c5aa509293ec56b73b304f46921fd3994ead83 (diff) | |
download | JRummikub-0506b7f154a816d591f580466a294e1b6820774b.tar JRummikub-0506b7f154a816d591f580466a294e1b6820774b.zip |
Tests fürs Netzwerk fertig und laufen
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@482 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test')
-rw-r--r-- | test/jrummikub/control/network/GameOfferControlTest.java | 23 |
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()); + } } |