@Before public void setUp() { rulesSelector = new MockRulesSelector(); DsmViewFactory dsmViewFactory = new DsmViewFactoryImpl(); fileInputSelector = new MockFileInputSelector(); windowManager = new MockWindowManager(); aboutInfoDisplayer = new MockAboutInfoDisplayer(); fileSelector = new MockFileSelector(); dialogManager = new MockDialogManager(); arguments = new Arguments(); origInput = Arrays.asList("path1", "path2"); arguments.setInput(origInput); arguments.setConfigFileName("original.properties"); dependencyEngine = new MockDependencyEngine(); dependencyEngineFactory = new DependencyEngineFactory(dependencyEngine); new MainViewFactoryImpl( dsmViewFactory, fileInputSelector, rulesSelector, fileSelector, windowManager, aboutInfoDisplayer, dialogManager, dependencyEngineFactory) .openMainView(arguments); view = new MainViewDriver(windowManager.getLastShownView()); }
@Test public void changedConfigurationUponExit() throws URISyntaxException { /*! If the current configuration contains changes since the last time it has been saved, you will be asked whether to save those changes or not before exiting the gui. */ makeConfiguarationDirty(); dialogManager.setNextResult(DialogResult.cancel); view.menuBar.getMenu("File").getSubMenu("Exit").click(); assertNotNull(windowManager.getLastShownView()); dialogManager.setNextResult(DialogResult.no); view.menuBar.getMenu("File").getSubMenu("Exit").click(); assertNull(windowManager.getLastShownView()); }