From 0506b7f154a816d591f580466a294e1b6820774b Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Sun, 19 Jun 2011 12:34:13 +0200 Subject: =?UTF-8?q?Tests=20f=C3=BCrs=20Netzwerk=20fertig=20und=20laufen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@482 72836036-5685-4462-b002-a69064685172 --- .../control/network/GameOfferControlTest.java | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'test/jrummikub') 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()); + } } -- cgit v1.2.3