Index: Core/Plugins/test/Core.Plugins.Chart.Test/ChartPluginTest.cs =================================================================== diff -u -r4f023f921130657163dbbad9b13e765e6d37cbb5 -re17a7164604a5325b47c5d2fddbe2d667a444bb9 --- Core/Plugins/test/Core.Plugins.Chart.Test/ChartPluginTest.cs (.../ChartPluginTest.cs) (revision 4f023f921130657163dbbad9b13e765e6d37cbb5) +++ Core/Plugins/test/Core.Plugins.Chart.Test/ChartPluginTest.cs (.../ChartPluginTest.cs) (revision e17a7164604a5325b47c5d2fddbe2d667a444bb9) @@ -113,44 +113,6 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - [Apartment(ApartmentState.STA)] - public void GivenConfiguredGui_WhenActiveDocumentViewChangesToViewWithChart_ThenRibbonSetVisibility(bool visible) - { - // Given - var mocks = new MockRepository(); - var projectStore = mocks.Stub(); - var projectMigrator = mocks.Stub(); - var projectFactory = mocks.Stub(); - projectFactory.Stub(pf => pf.CreateNewProject()).Return(mocks.Stub()); - mocks.ReplayAll(); - - using (var gui = new GuiCore(new MainWindow(), projectStore, projectMigrator, projectFactory, new GuiCoreSettings())) - { - var plugin = new ChartPlugin(); - var testChartView = new TestChartView(); - var chart = new ChartControl(); - IView view = visible ? (IView) testChartView : new TestView(); - - testChartView.Data = chart; - - gui.Plugins.Add(plugin); - plugin.Gui = gui; - gui.Run(); - - // When - gui.ViewHost.AddDocumentView(view); - - // Then - Assert.AreEqual(visible ? Visibility.Visible : Visibility.Collapsed, plugin.RibbonCommandHandler.GetRibbonControl().ContextualGroups[0].Visibility); - mocks.VerifyAll(); - } - - Dispatcher.CurrentDispatcher.InvokeShutdown(); - } - - [Test] public void GetPropertyInfos_ReturnsSupportedPropertyInfos() { // Setup @@ -193,5 +155,46 @@ typeof(ChartPointDataProperties)); } } + + [Test] + [TestCase(true)] + [TestCase(false)] + [Apartment(ApartmentState.STA)] + public void GivenConfiguredGui_WhenActiveDocumentViewChangesToViewWithChart_ThenRibbonSetVisibility(bool visible) + { + // Given + var mocks = new MockRepository(); + var projectStore = mocks.Stub(); + var projectMigrator = mocks.Stub(); + var projectFactory = mocks.Stub(); + projectFactory.Stub(pf => pf.CreateNewProject()).Return(mocks.Stub()); + mocks.ReplayAll(); + + using (var gui = new GuiCore(new MainWindow(), projectStore, projectMigrator, projectFactory, new GuiCoreSettings())) + { + var plugin = new ChartPlugin + { + Gui = gui + }; + + gui.Plugins.Add(plugin); + gui.Run(); + + var testChartView = new TestChartView + { + Data = new ChartControl() + }; + IView view = visible ? (IView) testChartView : new TestView(); + + // When + gui.ViewHost.AddDocumentView(view); + + // Then + Assert.AreEqual(visible ? Visibility.Visible : Visibility.Collapsed, plugin.RibbonCommandHandler.GetRibbonControl().ContextualGroups[0].Visibility); + } + + Dispatcher.CurrentDispatcher.InvokeShutdown(); + mocks.VerifyAll(); + } } } \ No newline at end of file Index: Core/Plugins/test/Core.Plugins.Map.Test/MapPluginTest.cs =================================================================== diff -u -rb2b948b3cfebe14dbd1f46ae3a690682f47721a9 -re17a7164604a5325b47c5d2fddbe2d667a444bb9 --- Core/Plugins/test/Core.Plugins.Map.Test/MapPluginTest.cs (.../MapPluginTest.cs) (revision b2b948b3cfebe14dbd1f46ae3a690682f47721a9) +++ Core/Plugins/test/Core.Plugins.Map.Test/MapPluginTest.cs (.../MapPluginTest.cs) (revision e17a7164604a5325b47c5d2fddbe2d667a444bb9) @@ -197,10 +197,10 @@ // Then Assert.AreEqual(visible ? Visibility.Visible : Visibility.Collapsed, plugin.RibbonCommandHandler.GetRibbonControl().ContextualGroups[0].Visibility); - mocks.VerifyAll(); } Dispatcher.CurrentDispatcher.InvokeShutdown(); + mocks.VerifyAll(); } [Test] @@ -235,10 +235,10 @@ // Then Assert.AreNotEqual(initialExtents, map.ViewExtents); - mocks.VerifyAll(); } Dispatcher.CurrentDispatcher.InvokeShutdown(); + mocks.VerifyAll(); } [Test] @@ -278,11 +278,10 @@ // Then Assert.AreSame(view.Map, GetMapControl(mapLegendView)); Assert.AreSame(view.Map, GetMapControl(mapRibbon)); - - mocks.VerifyAll(); } Dispatcher.CurrentDispatcher.InvokeShutdown(); + mocks.VerifyAll(); } [Test] @@ -326,11 +325,10 @@ // Then Assert.AreSame(view1.Map, GetMapControl(mapLegendView)); Assert.AreSame(view1.Map, GetMapControl(mapRibbon)); - - mocks.VerifyAll(); } Dispatcher.CurrentDispatcher.InvokeShutdown(); + mocks.VerifyAll(); } [Test] @@ -372,11 +370,10 @@ // Then Assert.IsNull(GetMapControl(mapLegendView)); Assert.IsNull(GetMapControl(mapRibbon)); - - mocks.VerifyAll(); } Dispatcher.CurrentDispatcher.InvokeShutdown(); + mocks.VerifyAll(); } [Test] @@ -420,11 +417,10 @@ // Then Assert.AreSame(view2.Map, GetMapControl(mapLegendView)); Assert.AreSame(view2.Map, GetMapControl(mapRibbon)); - - mocks.VerifyAll(); } Dispatcher.CurrentDispatcher.InvokeShutdown(); + mocks.VerifyAll(); } private static IMapControl GetMapControl(MapRibbon mapRibbon)