Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverWaveConditionsCalculationService.cs =================================================================== diff -u -r30327d029fa4a87a0acd139798d6966420be4ed2 -r66f8f4622c8742bfb8fc0501cf44c3c58fd35522 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverWaveConditionsCalculationService.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationService.cs) (revision 30327d029fa4a87a0acd139798d6966420be4ed2) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverWaveConditionsCalculationService.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationService.cs) (revision 66f8f4622c8742bfb8fc0501cf44c3c58fd35522) @@ -19,7 +19,9 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Linq; +using Core.Common.IO.Exceptions; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Service; using Ringtoets.HydraRing.Calculation.Exceptions; @@ -42,8 +44,14 @@ /// The for which to validate the values. /// The file path of the hydraulic boundary database file which to validate. /// True if there were no validation errors; False otherwise. + /// Thrown when is null. public static bool Validate(WaveImpactAsphaltCoverWaveConditionsCalculation calculation, string hydraulicBoundaryDatabaseFilePath) { + if (calculation == null) + { + throw new ArgumentNullException(nameof(calculation)); + } + return ValidateWaveConditionsInput( calculation.InputParameters, calculation.Name, @@ -61,13 +69,39 @@ /// The that holds information about the norm used in the calculation. /// Calculation input parameters that apply to all instances. /// The path of the HLCD file that should be used for performing the calculation. + /// Thrown when , + /// or is null. + /// Thrown when the contains invalid characters. + /// Thrown when: + /// + /// No settings database file could be found at the location of + /// with the same name. + /// Unable to open settings database file. + /// Unable to read required data from database file. + /// + /// + /// Thrown when the target probability or + /// calculated probability falls outside the [0.0, 1.0] range and is not . /// Thrown when an error occurs during parsing of the Hydra-Ring output. /// Thrown when an error occurs during the calculation. public void Calculate(WaveImpactAsphaltCoverWaveConditionsCalculation calculation, IAssessmentSection assessmentSection, GeneralWaveConditionsInput generalWaveConditionsInput, string hlcdFilePath) { + if (calculation == null) + { + throw new ArgumentNullException(nameof(calculation)); + } + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + if (generalWaveConditionsInput == null) + { + throw new ArgumentNullException(nameof(generalWaveConditionsInput)); + } + string calculationName = calculation.Name; CalculationServiceHelper.LogCalculationBeginTime(calculationName);