Index: Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsDataSynchronizationService.cs =================================================================== diff -u -r9e9976818f1b446948c3bf815cafe2e023f98ac1 -rc802ae879d8c6934c22516de3965f7a4cace2982 --- Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsDataSynchronizationService.cs (.../GrassCoverErosionOutwardsDataSynchronizationService.cs) (revision 9e9976818f1b446948c3bf815cafe2e023f98ac1) +++ Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsDataSynchronizationService.cs (.../GrassCoverErosionOutwardsDataSynchronizationService.cs) (revision c802ae879d8c6934c22516de3965f7a4cace2982) @@ -36,22 +36,30 @@ public static class GrassCoverErosionOutwardsDataSynchronizationService { /// - /// Clears the and output for all the wave conditions calculations - /// in the . + /// Clears the and output for the wave conditions calculations + /// in the that uses an + /// from . /// /// The /// which contains the calculations. + /// The hydraulic boundary locations to clear for. /// An of objects which are affected by removal of data. /// Thrown when /// is null. public static IEnumerable ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations( - GrassCoverErosionOutwardsFailureMechanism failureMechanism) + GrassCoverErosionOutwardsFailureMechanism failureMechanism, + IEnumerable hydraulicBoundaryLocations) { if (failureMechanism == null) { throw new ArgumentNullException(nameof(failureMechanism)); } + if (hydraulicBoundaryLocations == null) + { + throw new ArgumentNullException(nameof(hydraulicBoundaryLocations)); + } + var affectedItems = new List(); foreach (GrassCoverErosionOutwardsWaveConditionsCalculation calculation in failureMechanism.Calculations.Cast()) { Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Service.Test/GrassCoverErosionOutwardsDataSynchronizationServiceTest.cs =================================================================== diff -u -r9e9976818f1b446948c3bf815cafe2e023f98ac1 -rc802ae879d8c6934c22516de3965f7a4cace2982 --- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Service.Test/GrassCoverErosionOutwardsDataSynchronizationServiceTest.cs (.../GrassCoverErosionOutwardsDataSynchronizationServiceTest.cs) (revision 9e9976818f1b446948c3bf815cafe2e023f98ac1) +++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Service.Test/GrassCoverErosionOutwardsDataSynchronizationServiceTest.cs (.../GrassCoverErosionOutwardsDataSynchronizationServiceTest.cs) (revision c802ae879d8c6934c22516de3965f7a4cace2982) @@ -41,14 +41,27 @@ public void ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations_FailureMechanismNull_ThrowsArgumentNullException() { // Call - void Call() => GrassCoverErosionOutwardsDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations(null); + void Call() => GrassCoverErosionOutwardsDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations( + null, Enumerable.Empty()); // Assert var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); } [Test] + public void ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations_HydraulicBoundaryLocationsNull_ThrowsArgumentNullException() + { + // Call + void Call() => GrassCoverErosionOutwardsDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations( + new GrassCoverErosionOutwardsFailureMechanism(), null); + + // Assert + var exception = Assert.Throws(Call); + Assert.AreEqual("hydraulicBoundaryLocations", exception.ParamName); + } + + [Test] public void ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations_WithVariousCalculations_ClearsOutputAndReturnsAffectedObjects() { // Setup @@ -63,8 +76,8 @@ .ToArray(); // Call - IEnumerable affectedItems = - GrassCoverErosionOutwardsDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations(failureMechanism); + IEnumerable affectedItems = GrassCoverErosionOutwardsDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations( + failureMechanism, Enumerable.Empty()); // Assert // Note: To make sure the clear is performed regardless of what is done with Index: Riskeer/Integration/src/Riskeer.Integration.Service/RiskeerDataSynchronizationService.cs =================================================================== diff -u -rfa4145437e47ac6c2a2b864ccd83a9c62701b335 -rc802ae879d8c6934c22516de3965f7a4cace2982 --- Riskeer/Integration/src/Riskeer.Integration.Service/RiskeerDataSynchronizationService.cs (.../RiskeerDataSynchronizationService.cs) (revision fa4145437e47ac6c2a2b864ccd83a9c62701b335) +++ Riskeer/Integration/src/Riskeer.Integration.Service/RiskeerDataSynchronizationService.cs (.../RiskeerDataSynchronizationService.cs) (revision c802ae879d8c6934c22516de3965f7a4cace2982) @@ -106,7 +106,8 @@ waveImpactAsphaltCoverFailureMechanism, hydraulicBoundaryLocations)); break; case GrassCoverErosionOutwardsFailureMechanism grassCoverErosionOutwardsFailureMechanism: - changedObservables.AddRange(GrassCoverErosionOutwardsDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations(grassCoverErosionOutwardsFailureMechanism)); + changedObservables.AddRange(GrassCoverErosionOutwardsDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations( + grassCoverErosionOutwardsFailureMechanism, hydraulicBoundaryLocations)); break; case HeightStructuresFailureMechanism heightStructuresFailureMechanism: changedObservables.AddRange(HeightStructuresDataSynchronizationService.ClearAllCalculationOutputAndHydraulicBoundaryLocations(heightStructuresFailureMechanism));