diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-29 22:24:48 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-29 22:24:48 +0200 |
commit | f3f52956f711658f42ef753b7ff46728da67aa54 (patch) | |
tree | e6229af2028d46a9ac524a613754e0473de899ff /test | |
parent | d9b651828aedbd9eb80f534842356d5200c644ee (diff) | |
download | JRummikub-f3f52956f711658f42ef753b7ff46728da67aa54.tar JRummikub-f3f52956f711658f42ef753b7ff46728da67aa54.zip |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/jrummikub/control/SettingsControlTest.java | 16 |
1 files changed, 15 insertions, 1 deletions
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()); + } + } |