Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs =================================================================== diff -u -rddad7117cf82255493a1a9f80b2c6562dc88bfd2 -re4a511949b59953fb0fd941474aa4423ab615bdf --- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision ddad7117cf82255493a1a9f80b2c6562dc88bfd2) +++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision e4a511949b59953fb0fd941474aa4423ab615bdf) @@ -723,7 +723,6 @@ TreeViewControl treeViewControl) { StructuresCalculationScenario calculation = context.WrappedData; - var changeHandler = new ClearIllustrationPointsOfStructuresCalculationHandler(calculation, GetInquiryHelper()); IInquiryHelper inquiryHelper = GetInquiryHelper(); IViewCommands viewCommands = Gui.ViewCommands; @@ -755,7 +754,10 @@ { calculation }, inquiryHelper, viewCommands)) - .AddClearIllustrationPointsOfCalculationItem(() => IllustrationPointsHelper.HasIllustrationPoints(calculation), changeHandler) + .AddClearIllustrationPointsOfCalculationItem( + () => IllustrationPointsHelper.HasIllustrationPoints(calculation), + new ClearIllustrationPointsOfStructuresCalculationHandler( + calculation, inquiryHelper, viewCommands)) .AddDeleteItem() .AddSeparator() .AddCollapseAllItem() Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r4231613a2fe8a95de3ad758ba284a8f9a3d5f55f -re4a511949b59953fb0fd941474aa4423ab615bdf --- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationScenarioContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationScenarioContextTreeNodeInfoTest.cs) (revision 4231613a2fe8a95de3ad758ba284a8f9a3d5f55f) +++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationScenarioContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationScenarioContextTreeNodeInfoTest.cs) (revision e4a511949b59953fb0fd941474aa4423ab615bdf) @@ -1345,7 +1345,7 @@ { gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mocks.Stub()); - gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); + gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) @@ -1361,7 +1361,7 @@ } [Test] - public void GivenCalculationWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndIllustrationPointsCleared() + public void GivenCalculationWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndOutputViewClosedAndIllustrationPointsCleared() { // Given IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(mocks); @@ -1390,9 +1390,12 @@ using (var treeViewControl = new TreeViewControl()) { + var viewCommands = mocks.StrictMock(); + viewCommands.Expect(vc => vc.RemoveAllViewsForItem(calculation.Output.GeneralResult)); + gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mocks.Stub()); - gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); + gui.Stub(g => g.ViewCommands).Return(viewCommands); mocks.ReplayAll(); using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs =================================================================== diff -u -rddad7117cf82255493a1a9f80b2c6562dc88bfd2 -re4a511949b59953fb0fd941474aa4423ab615bdf --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision ddad7117cf82255493a1a9f80b2c6562dc88bfd2) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision e4a511949b59953fb0fd941474aa4423ab615bdf) @@ -729,7 +729,6 @@ TreeViewControl treeViewControl) { StructuresCalculationScenario calculation = context.WrappedData; - var changeHandler = new ClearIllustrationPointsOfStructuresCalculationHandler(calculation, GetInquiryHelper()); IInquiryHelper inquiryHelper = GetInquiryHelper(); IViewCommands viewCommands = Gui.ViewCommands; @@ -761,7 +760,9 @@ calculation }, inquiryHelper, viewCommands)) .AddClearIllustrationPointsOfCalculationItem( - () => IllustrationPointsHelper.HasIllustrationPoints(calculation), changeHandler) + () => IllustrationPointsHelper.HasIllustrationPoints(calculation), + new ClearIllustrationPointsOfStructuresCalculationHandler( + calculation, inquiryHelper, viewCommands)) .AddDeleteItem() .AddSeparator() .AddCollapseAllItem() Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r4231613a2fe8a95de3ad758ba284a8f9a3d5f55f -re4a511949b59953fb0fd941474aa4423ab615bdf --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationScenarioContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationScenarioContextTreeNodeInfoTest.cs) (revision 4231613a2fe8a95de3ad758ba284a8f9a3d5f55f) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationScenarioContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationScenarioContextTreeNodeInfoTest.cs) (revision e4a511949b59953fb0fd941474aa4423ab615bdf) @@ -1496,7 +1496,7 @@ var gui = mocks.Stub(); gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mocks.Stub()); - gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); + gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); plugin.Gui = gui; @@ -1514,7 +1514,7 @@ } [Test] - public void GivenCalculationWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndIllustrationPointsCleared() + public void GivenCalculationWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndOutputViewClosedAndIllustrationPointsCleared() { // Given IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(mocks); @@ -1543,10 +1543,13 @@ using (var treeViewControl = new TreeViewControl()) { + var viewCommands = mocks.StrictMock(); + viewCommands.Expect(vc => vc.RemoveAllViewsForItem(calculation.Output.GeneralResult)); + var gui = mocks.Stub(); gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mocks.Stub()); - gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); + gui.Stub(g => g.ViewCommands).Return(viewCommands); mocks.ReplayAll(); plugin.Gui = gui; Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs =================================================================== diff -u -rddad7117cf82255493a1a9f80b2c6562dc88bfd2 -re4a511949b59953fb0fd941474aa4423ab615bdf --- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision ddad7117cf82255493a1a9f80b2c6562dc88bfd2) +++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision e4a511949b59953fb0fd941474aa4423ab615bdf) @@ -731,7 +731,6 @@ TreeViewControl treeViewControl) { StructuresCalculationScenario calculation = context.WrappedData; - var changeHandler = new ClearIllustrationPointsOfStructuresCalculationHandler(calculation, GetInquiryHelper()); IInquiryHelper inquiryHelper = GetInquiryHelper(); IViewCommands viewCommands = Gui.ViewCommands; @@ -764,7 +763,9 @@ calculation }, inquiryHelper, viewCommands)) .AddClearIllustrationPointsOfCalculationItem - (() => IllustrationPointsHelper.HasIllustrationPoints(calculation), changeHandler) + (() => IllustrationPointsHelper.HasIllustrationPoints(calculation), + new ClearIllustrationPointsOfStructuresCalculationHandler( + calculation, inquiryHelper, viewCommands)) .AddDeleteItem() .AddSeparator() .AddCollapseAllItem() Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r4231613a2fe8a95de3ad758ba284a8f9a3d5f55f -re4a511949b59953fb0fd941474aa4423ab615bdf --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationScenarioContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationScenarioContextTreeNodeInfoTest.cs) (revision 4231613a2fe8a95de3ad758ba284a8f9a3d5f55f) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationScenarioContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationScenarioContextTreeNodeInfoTest.cs) (revision e4a511949b59953fb0fd941474aa4423ab615bdf) @@ -1361,7 +1361,7 @@ var gui = mocks.Stub(); gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mocks.Stub()); - gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); + gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); plugin.Gui = gui; @@ -1379,7 +1379,7 @@ } [Test] - public void GivenCalculationWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndIllustrationPointsCleared() + public void GivenCalculationWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndOutputViewClosedAndIllustrationPointsCleared() { // Given IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(mocks); @@ -1408,10 +1408,13 @@ using (var treeViewControl = new TreeViewControl()) { + var viewCommands = mocks.StrictMock(); + viewCommands.Expect(vc => vc.RemoveAllViewsForItem(calculation.Output.GeneralResult)); + var gui = mocks.Stub(); gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mocks.Stub()); - gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); + gui.Stub(g => g.ViewCommands).Return(viewCommands); mocks.ReplayAll(); plugin.Gui = gui;