Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs =================================================================== diff -u -re4a511949b59953fb0fd941474aa4423ab615bdf -rc820ec6f7311ef251b924cb702f0eae84f7921f6 --- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision e4a511949b59953fb0fd941474aa4423ab615bdf) +++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision c820ec6f7311ef251b924cb702f0eae84f7921f6) @@ -428,7 +428,7 @@ CreateClearCalculationOutputChangeHandler(calculations, inquiryHelper, viewCommands)) .AddClearIllustrationPointsOfCalculationsInFailureMechanismItem( () => IllustrationPointsHelper.HasIllustrationPoints(calculations), - CreateIllustrationPointsChangeHandler(inquiryHelper, calculations)) + CreateIllustrationPointsChangeHandler(calculations, inquiryHelper, viewCommands)) .AddSeparator() .AddCollapseAllItem() .AddExpandAllItem() @@ -575,7 +575,7 @@ CreateClearCalculationOutputChangeHandler(calculations, inquiryHelper, viewCommands)) .AddClearIllustrationPointsOfCalculationsInGroupItem( () => IllustrationPointsHelper.HasIllustrationPoints(calculations), - CreateIllustrationPointsChangeHandler(inquiryHelper, calculations)); + CreateIllustrationPointsChangeHandler(calculations, inquiryHelper, viewCommands)); if (isNestedGroup) { @@ -857,9 +857,9 @@ #endregion private static ClearIllustrationPointsOfStructureCalculationCollectionChangeHandler CreateIllustrationPointsChangeHandler( - IInquiryHelper inquiryHelper, IEnumerable> calculations) + IEnumerable> calculations, IInquiryHelper inquiryHelper, IViewCommands viewCommands) { - return new ClearIllustrationPointsOfStructureCalculationCollectionChangeHandler(inquiryHelper, calculations); + return new ClearIllustrationPointsOfStructureCalculationCollectionChangeHandler(calculations, inquiryHelper, viewCommands); } private static ClearStructuresCalculationOutputChangeHandler CreateClearCalculationOutputChangeHandler( Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r93c4c67fe1c358bd1670c4f9da7fe828d02218ac -rc820ec6f7311ef251b924cb702f0eae84f7921f6 --- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 93c4c67fe1c358bd1670c4f9da7fe828d02218ac) +++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision c820ec6f7311ef251b924cb702f0eae84f7921f6) @@ -1095,7 +1095,7 @@ } [Test] - public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndIllustrationPointsCleared() + public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndViewsClosedAndIllustrationPointsCleared() { // Given var calculationWithIllustrationPoints = new TestClosingStructuresCalculationScenario @@ -1141,9 +1141,12 @@ using (var treeViewControl = new TreeViewControl()) { + var viewCommands = mocks.StrictMock(); + viewCommands.Expect(vc => vc.RemoveAllViewsForItem(calculationWithIllustrationPoints.Output.GeneralResult)); + gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); 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 contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r8a21e60e9474fe20f665b1a41cc14c778d99d572 -rc820ec6f7311ef251b924cb702f0eae84f7921f6 --- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision 8a21e60e9474fe20f665b1a41cc14c778d99d572) +++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision c820ec6f7311ef251b924cb702f0eae84f7921f6) @@ -1125,7 +1125,7 @@ } [Test] - public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndIllustrationPointsCleared() + public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndViewsClosedAndIllustrationPointsCleared() { // Given var calculationWithIllustrationPoints = new StructuresCalculationScenario @@ -1174,10 +1174,13 @@ using (var treeViewControl = new TreeViewControl()) { + var viewCommands = mocksRepository.StrictMock(); + viewCommands.Expect(vc => vc.RemoveAllViewsForItem(calculationWithIllustrationPoints.Output.GeneralResult)); + var gui = mocksRepository.Stub(); gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mocksRepository.Stub()); - gui.Stub(g => g.ViewCommands).Return(mocksRepository.Stub()); + gui.Stub(g => g.ViewCommands).Return(viewCommands); mocksRepository.ReplayAll(); plugin.Gui = gui;