Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionMergeHandler.cs =================================================================== diff -u -r3dd641f989b1ae4b18cf430c2b60cceacc1bed6f -r1ddd8b0ed9eedc22ca7a4396a44d95c1cfe519ec --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionMergeHandler.cs (.../AssessmentSectionMergeHandler.cs) (revision 3dd641f989b1ae4b18cf430c2b60cceacc1bed6f) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionMergeHandler.cs (.../AssessmentSectionMergeHandler.cs) (revision 1ddd8b0ed9eedc22ca7a4396a44d95c1cfe519ec) @@ -80,12 +80,21 @@ viewCommands.RemoveAllViewsForItem(assessmentSection); } - private void MergeHydraulicBoundaryLocations(AssessmentSection targetAssessmentSection, AssessmentSection sourceAssessmentSection) + private static void MergeHydraulicBoundaryLocations(AssessmentSection targetAssessmentSection, AssessmentSection sourceAssessmentSection) { - for (var i = 0; i < targetAssessmentSection.HydraulicBoundaryDatabase.Locations.Count; i++) + MergeHydraulicBoundaryLocationCalculations(targetAssessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm, + sourceAssessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm); + MergeHydraulicBoundaryLocationCalculations(targetAssessmentSection.WaterLevelCalculationsForSignalingNorm, + sourceAssessmentSection.WaterLevelCalculationsForSignalingNorm); + } + + private static void MergeHydraulicBoundaryLocationCalculations(IEnumerable targetCalculations, + IEnumerable sourceCalculations) + { + for (var i = 0; i < targetCalculations.Count(); i++) { - HydraulicBoundaryLocationCalculation targetCalculation = targetAssessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.ElementAt(i); - HydraulicBoundaryLocationCalculation sourceCalculation = sourceAssessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.ElementAt(i); + HydraulicBoundaryLocationCalculation targetCalculation = targetCalculations.ElementAt(i); + HydraulicBoundaryLocationCalculation sourceCalculation = sourceCalculations.ElementAt(i); if (ShouldMerge(targetCalculation, sourceCalculation)) { @@ -95,7 +104,7 @@ } } - private bool ShouldMerge(HydraulicBoundaryLocationCalculation targetCalculation, HydraulicBoundaryLocationCalculation sourceCalculation) + private static bool ShouldMerge(HydraulicBoundaryLocationCalculation targetCalculation, HydraulicBoundaryLocationCalculation sourceCalculation) { bool targetCalculationHasOutput = targetCalculation.HasOutput; bool sourceCalculationHasOutput = sourceCalculation.HasOutput; Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Merge/AssessmentSectionMergeHandlerTest.cs =================================================================== diff -u -r9113c4ed17ff36e665a6d75d22e2abca0cdb777f -r1ddd8b0ed9eedc22ca7a4396a44d95c1cfe519ec --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Merge/AssessmentSectionMergeHandlerTest.cs (.../AssessmentSectionMergeHandlerTest.cs) (revision 9113c4ed17ff36e665a6d75d22e2abca0cdb777f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Merge/AssessmentSectionMergeHandlerTest.cs (.../AssessmentSectionMergeHandlerTest.cs) (revision 1ddd8b0ed9eedc22ca7a4396a44d95c1cfe519ec) @@ -346,6 +346,8 @@ { yield return new TestCaseData(new Func>( section => section.WaterLevelCalculationsForFactorizedSignalingNorm)); + yield return new TestCaseData(new Func>( + section => section.WaterLevelCalculationsForSignalingNorm)); } private static AssessmentSection CreateAssessmentSection(TestHydraulicBoundaryLocation[] locations)