summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mock/jrummikub/view/MockView.java4
-rw-r--r--test/jrummikub/control/ApplicationControlTest.java11
2 files changed, 14 insertions, 1 deletions
diff --git a/mock/jrummikub/view/MockView.java b/mock/jrummikub/view/MockView.java
index a78aefe..50aa1b0 100644
--- a/mock/jrummikub/view/MockView.java
+++ b/mock/jrummikub/view/MockView.java
@@ -67,6 +67,8 @@ public class MockView implements IView {
/** */
public MockEvent quitEvent = new MockEvent();
/** */
+ public MockEvent endProgramEvent = new MockEvent();
+ /** */
public MockEvent newRoundEvent = new MockEvent();
/** */
public MockEvent newGameEvent = new MockEvent();
@@ -133,7 +135,7 @@ public class MockView implements IView {
@Override
public IEvent getEndProgramEvent() {
- return quitEvent;
+ return endProgramEvent;
}
@Override
diff --git a/test/jrummikub/control/ApplicationControlTest.java b/test/jrummikub/control/ApplicationControlTest.java
index 84b8527..c052650 100644
--- a/test/jrummikub/control/ApplicationControlTest.java
+++ b/test/jrummikub/control/ApplicationControlTest.java
@@ -49,6 +49,17 @@ public class ApplicationControlTest {
/** */
@Test
+ public void quitWarningTest() {
+ testAppControl = new ApplicationControl(view);
+ testAppControl.startApplication();
+ view.settingsPanel.startGameEvent.emit();
+ view.quitEvent.emit();
+ assertSame(QuitMode.QUIT_PROCESS, view.quitWarningPanel.quitMode);
+ assertTrue(view.isQuitWarningPanelVisible);
+ }
+
+ /** */
+ @Test
public void networkTest() {
testAppControl = new ApplicationControl(view);
testAppControl.startApplication();