Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs =================================================================== diff -u -re4a511949b59953fb0fd941474aa4423ab615bdf -r1e08010c7dfbf0f7c2a439a67329122defc84342 --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision e4a511949b59953fb0fd941474aa4423ab615bdf) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 1e08010c7dfbf0f7c2a439a67329122defc84342) @@ -432,7 +432,7 @@ CreateClearCalculationOutputChangeHandler(calculations, inquiryHelper, viewCommands)) .AddClearIllustrationPointsOfCalculationsInFailureMechanismItem( () => IllustrationPointsHelper.HasIllustrationPoints(calculations), - CreateIllustrationPointsChangeHandler(inquiryHelper, calculations)) + CreateIllustrationPointsChangeHandler(calculations, inquiryHelper, viewCommands)) .AddSeparator() .AddCollapseAllItem() .AddExpandAllItem() @@ -578,7 +578,7 @@ CreateClearCalculationOutputChangeHandler(calculations, inquiryHelper, viewCommands)) .AddClearIllustrationPointsOfCalculationsInGroupItem( () => IllustrationPointsHelper.HasIllustrationPoints(calculations), - CreateIllustrationPointsChangeHandler(inquiryHelper, calculations)); + CreateIllustrationPointsChangeHandler(calculations, inquiryHelper, viewCommands)); if (isNestedGroup) { @@ -863,9 +863,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/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r93c4c67fe1c358bd1670c4f9da7fe828d02218ac -r1e08010c7dfbf0f7c2a439a67329122defc84342 --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 93c4c67fe1c358bd1670c4f9da7fe828d02218ac) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 1e08010c7dfbf0f7c2a439a67329122defc84342) @@ -1221,7 +1221,7 @@ } [Test] - public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndIllustrationPointsCleared() + public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndContinued_ThenInquiryAndViewsClosedAndIllustrationPointsCleared() { // Given var calculationWithIllustrationPoints = new TestHeightStructuresCalculationScenario @@ -1267,9 +1267,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.StrictMock()); + gui.Stub(g => g.ViewCommands).Return(viewCommands); mocks.ReplayAll(); using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r8a21e60e9474fe20f665b1a41cc14c778d99d572 -r1e08010c7dfbf0f7c2a439a67329122defc84342 --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision 8a21e60e9474fe20f665b1a41cc14c778d99d572) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision 1e08010c7dfbf0f7c2a439a67329122defc84342) @@ -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;