Index: Core/Common/test/Core.Common.Gui.Test/Forms/MainWindow/MainWindowTest.cs =================================================================== diff -u -rc063a97260cc4d630a453c359d49fca96ed8ac80 -rf68adbcdb4f68112cef38ea87b644781b5ac2153 --- Core/Common/test/Core.Common.Gui.Test/Forms/MainWindow/MainWindowTest.cs (.../MainWindowTest.cs) (revision c063a97260cc4d630a453c359d49fca96ed8ac80) +++ Core/Common/test/Core.Common.Gui.Test/Forms/MainWindow/MainWindowTest.cs (.../MainWindowTest.cs) (revision f68adbcdb4f68112cef38ea87b644781b5ac2153) @@ -36,6 +36,7 @@ using Core.Common.Gui.Plugin; using Core.Common.Gui.PropertyBag; using Core.Common.Gui.Settings; +using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; @@ -445,28 +446,12 @@ var projectMigrator = mocks.Stub(); var projectFactory = mocks.Stub(); projectFactory.Stub(pf => pf.CreateNewProject()).Return(mocks.Stub()); - - var plugin = mocks.Stub(); - plugin.Stub(p => p.Deactivate()); - plugin.Stub(p => p.Dispose()); - plugin.Expect(p => p.Activate()); - plugin.Expect(p => p.GetViewInfos()).Return(Enumerable.Empty()); - plugin.Expect(p => p.GetPropertyInfos()).Return(Enumerable.Empty()); - plugin.Stub(p => p.GetTreeNodeInfos()).Return(new TreeNodeInfo[] - { - new TreeNodeInfo() - }); mocks.ReplayAll(); using (var mainWindow = new Gui.Forms.MainWindow.MainWindow()) - using (var gui = new GuiCore(mainWindow, projectStore, projectMigrator, projectFactory, new GuiCoreSettings()) + using (var gui = new GuiCore(mainWindow, projectStore, projectMigrator, projectFactory, new GuiCoreSettings())) { - Plugins = - { - plugin - } - }) - { + gui.Plugins.Add(new TestPlugin()); gui.Run(); mainWindow.SetGui(gui); @@ -495,28 +480,12 @@ var projectMigrator = mocks.Stub(); var projectFactory = mocks.Stub(); projectFactory.Stub(pf => pf.CreateNewProject()).Return(mocks.Stub()); - - var plugin = mocks.Stub(); - plugin.Stub(p => p.Deactivate()); - plugin.Stub(p => p.Dispose()); - plugin.Expect(p => p.Activate()); - plugin.Expect(p => p.GetViewInfos()).Return(Enumerable.Empty()); - plugin.Expect(p => p.GetPropertyInfos()).Return(Enumerable.Empty()); - plugin.Stub(p => p.GetTreeNodeInfos()).Return(new TreeNodeInfo[] - { - new TreeNodeInfo() - }); mocks.ReplayAll(); using (var mainWindow = new Gui.Forms.MainWindow.MainWindow()) - using (var gui = new GuiCore(mainWindow, projectStore, projectMigrator, projectFactory, new GuiCoreSettings()) + using (var gui = new GuiCore(mainWindow, projectStore, projectMigrator, projectFactory, new GuiCoreSettings())) { - Plugins = - { - plugin - } - }) - { + gui.Plugins.Add(new TestPlugin()); gui.Run(); mainWindow.SetGui(gui); @@ -545,28 +514,12 @@ var projectMigrator = mocks.Stub(); var projectFactory = mocks.Stub(); projectFactory.Stub(pf => pf.CreateNewProject()).Return(mocks.Stub()); - - var plugin = mocks.Stub(); - plugin.Stub(p => p.Deactivate()); - plugin.Stub(p => p.Dispose()); - plugin.Expect(p => p.Activate()); - plugin.Expect(p => p.GetViewInfos()).Return(Enumerable.Empty()); - plugin.Expect(p => p.GetPropertyInfos()).Return(Enumerable.Empty()); - plugin.Stub(p => p.GetTreeNodeInfos()).Return(new TreeNodeInfo[] - { - new TreeNodeInfo() - }); mocks.ReplayAll(); using (var mainWindow = new Gui.Forms.MainWindow.MainWindow()) - using (var gui = new GuiCore(mainWindow, projectStore, projectMigrator, projectFactory, new GuiCoreSettings()) + using (var gui = new GuiCore(mainWindow, projectStore, projectMigrator, projectFactory, new GuiCoreSettings())) { - Plugins = - { - plugin - } - }) - { + gui.Plugins.Add(new TestPlugin()); gui.Run(); mainWindow.SetGui(gui); @@ -598,29 +551,12 @@ var projectMigrator = mocks.Stub(); var projectFactory = mocks.Stub(); projectFactory.Stub(pf => pf.CreateNewProject()).Return(project1); - - var plugin = mocks.Stub(); - plugin.Stub(p => p.Deactivate()); - plugin.Stub(p => p.Dispose()); - plugin.Expect(p => p.Activate()); - plugin.Expect(p => p.GetViewInfos()).Return(Enumerable.Empty()); - plugin.Expect(p => p.GetPropertyInfos()).Return(Enumerable.Empty()); - plugin.Expect(p => p.GetChildDataWithViewDefinitions(null)).IgnoreArguments().Return(Enumerable.Empty()); - plugin.Stub(p => p.GetTreeNodeInfos()).Return(new TreeNodeInfo[] - { - new TreeNodeInfo() - }); mocks.ReplayAll(); using (var mainWindow = new Gui.Forms.MainWindow.MainWindow()) - using (var gui = new GuiCore(mainWindow, projectStore, projectMigrator, projectFactory, new GuiCoreSettings()) + using (var gui = new GuiCore(mainWindow, projectStore, projectMigrator, projectFactory, new GuiCoreSettings())) { - Plugins = - { - plugin - } - }) - { + gui.Plugins.Add(new TestPlugin()); gui.Run(); mainWindow.SetGui(gui); Index: Core/Common/test/Core.Common.Integration.Test/Riskeer/Application.Riskeer/GuiCoreIntegrationTest.cs =================================================================== diff -u -r761d4c23b5c98c87caa9a94d14b41074c862c425 -rf68adbcdb4f68112cef38ea87b644781b5ac2153 --- Core/Common/test/Core.Common.Integration.Test/Riskeer/Application.Riskeer/GuiCoreIntegrationTest.cs (.../GuiCoreIntegrationTest.cs) (revision 761d4c23b5c98c87caa9a94d14b41074c862c425) +++ Core/Common/test/Core.Common.Integration.Test/Riskeer/Application.Riskeer/GuiCoreIntegrationTest.cs (.../GuiCoreIntegrationTest.cs) (revision f68adbcdb4f68112cef38ea87b644781b5ac2153) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.Threading; using System.Windows.Controls; using System.Windows.Threading; @@ -53,26 +52,6 @@ [Test] [Apartment(ApartmentState.STA)] - public void Run_GuiWithRiskeerPlugin_DoesNotCrash() - { - var mocks = new MockRepository(); - var projectStore = mocks.Stub(); - var projectMigrator = mocks.Stub(); - var projectFactory = mocks.Stub(); - projectFactory.Stub(pf => pf.CreateNewProject()).Return(new RiskeerProject()); - mocks.ReplayAll(); - - using (var gui = new GuiCore(new MainWindow(), projectStore, projectMigrator, projectFactory, new GuiCoreSettings())) - { - gui.Plugins.Add(new RiskeerPlugin()); - gui.Run(); - } - - mocks.VerifyAll(); - } - - [Test] - [Apartment(ApartmentState.STA)] public void Run_StartWithCommonPlugins_RunsFasterThanThreshold() { // Setup