Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs =================================================================== diff -u -rb2b9fdf365e70928a05c57966eeed30d9050e528 -r974fb1eadbd8a630c7a992648ad42ac85ec205b1 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision b2b9fdf365e70928a05c57966eeed30d9050e528) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision 974fb1eadbd8a630c7a992648ad42ac85ec205b1) @@ -38,6 +38,11 @@ public class GrassCoverErosionInwardsInput : Observable, ICalculationInput, IUseBreakWater, IUseForeshore { + private const int orientationNumberOfDecimals = 2; + + private static readonly Range orientationValidityRange = new Range(new RoundedDouble(orientationNumberOfDecimals), + new RoundedDouble(orientationNumberOfDecimals, 360)); + private readonly LogNormalDistribution criticalFlowRate; private RoundedDouble orientation; private RoundedDouble dikeHeight; @@ -48,7 +53,7 @@ /// public GrassCoverErosionInwardsInput() { - orientation = new RoundedDouble(2); + orientation = new RoundedDouble(orientationNumberOfDecimals); dikeHeight = new RoundedDouble(2); UpdateProfileParameters(); @@ -90,9 +95,10 @@ set { RoundedDouble newOrientation = value.ToPrecision(orientation.NumberOfDecimalPlaces); - if (!double.IsNaN(newOrientation) && (newOrientation < 0 || newOrientation > 360)) + if (!double.IsNaN(newOrientation) && !orientationValidityRange.InRange(newOrientation)) { - throw new ArgumentOutOfRangeException(nameof(value), RingtoetsCommonDataResources.Orientation_Value_needs_to_be_between_0_and_360); + throw new ArgumentOutOfRangeException(nameof(value), string.Format(RingtoetsCommonDataResources.Orientation_Value_needs_to_be_in_Range_0_, + orientationValidityRange)); } orientation = newOrientation; }