Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs =================================================================== diff -u -re4a511949b59953fb0fd941474aa4423ab615bdf -ref011606612b37c994bd8711b11dd34e2dfb705d --- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision e4a511949b59953fb0fd941474aa4423ab615bdf) +++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision ef011606612b37c994bd8711b11dd34e2dfb705d) @@ -435,7 +435,7 @@ CreateClearCalculationOutputChangeHandler(calculations, inquiryHelper, viewCommands)) .AddClearIllustrationPointsOfCalculationsInFailureMechanismItem( () => IllustrationPointsHelper.HasIllustrationPoints(calculations), - CreateIllustrationPointsChangeHandler(inquiryHelper, calculations)) + CreateIllustrationPointsChangeHandler(calculations, inquiryHelper, viewCommands)) .AddSeparator() .AddCollapseAllItem() .AddExpandAllItem() @@ -580,7 +580,7 @@ CreateClearCalculationOutputChangeHandler(calculations, inquiryHelper, viewCommands)) .AddClearIllustrationPointsOfCalculationsInGroupItem( () => IllustrationPointsHelper.HasIllustrationPoints(calculations), - CreateIllustrationPointsChangeHandler(inquiryHelper, calculations)); + CreateIllustrationPointsChangeHandler(calculations, inquiryHelper, viewCommands)); if (isNestedGroup) { @@ -865,9 +865,9 @@ #endregion private 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/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r93c4c67fe1c358bd1670c4f9da7fe828d02218ac -ref011606612b37c994bd8711b11dd34e2dfb705d --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 93c4c67fe1c358bd1670c4f9da7fe828d02218ac) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision ef011606612b37c994bd8711b11dd34e2dfb705d) @@ -1507,7 +1507,7 @@ } [Test] - public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndIllustrationPointsCleared() + public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndViewsClosedAndIllustrationPointsCleared() { // Given var calculationWithIllustrationPoints = new TestStabilityPointStructuresCalculationScenario @@ -1553,9 +1553,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/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r8a21e60e9474fe20f665b1a41cc14c778d99d572 -ref011606612b37c994bd8711b11dd34e2dfb705d --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../StabilityPointStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision 8a21e60e9474fe20f665b1a41cc14c778d99d572) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../StabilityPointStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision ef011606612b37c994bd8711b11dd34e2dfb705d) @@ -1131,7 +1131,7 @@ } [Test] - public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndIllustrationPointsCleared() + public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndViewsClosedAndIllustrationPointsCleared() { // Given var calculationWithIllustrationPoints = new StructuresCalculationScenario @@ -1180,10 +1180,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;