Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForNormTargetProbabilitiesGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r261a4d39cc3da095b3533db952351ce6f001dd1a -rfc478a14e0892174cdfacb4e6da6fba70d43803a --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForNormTargetProbabilitiesGroupContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForNormTargetProbabilitiesGroupContextTreeNodeInfoTest.cs) (revision 261a4d39cc3da095b3533db952351ce6f001dd1a) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForNormTargetProbabilitiesGroupContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForNormTargetProbabilitiesGroupContextTreeNodeInfoTest.cs) (revision fc478a14e0892174cdfacb4e6da6fba70d43803a) @@ -125,6 +125,43 @@ } [Test] + public void ChildNodeObjects_Always_ReturnsChildrenOfData() + { + // Setup + const double signalingNorm = 0.002; + const double lowerLimitNorm = 0.005; + + var assessmentSection = new AssessmentSectionStub(); + assessmentSection.FailureMechanismContribution.LowerLimitNorm = lowerLimitNorm; + assessmentSection.FailureMechanismContribution.SignalingNorm = signalingNorm; + + var locations = new ObservableList(); + var calculationsGroupContext = new WaterLevelCalculationsForNormTargetProbabilitiesGroupContext(locations, assessmentSection); + + using (var plugin = new RiskeerPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + object[] childNodeObjects = info.ChildNodeObjects(calculationsGroupContext); + + // Assert + Assert.AreEqual(2, childNodeObjects.Length); + + WaterLevelCalculationsForNormTargetProbabilityContext[] calculationsContexts = childNodeObjects.OfType().ToArray(); + Assert.AreEqual(2, calculationsContexts.Length); + + Assert.IsTrue(calculationsContexts.All(c => ReferenceEquals(assessmentSection, c.AssessmentSection))); + + Assert.AreSame(assessmentSection.WaterLevelCalculationsForSignalingNorm, calculationsContexts[0].WrappedData); + Assert.AreEqual(signalingNorm, calculationsContexts[0].GetNormFunc()); + + Assert.AreSame(assessmentSection.WaterLevelCalculationsForLowerLimitNorm, calculationsContexts[1].WrappedData); + Assert.AreEqual(lowerLimitNorm, calculationsContexts[1].GetNormFunc()); + } + } + + [Test] public void ContextMenuStrip_Always_CallsContextMenuBuilderMethods() { // Setup @@ -491,43 +528,6 @@ } [Test] - public void ChildNodeObjects_Always_ReturnsChildrenOfData() - { - // Setup - const double signalingNorm = 0.002; - const double lowerLimitNorm = 0.005; - - var assessmentSection = new AssessmentSectionStub(); - assessmentSection.FailureMechanismContribution.LowerLimitNorm = lowerLimitNorm; - assessmentSection.FailureMechanismContribution.SignalingNorm = signalingNorm; - - var locations = new ObservableList(); - var calculationsGroupContext = new WaterLevelCalculationsForNormTargetProbabilitiesGroupContext(locations, assessmentSection); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - // Call - object[] childNodeObjects = info.ChildNodeObjects(calculationsGroupContext); - - // Assert - Assert.AreEqual(2, childNodeObjects.Length); - - WaterLevelCalculationsForNormTargetProbabilityContext[] calculationsContexts = childNodeObjects.OfType().ToArray(); - Assert.AreEqual(2, calculationsContexts.Length); - - Assert.IsTrue(calculationsContexts.All(c => ReferenceEquals(assessmentSection, c.AssessmentSection))); - - Assert.AreSame(assessmentSection.WaterLevelCalculationsForSignalingNorm, calculationsContexts[0].WrappedData); - Assert.AreEqual(signalingNorm, calculationsContexts[0].GetNormFunc()); - - Assert.AreSame(assessmentSection.WaterLevelCalculationsForLowerLimitNorm, calculationsContexts[1].WrappedData); - Assert.AreEqual(lowerLimitNorm, calculationsContexts[1].GetNormFunc()); - } - } - - [Test] [TestCaseSource(nameof(GetWaterLevelCalculations))] [Apartment(ApartmentState.STA)] public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndDoNotContinue_ThenInquiryAndIllustrationPointsNotCleared(