Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rf989a06ad41e4081dd1d155fafa263e94b070816 -rfda32224be20ced8ee871a3ab495f11e55d48835 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision f989a06ad41e4081dd1d155fafa263e94b070816) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision fda32224be20ced8ee871a3ab495f11e55d48835) @@ -44,7 +44,6 @@ using Ringtoets.HeightStructures.Forms.PresentationObjects; using Ringtoets.HeightStructures.Plugin; using Ringtoets.HydraRing.Data; - using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; using RingtoetsCommonServiceResources = Ringtoets.Common.Service.Properties.Resources; @@ -1260,6 +1259,41 @@ } [Test] + public void OnNodeRemoved_CalculationInGroupAssignedToSection_CalculationDetachedFromSection() + { + // Setup + var failureMechanism = new HeightStructuresFailureMechanism(); + var assessmentSectionStub = mocks.Stub(); + var group = new CalculationGroup(); + var parentGroup = new CalculationGroup(); + var nodeData = new HeightStructuresCalculationGroupContext(group, + failureMechanism, + assessmentSectionStub); + var parentNodeData = new HeightStructuresCalculationGroupContext(parentGroup, + failureMechanism, + assessmentSectionStub); + + mocks.ReplayAll(); + + parentGroup.Children.Add(group); + + failureMechanism.AddSection(new FailureMechanismSection("section", new[] + { + new Point2D(0, 0) + })); + + var calculation = new HeightStructuresCalculation(); + group.Children.Add(calculation); + failureMechanism.SectionResults.First().Calculation = calculation; + + // Call + info.OnNodeRemoved(nodeData, parentNodeData); + + // Assert + Assert.IsNull(failureMechanism.SectionResults.First().Calculation); + } + + [Test] public void OnNodeRemoved_NestedCalculationGroupContainingCalculations_RemoveGroupAndCalculationsAndNotifyObservers() { // Setup