Index: Application/Application.Ringtoets/App.xaml.cs =================================================================== diff -u -reee6c7815d1e418eac38c1c552fb279c0887ef55 -rb7740a20087463e213caab7a0a6d8d33bdf3f3ef --- Application/Application.Ringtoets/App.xaml.cs (.../App.xaml.cs) (revision eee6c7815d1e418eac38c1c552fb279c0887ef55) +++ Application/Application.Ringtoets/App.xaml.cs (.../App.xaml.cs) (revision b7740a20087463e213caab7a0a6d8d33bdf3f3ef) @@ -159,9 +159,7 @@ Resources.Add(SystemParameters.MenuPopupAnimationKey, PopupAnimation.None); ParseArguments(e.Args); - - - + gui = new DeltaShellGui { Plugins = Index: Core/Common/src/Core.Common.Gui/DeltaShellGui.cs =================================================================== diff -u -r98b397912e4e949b1f518a8a830d8a35ac464968 -rb7740a20087463e213caab7a0a6d8d33bdf3f3ef --- Core/Common/src/Core.Common.Gui/DeltaShellGui.cs (.../DeltaShellGui.cs) (revision 98b397912e4e949b1f518a8a830d8a35ac464968) +++ Core/Common/src/Core.Common.Gui/DeltaShellGui.cs (.../DeltaShellGui.cs) (revision b7740a20087463e213caab7a0a6d8d33bdf3f3ef) @@ -36,7 +36,6 @@ public class DeltaShellGui : IGui, IDisposable { public event EventHandler SelectionChanged; // TODO: make it weak - public event Action AfterRun; private static readonly ILog log = LogManager.GetLogger(typeof(DeltaShellGui)); private static DeltaShellGui instance; @@ -264,11 +263,6 @@ runFinished = true; - if (AfterRun != null) - { - AfterRun(); - } - HideSplashScreen(); MessageWindowLogAppender.Enabled = true; Index: Core/Common/src/Core.Common.Gui/IGui.cs =================================================================== diff -u -r61e853bb6755b4a963136cae0e79904cb4da7357 -rb7740a20087463e213caab7a0a6d8d33bdf3f3ef --- Core/Common/src/Core.Common.Gui/IGui.cs (.../IGui.cs) (revision 61e853bb6755b4a963136cae0e79904cb4da7357) +++ Core/Common/src/Core.Common.Gui/IGui.cs (.../IGui.cs) (revision b7740a20087463e213caab7a0a6d8d33bdf3f3ef) @@ -112,11 +112,6 @@ #region Events /// - /// Fired after application has been started. - /// - event Action AfterRun; - - /// /// Fired when user changes selection by clicking on it or by setting it using Selection property. /// event EventHandler SelectionChanged; Index: Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Application.Ringtoets/DeltaShellGuiIntegrationTest.cs =================================================================== diff -u -r7038b2c6fe78bcd3dfe636087fe4d4421fabea0d -rb7740a20087463e213caab7a0a6d8d33bdf3f3ef --- Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Application.Ringtoets/DeltaShellGuiIntegrationTest.cs (.../DeltaShellGuiIntegrationTest.cs) (revision 7038b2c6fe78bcd3dfe636087fe4d4421fabea0d) +++ Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Application.Ringtoets/DeltaShellGuiIntegrationTest.cs (.../DeltaShellGuiIntegrationTest.cs) (revision b7740a20087463e213caab7a0a6d8d33bdf3f3ef) @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Threading; using Core.Common.Base.Workflow; using Core.Common.Gui; @@ -9,9 +10,7 @@ using Core.Plugins.ProjectExplorer; using Core.Plugins.SharpMapGis; using Core.Plugins.SharpMapGis.Gui; -using log4net; using NUnit.Framework; -using Rhino.Mocks; using SharpTestsEx; using Control = System.Windows.Controls.Control; @@ -20,9 +19,6 @@ [TestFixture] public class DeltaShellGuiIntegrationTest { - private readonly MockRepository mocks = new MockRepository(); - private static readonly ILog log = LogManager.GetLogger(typeof(DeltaShellGuiIntegrationTest)); - [SetUp] public void SetUp() { @@ -210,45 +206,23 @@ } } - private class TestActivity2 : Activity + [Test] + public void SelectingProjectNodeSetsSelectedItemToProject() { - private bool shouldCancel; - - public override void Execute() + using (var gui = new DeltaShellGui()) { - if (shouldCancel) - { - Status = ActivityStatus.Cancelled; - shouldCancel = false; - return; - } + var app = gui.Application; - base.Execute(); - } + gui.Plugins.Add(new ProjectExplorerGuiPlugin()); + gui.Run(); - public override void Cancel() - { - shouldCancel = true; - } + var projectExplorer = gui.ToolWindowViews.OfType().First(); - protected override void OnInitialize() {} + var treeView = projectExplorer.TreeView; + treeView.SelectedNode = treeView.Nodes[0]; // project node - protected override void OnExecute() - { - Thread.Sleep(100); + gui.Selection.Should().Be.EqualTo(app.Project); } - - protected override void OnCancel() - { - throw new NotImplementedException(); - } - - protected override void OnCleanUp() - { - shouldCancel = false; - } - - protected override void OnFinish() {} } private class TestActivity : Activity Index: Core/Common/test/Core.Common.Tests/Gui/DelftShellGuiTests.cs =================================================================== diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -rb7740a20087463e213caab7a0a6d8d33bdf3f3ef --- Core/Common/test/Core.Common.Tests/Gui/DelftShellGuiTests.cs (.../DelftShellGuiTests.cs) (revision a950714ad9510756331d862aa35695fa0b2ed03b) +++ Core/Common/test/Core.Common.Tests/Gui/DelftShellGuiTests.cs (.../DelftShellGuiTests.cs) (revision b7740a20087463e213caab7a0a6d8d33bdf3f3ef) @@ -1,4 +1,3 @@ -using Application.Ringtoets; using Core.Common.Gui; using Core.Common.Tests.TestObjects; using Core.Common.TestUtils; @@ -13,10 +12,23 @@ { private DeltaShellGui gui; + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + LogHelper.ConfigureLogging(); + } + + [TestFixtureTearDown] + public void TestFixtureTearDown() + { + LogHelper.ResetLogging(); + } + [SetUp] public void SetUp() { LogHelper.SetLoggingLevel(Level.Error); + gui = new DeltaShellGui(); } @@ -44,27 +56,5 @@ { ViewPropertyEditor.Gui.Should().Not.Be.Null(); } - - [Test] - public void FireEventAfterRun() - { - var callCount = 0; - gui.AfterRun += () => callCount++; - gui.Run(); - - callCount.Should("AfterRun event is fired after gui starts").Be.EqualTo(1); - } - - [TestFixtureSetUp] - public void TestFixtureSetUp() - { - LogHelper.ConfigureLogging(); - } - - [TestFixtureTearDown] - public void TestFixtureTearDown() - { - LogHelper.ResetLogging(); - } } } \ No newline at end of file Index: Core/Plugins/test/Core.Plugins.ProjectExplorer.Tests/ProjectTreeViewTest.cs =================================================================== diff -u -r2a90c0c1be6114f72af65c42f0a6f334b30e4755 -rb7740a20087463e213caab7a0a6d8d33bdf3f3ef --- Core/Plugins/test/Core.Plugins.ProjectExplorer.Tests/ProjectTreeViewTest.cs (.../ProjectTreeViewTest.cs) (revision 2a90c0c1be6114f72af65c42f0a6f334b30e4755) +++ Core/Plugins/test/Core.Plugins.ProjectExplorer.Tests/ProjectTreeViewTest.cs (.../ProjectTreeViewTest.cs) (revision b7740a20087463e213caab7a0a6d8d33bdf3f3ef) @@ -1,14 +1,9 @@ using System.Configuration; -using System.Linq; -using Application.Ringtoets; using Core.Common.Base; using Core.Common.Gui; using NUnit.Framework; using Rhino.Mocks; -using SharpTestsEx; -// note: this is a reference to a builded assembly! not the project itself - namespace Core.Plugins.ProjectExplorer.Tests { [TestFixture] @@ -42,22 +37,5 @@ var projectTreeView = new ProjectTreeView(pluginGui); Assert.IsNotNull(projectTreeView); } - - [Test] - public void SelectingProjectNodeSetsSelectedItemToProject() - { - var gui = new DeltaShellGui(); - var app = gui.Application; - - gui.Plugins.Add(new ProjectExplorerGuiPlugin()); - gui.Run(); - - var projectExplorer = gui.ToolWindowViews.OfType().First(); - - var treeView = projectExplorer.TreeView; - treeView.SelectedNode = treeView.Nodes[0]; // project node - - gui.Selection.Should().Be.EqualTo(app.Project); - } } } \ No newline at end of file Index: Core/Plugins/test/Core.Plugins.SharpMapGis.Tests/SharpMapGisPluginGuiIntegrationTest.cs =================================================================== diff -u -reee6c7815d1e418eac38c1c552fb279c0887ef55 -rb7740a20087463e213caab7a0a6d8d33bdf3f3ef --- Core/Plugins/test/Core.Plugins.SharpMapGis.Tests/SharpMapGisPluginGuiIntegrationTest.cs (.../SharpMapGisPluginGuiIntegrationTest.cs) (revision eee6c7815d1e418eac38c1c552fb279c0887ef55) +++ Core/Plugins/test/Core.Plugins.SharpMapGis.Tests/SharpMapGisPluginGuiIntegrationTest.cs (.../SharpMapGisPluginGuiIntegrationTest.cs) (revision b7740a20087463e213caab7a0a6d8d33bdf3f3ef) @@ -19,22 +19,6 @@ public class SharpMapGisPluginGuiIntegrationTest { [Test] - public void EmptyMapIsReturnedIfNoMapDefaultMapDataItemIsSet() - { - using (var gui = new DeltaShellGui()) - { - var application = gui.Application; - gui.Application.Plugins.Add(new SharpMapGisApplicationPlugin()); - gui.Run(); - - application.CreateNewProject(); - - // Assert statements are here for clearness and it should be the same as - // the null check test in the property SharpMapGisGuiPlugin.DefaultMap - } - } - - [Test] public void SelectMultipleFeaturesUpdatesAllMaps() { using (var gui = new DeltaShellGui())