summaryrefslogtreecommitdiffstats
path: root/test/jrummikub/control
diff options
context:
space:
mode:
Diffstat (limited to 'test/jrummikub/control')
-rw-r--r--test/jrummikub/control/SettingsControlTest.java51
1 files changed, 36 insertions, 15 deletions
diff --git a/test/jrummikub/control/SettingsControlTest.java b/test/jrummikub/control/SettingsControlTest.java
index 8fab97a..ff870d0 100644
--- a/test/jrummikub/control/SettingsControlTest.java
+++ b/test/jrummikub/control/SettingsControlTest.java
@@ -37,7 +37,8 @@ public class SettingsControlTest {
/** */
@Test
public void initialStateTest() {
- assertSame(ISettingsPanel.SettingsError.NO_ERROR, view.settingsPanel.error);
+ assertSame(ISettingsPanel.SettingsError.NO_ERROR,
+ view.settingsPanel.error);
view.settingsPanel.startGameEvent.emit();
assertNotNull(gameSettings);
assertEquals(2, gameSettings.getPlayerList().size());
@@ -156,7 +157,8 @@ public class SettingsControlTest {
view.settingsPanel.changePlayerNameEvent.emit(1, name2);
assertTrue(view.settingsPanel.startButtonEnabled);
- assertSame(ISettingsPanel.SettingsError.NO_ERROR, view.settingsPanel.error);
+ assertSame(ISettingsPanel.SettingsError.NO_ERROR,
+ view.settingsPanel.error);
view.settingsPanel.startGameEvent.emit();
assertNotNull(gameSettings);
@@ -175,38 +177,57 @@ public class SettingsControlTest {
view.settingsPanel.startGameEvent.emit();
assertNull(gameSettings);
}
-
+
/** */
@Test
public void initialMeldThresholdTest() {
- assertEquals(initialSettings.getInitialMeldThreshold(), view.settingsPanel.initialMeldThreshold);
-
+ assertEquals(initialSettings.getInitialMeldThreshold(),
+ view.settingsPanel.initialMeldThreshold);
+
view.settingsPanel.changeInitialMeldThresholdEvent.emit(25);
view.settingsPanel.startGameEvent.emit();
assertEquals(25, gameSettings.getInitialMeldThreshold());
}
-
+
/** */
@Test
public void jokerNumberTest() {
- assertEquals(initialSettings.getJokerNumber(), view.settingsPanel.jokerNumber);
-
+ assertEquals(initialSettings.getJokerNumber(),
+ view.settingsPanel.jokerNumber);
+
view.settingsPanel.changeJokerNumberEvent.emit(25);
view.settingsPanel.startGameEvent.emit();
assertEquals(25, gameSettings.getJokerNumber());
}
-
+
+ /** */
+ @Test
+ public void changeStoneSetNumberTest() {
+ assertEquals(initialSettings.getStoneSetNumber(),
+ view.settingsPanel.stoneSetNumber);
+
+ view.settingsPanel.changeStoneSetNumberEvent.emit(3);
+ view.settingsPanel.startGameEvent.emit();
+ assertEquals(3, gameSettings.getStoneSetNumber());
+
+ }
+
/** */
@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.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());
+ assertSame(TurnControlFactory.Type.COMPUTER, gameSettings
+ .getPlayerList().get(0).getTurnControlType());
+ assertSame(TurnControlFactory.Type.HUMAN, gameSettings.getPlayerList()
+ .get(1).getTurnControlType());
}
-
+
}