diff options
Diffstat (limited to 'test/jrummikub')
-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()); + } + } |