Index: Riskeer/Integration/src/Riskeer.Integration.Service/RiskeerDataSynchronizationService.cs =================================================================== diff -u -rb4cf8f9c714eaf95f2a59954c893bc2e49b70c0e -r13fe9b75e7ed92704422877e8e7d7079bd323dfe --- Riskeer/Integration/src/Riskeer.Integration.Service/RiskeerDataSynchronizationService.cs (.../RiskeerDataSynchronizationService.cs) (revision b4cf8f9c714eaf95f2a59954c893bc2e49b70c0e) +++ Riskeer/Integration/src/Riskeer.Integration.Service/RiskeerDataSynchronizationService.cs (.../RiskeerDataSynchronizationService.cs) (revision 13fe9b75e7ed92704422877e8e7d7079bd323dfe) @@ -98,7 +98,8 @@ grassCoverErosionInwardsFailureMechanism, hydraulicBoundaryLocations)); break; case StabilityStoneCoverFailureMechanism stabilityStoneCoverFailureMechanism: - changedObservables.AddRange(StabilityStoneCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations(stabilityStoneCoverFailureMechanism)); + changedObservables.AddRange(StabilityStoneCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations + (stabilityStoneCoverFailureMechanism, hydraulicBoundaryLocations)); break; case WaveImpactAsphaltCoverFailureMechanism waveImpactAsphaltCoverFailureMechanism: changedObservables.AddRange(WaveImpactAsphaltCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations(waveImpactAsphaltCoverFailureMechanism)); Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Service/StabilityStoneCoverDataSynchronizationService.cs =================================================================== diff -u -r9e9976818f1b446948c3bf815cafe2e023f98ac1 -r13fe9b75e7ed92704422877e8e7d7079bd323dfe --- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Service/StabilityStoneCoverDataSynchronizationService.cs (.../StabilityStoneCoverDataSynchronizationService.cs) (revision 9e9976818f1b446948c3bf815cafe2e023f98ac1) +++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Service/StabilityStoneCoverDataSynchronizationService.cs (.../StabilityStoneCoverDataSynchronizationService.cs) (revision 13fe9b75e7ed92704422877e8e7d7079bd323dfe) @@ -36,22 +36,29 @@ public static class StabilityStoneCoverDataSynchronizationService { /// - /// 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 removing data. - /// Thrown when - /// is null. + /// Thrown when any parameter is null. public static IEnumerable ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations( - StabilityStoneCoverFailureMechanism failureMechanism) + StabilityStoneCoverFailureMechanism failureMechanism, + IEnumerable hydraulicBoundaryLocations) { if (failureMechanism == null) { throw new ArgumentNullException(nameof(failureMechanism)); } + if (hydraulicBoundaryLocations == null) + { + throw new ArgumentNullException(nameof(hydraulicBoundaryLocations)); + } + var affectedItems = new List(); foreach (StabilityStoneCoverWaveConditionsCalculation calculation in failureMechanism.Calculations.Cast()) { Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Service.Test/StabilityStoneCoverDataSynchronizationServiceTest.cs =================================================================== diff -u -r9e9976818f1b446948c3bf815cafe2e023f98ac1 -r13fe9b75e7ed92704422877e8e7d7079bd323dfe --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Service.Test/StabilityStoneCoverDataSynchronizationServiceTest.cs (.../StabilityStoneCoverDataSynchronizationServiceTest.cs) (revision 9e9976818f1b446948c3bf815cafe2e023f98ac1) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Service.Test/StabilityStoneCoverDataSynchronizationServiceTest.cs (.../StabilityStoneCoverDataSynchronizationServiceTest.cs) (revision 13fe9b75e7ed92704422877e8e7d7079bd323dfe) @@ -41,14 +41,27 @@ public void ClearAllCalculationOutputAndHydraulicBoundaryLocations_FailureMechanismNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => StabilityStoneCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations(null); + void Call() => StabilityStoneCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations( + null, Enumerable.Empty()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); } [Test] + public void ClearAllCalculationOutputAndHydraulicBoundaryLocations_HydraulicBoundaryLocationsNull_ThrowsArgumentNullException() + { + // Call + void Call() => StabilityStoneCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations( + new StabilityStoneCoverFailureMechanism(), null); + + // Assert + var exception = Assert.Throws(Call); + Assert.AreEqual("hydraulicBoundaryLocations", exception.ParamName); + } + + [Test] public void ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations_WithVariousCalculations_ClearsCalculationsAndReturnsAffectedObjects() { // Setup @@ -63,8 +76,8 @@ .ToArray(); // Call - IEnumerable affectedItems = - StabilityStoneCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations(failureMechanism); + IEnumerable affectedItems = StabilityStoneCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations( + failureMechanism, Enumerable.Empty()); // Assert // Note: To make sure the clear is performed regardless of what is done with