From f3f52956f711658f42ef753b7ff46728da67aa54 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Sun, 29 May 2011 22:24:48 +0200 Subject: Tested and implemented player type selection in the settings panel git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@317 72836036-5685-4462-b002-a69064685172 --- test/jrummikub/control/SettingsControlTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'test/jrummikub') diff --git a/test/jrummikub/control/SettingsControlTest.java b/test/jrummikub/control/SettingsControlTest.java index fef6b28..65c4c29 100644 --- a/test/jrummikub/control/SettingsControlTest.java +++ b/test/jrummikub/control/SettingsControlTest.java @@ -4,6 +4,7 @@ import static org.junit.Assert.*; import java.awt.Color; +import jrummikub.control.turn.TurnControlFactory; import jrummikub.model.GameSettings; import jrummikub.util.IListener1; import jrummikub.view.ISettingsPanel; @@ -194,5 +195,18 @@ public class SettingsControlTest { view.settingsPanel.startGameEvent.emit(); assertEquals(25, gameSettings.getJokerNumber()); } - + + /** */ + @Test + public void typeChangeTest() { + view.settingsPanel.changePlayerTypeEvent.emit(0, TurnControlFactory.Type.COMPUTER); + view.settingsPanel.changePlayerTypeEvent.emit(1, TurnControlFactory.Type.COMPUTER); + view.settingsPanel.changePlayerTypeEvent.emit(1, TurnControlFactory.Type.HUMAN); + view.settingsPanel.startGameEvent.emit(); + assertNotNull(gameSettings); + assertEquals(2, gameSettings.getPlayerList().size()); + assertSame(TurnControlFactory.Type.COMPUTER, gameSettings.getPlayerList().get(0).getTurnControlType()); + assertSame(TurnControlFactory.Type.HUMAN, gameSettings.getPlayerList().get(1).getTurnControlType()); + } + } -- cgit v1.2.3