Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs =================================================================== diff -u -r0d7895f07d2c1b15457ffdc8e8762780a5837030 -readc46f479face9b66568438765d85c3a2b892cf --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs (.../OxyPlotGuiPluginTest.cs) (revision 0d7895f07d2c1b15457ffdc8e8762780a5837030) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs (.../OxyPlotGuiPluginTest.cs) (revision eadc46f479face9b66568438765d85c3a2b892cf) @@ -8,7 +8,9 @@ using Core.Common.Gui.Forms.MainWindow; using Core.Common.Gui.Forms.ViewManager; using Core.Common.Gui.Plugin; +using Core.Components.Charting; using Core.Components.Charting.Data; +using Core.Components.Charting.TestUtil; using Core.Components.OxyPlot.Forms; using Core.Plugins.OxyPlot.Forms; using Core.Plugins.OxyPlot.Legend; @@ -49,19 +51,37 @@ [Test] [RequiresSTA] - public void Activate_WithGui_InitializesComponentsAndBindsActiveViewChanged() + [TestCase(true)] + [TestCase(false)] + public void Activate_WithGui_InitializesComponentsWithIChartViewDataAndBindsActiveViewChanged(bool useChartView) { // Setup var mocks = new MockRepository(); + IView view; + if (useChartView) + { + var chartView = mocks.Stub(); + var chart = mocks.Stub(); + chart.Data = new TestChartData(); + chartView.Stub(v => v.Chart).Return(chart); + view = chartView; + } + else + { + view = mocks.StrictMock(); + } + using (var plugin = new OxyPlotGuiPlugin()) { var gui = mocks.StrictMock(); - gui.Expect(g => g.IsToolWindowOpen()).Return(false); + gui.Stub(g => g.IsToolWindowOpen()).Return(false); + gui.Expect(g => g.OpenToolView(Arg.Matches(c => true))); gui.Expect(g => g.ActiveViewChanged += null).IgnoreArguments(); gui.Expect(g => g.ActiveViewChanged -= null).IgnoreArguments(); + gui.Expect(g => g.ActiveView).Return(view); mocks.ReplayAll();