Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r31791943fdbbfdd377f3a6fc29dc8dbd3f9f5d63 -r4218a421a57a8044e5112abac83f6650234f80ec --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 31791943fdbbfdd377f3a6fc29dc8dbd3f9f5d63) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 4218a421a57a8044e5112abac83f6650234f80ec) @@ -1972,19 +1972,19 @@ { return new object[] { - new DesignWaterLevelCalculationsContext(GetHydraulicBoundaryLocationCalculations(context.WrappedData, hbl => hbl.DesignWaterLevelCalculation1), + new DesignWaterLevelCalculationsContext(context.AssessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm, context.AssessmentSection, () => GetFirstHydraulicBoundaryNorm(context.AssessmentSection), RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_1), - new DesignWaterLevelCalculationsContext(GetHydraulicBoundaryLocationCalculations(context.WrappedData, hbl => hbl.DesignWaterLevelCalculation2), + new DesignWaterLevelCalculationsContext(context.AssessmentSection.WaterLevelCalculationsForSignalingNorm, context.AssessmentSection, () => GetSecondHydraulicBoundaryNorm(context.AssessmentSection), RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_2), - new DesignWaterLevelCalculationsContext(GetHydraulicBoundaryLocationCalculations(context.WrappedData, hbl => hbl.DesignWaterLevelCalculation3), + new DesignWaterLevelCalculationsContext(context.AssessmentSection.WaterLevelCalculationsForLowerLimitNorm, context.AssessmentSection, () => GetThirdHydraulicBoundaryNorm(context.AssessmentSection), RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_3), - new DesignWaterLevelCalculationsContext(GetHydraulicBoundaryLocationCalculations(context.WrappedData, hbl => hbl.DesignWaterLevelCalculation4), + new DesignWaterLevelCalculationsContext(context.AssessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm, context.AssessmentSection, () => GetFourthHydraulicBoundaryNorm(context.AssessmentSection), RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_4) @@ -1995,19 +1995,19 @@ { return new object[] { - new WaveHeightCalculationsContext(GetHydraulicBoundaryLocationCalculations(context.WrappedData, hbl => hbl.WaveHeightCalculation1), + new WaveHeightCalculationsContext(context.AssessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm, context.AssessmentSection, () => GetFirstHydraulicBoundaryNorm(context.AssessmentSection), RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_1), - new WaveHeightCalculationsContext(GetHydraulicBoundaryLocationCalculations(context.WrappedData, hbl => hbl.WaveHeightCalculation2), + new WaveHeightCalculationsContext(context.AssessmentSection.WaveHeightCalculationsForSignalingNorm, context.AssessmentSection, () => GetSecondHydraulicBoundaryNorm(context.AssessmentSection), RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_2), - new WaveHeightCalculationsContext(GetHydraulicBoundaryLocationCalculations(context.WrappedData, hbl => hbl.WaveHeightCalculation3), + new WaveHeightCalculationsContext(context.AssessmentSection.WaveHeightCalculationsForLowerLimitNorm, context.AssessmentSection, () => GetThirdHydraulicBoundaryNorm(context.AssessmentSection), RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_3), - new WaveHeightCalculationsContext(GetHydraulicBoundaryLocationCalculations(context.WrappedData, hbl => hbl.WaveHeightCalculation4), + new WaveHeightCalculationsContext(context.AssessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm, context.AssessmentSection, () => GetFourthHydraulicBoundaryNorm(context.AssessmentSection), RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_4) Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelCalculationsGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rf8f82b94a5b6a3a47b2b32fc1a8ab704b33f356b -r4218a421a57a8044e5112abac83f6650234f80ec --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelCalculationsGroupContextTreeNodeInfoTest.cs (.../DesignWaterLevelCalculationsGroupContextTreeNodeInfoTest.cs) (revision f8f82b94a5b6a3a47b2b32fc1a8ab704b33f356b) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelCalculationsGroupContextTreeNodeInfoTest.cs (.../DesignWaterLevelCalculationsGroupContextTreeNodeInfoTest.cs) (revision 4218a421a57a8044e5112abac83f6650234f80ec) @@ -30,9 +30,8 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; -using Ringtoets.Common.Data.Contribution; -using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Forms.PresentationObjects; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -151,18 +150,10 @@ const double signalingNorm = 0.002; const double lowerLimitNorm = 0.005; - var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); - assessmentSection.Expect(a => a.FailureMechanismContribution) - .Return(new FailureMechanismContribution( - Enumerable.Empty(), - 10, - lowerLimitNorm, - signalingNorm)) - .Repeat.Any(); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + assessmentSection.FailureMechanismContribution.LowerLimitNorm = lowerLimitNorm; + assessmentSection.FailureMechanismContribution.SignalingNorm = signalingNorm; - mocks.ReplayAll(); - var locations = new ObservableList(); var calculationsGroupContext = new DesignWaterLevelCalculationsGroupContext(locations, assessmentSection); @@ -182,23 +173,21 @@ Assert.IsTrue(calculationsContexts.All(c => ReferenceEquals(assessmentSection, c.AssessmentSection))); Assert.AreEqual("Categorie A+->A", calculationsContexts[0].CategoryBoundaryName); - CollectionAssert.AreEqual(locations.Select(loc => loc.DesignWaterLevelCalculation1), calculationsContexts[0].WrappedData); + Assert.AreSame(assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm, calculationsContexts[0].WrappedData); Assert.AreEqual(signalingNorm / 30, calculationsContexts[0].GetNormFunc()); Assert.AreEqual("Categorie A->B", calculationsContexts[1].CategoryBoundaryName); - CollectionAssert.AreEqual(locations.Select(loc => loc.DesignWaterLevelCalculation2), calculationsContexts[1].WrappedData); + Assert.AreSame(assessmentSection.WaterLevelCalculationsForSignalingNorm, calculationsContexts[1].WrappedData); Assert.AreEqual(signalingNorm, calculationsContexts[1].GetNormFunc()); Assert.AreEqual("Categorie B->C", calculationsContexts[2].CategoryBoundaryName); - CollectionAssert.AreEqual(locations.Select(loc => loc.DesignWaterLevelCalculation3), calculationsContexts[2].WrappedData); + Assert.AreSame(assessmentSection.WaterLevelCalculationsForLowerLimitNorm, calculationsContexts[2].WrappedData); Assert.AreEqual(lowerLimitNorm, calculationsContexts[2].GetNormFunc()); Assert.AreEqual("Categorie C->D", calculationsContexts[3].CategoryBoundaryName); - CollectionAssert.AreEqual(locations.Select(loc => loc.DesignWaterLevelCalculation4), calculationsContexts[3].WrappedData); + Assert.AreSame(assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm, calculationsContexts[3].WrappedData); Assert.AreEqual(lowerLimitNorm * 30, calculationsContexts[3].GetNormFunc()); } - - mocks.VerifyAll(); } private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin) Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rf8f82b94a5b6a3a47b2b32fc1a8ab704b33f356b -r4218a421a57a8044e5112abac83f6650234f80ec --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsGroupContextTreeNodeInfoTest.cs (.../WaveHeightCalculationsGroupContextTreeNodeInfoTest.cs) (revision f8f82b94a5b6a3a47b2b32fc1a8ab704b33f356b) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsGroupContextTreeNodeInfoTest.cs (.../WaveHeightCalculationsGroupContextTreeNodeInfoTest.cs) (revision 4218a421a57a8044e5112abac83f6650234f80ec) @@ -30,9 +30,8 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; -using Ringtoets.Common.Data.Contribution; -using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Forms.PresentationObjects; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -152,18 +151,10 @@ const double signalingNorm = 0.002; const double lowerLimitNorm = 0.005; - var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); - assessmentSection.Expect(a => a.FailureMechanismContribution) - .Return(new FailureMechanismContribution( - Enumerable.Empty(), - 10, - lowerLimitNorm, - signalingNorm)) - .Repeat.Any(); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + assessmentSection.FailureMechanismContribution.LowerLimitNorm = lowerLimitNorm; + assessmentSection.FailureMechanismContribution.SignalingNorm = signalingNorm; - mocks.ReplayAll(); - var locations = new ObservableList(); var calculationsGroupContext = new WaveHeightCalculationsGroupContext(locations, assessmentSection); @@ -183,23 +174,21 @@ Assert.IsTrue(calculationsContexts.All(c => ReferenceEquals(assessmentSection, c.AssessmentSection))); Assert.AreEqual("Categorie A+->A", calculationsContexts[0].CategoryBoundaryName); - CollectionAssert.AreEqual(locations.Select(loc => loc.WaveHeightCalculation1), calculationsContexts[0].WrappedData); + Assert.AreSame(assessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm, calculationsContexts[0].WrappedData); Assert.AreEqual(signalingNorm / 30, calculationsContexts[0].GetNormFunc()); Assert.AreEqual("Categorie A->B", calculationsContexts[1].CategoryBoundaryName); - CollectionAssert.AreEqual(locations.Select(loc => loc.WaveHeightCalculation2), calculationsContexts[1].WrappedData); + Assert.AreSame(assessmentSection.WaveHeightCalculationsForSignalingNorm, calculationsContexts[1].WrappedData); Assert.AreEqual(signalingNorm, calculationsContexts[1].GetNormFunc()); Assert.AreEqual("Categorie B->C", calculationsContexts[2].CategoryBoundaryName); - CollectionAssert.AreEqual(locations.Select(loc => loc.WaveHeightCalculation3), calculationsContexts[2].WrappedData); + Assert.AreSame(assessmentSection.WaveHeightCalculationsForLowerLimitNorm, calculationsContexts[2].WrappedData); Assert.AreEqual(lowerLimitNorm, calculationsContexts[2].GetNormFunc()); Assert.AreEqual("Categorie C->D", calculationsContexts[3].CategoryBoundaryName); - CollectionAssert.AreEqual(locations.Select(loc => loc.WaveHeightCalculation4), calculationsContexts[3].WrappedData); + Assert.AreSame(assessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm, calculationsContexts[3].WrappedData); Assert.AreEqual(lowerLimitNorm * 30, calculationsContexts[3].GetNormFunc()); } - - mocks.VerifyAll(); } private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin)