Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs =================================================================== diff -u -ra76bb82a008a01449840d2afcc31d5aec4f5ba3f -re1fb308ee037ad868246b1a38601f098f151a123 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision a76bb82a008a01449840d2afcc31d5aec4f5ba3f) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision e1fb308ee037ad868246b1a38601f098f151a123) @@ -66,6 +66,10 @@ structureNormalOrientation = new RoundedDouble(2); factorStormDurationOpenStructure = new RoundedDouble(2); deviationWaveDirection = new RoundedDouble(2); + + failureProbablityOpenStructure = double.NaN; + failureProbabilityReparation = double.NaN; + failureProbabilityStructureWithErosion = double.NaN; probabilityOpenStructureBeforeFlooding = 1.0; modelFactorSuperCriticalFlow = new NormalDistribution(2) @@ -348,10 +352,7 @@ /// Gets or sets the orientation of the normal of the structure. /// [degrees] /// - /// - /// When the value is smaller than 0, it will be set to 0. - /// When the value is larger than 360, it will be set to 360. - /// + ///Thown when the value for the orientation is not between [0,360] degrees. public RoundedDouble StructureNormalOrientation { get @@ -361,29 +362,15 @@ set { RoundedDouble newOrientationValue = value.ToPrecision(structureNormalOrientation.NumberOfDecimalPlaces); - newOrientationValue = ValidateStructureNormalOrientationInRange(newOrientationValue); + if (newOrientationValue < 0 || newOrientationValue > 360) + { + throw new ArgumentOutOfRangeException(null, RingtoetsCommonDataResources.Orientation_Value_needs_to_be_between_0_and_360); + } structureNormalOrientation = newOrientationValue; } } - private RoundedDouble ValidateStructureNormalOrientationInRange(RoundedDouble newOrientationValue) - { - const double upperBoundaryRange = 360; - const double lowerBoundaryRange = 0.0; - - if (newOrientationValue > upperBoundaryRange) - { - newOrientationValue = new RoundedDouble(2, upperBoundaryRange); - } - else if (newOrientationValue < lowerBoundaryRange) - { - newOrientationValue = new RoundedDouble(2, lowerBoundaryRange); - } - - return newOrientationValue; - } - #endregion /// @@ -424,7 +411,7 @@ /// Gets or sets the failure probability of an open structure. /// [1/year] /// - /// Thrown when the value of the probability + /// Thrown when the value of the probability /// is not between [0, 1]. public double FailureProbabilityOpenStructure { @@ -436,7 +423,7 @@ { if (!ValidProbabilityValue(value)) { - throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); + throw new ArgumentOutOfRangeException(null, RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } failureProbablityOpenStructure = value; } @@ -446,7 +433,7 @@ /// Gets or sets the reparation failure probability. /// [1/year] /// - /// Thrown when the value of the probability + /// Thrown when the value of the probability /// is not between [0, 1]. public double FailureProbablityReparation { @@ -458,14 +445,14 @@ { if (!ValidProbabilityValue(value)) { - throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); + throw new ArgumentOutOfRangeException(null, RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } failureProbabilityReparation = value; } } /// - /// Gets or sets the identical apertures to use during the calculation. + /// Gets or sets the amount of identical apertures to use during the calculation. /// public int IdenticalApertures { get; set; } @@ -558,7 +545,7 @@ /// Gets or sets the failure probability of structure given erosion. /// [1/year] /// - /// Thrown when the value of the probability + /// Thrown when the value of the probability /// is not between [0, 1]. public double FailureProbabilityStructureWithErosion { @@ -570,7 +557,7 @@ { if (!ValidProbabilityValue(value)) { - throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); + throw new ArgumentOutOfRangeException(null, RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } failureProbabilityStructureWithErosion = value; } @@ -596,7 +583,7 @@ /// /// Gets or sets the failure probability of an open structure before flooding. /// - /// Thrown when the value of the probability + /// Thrown when the value of the probability /// is not between [0, 1]. public double ProbabilityOpenStructureBeforeFlooding { @@ -608,7 +595,7 @@ { if (!ValidProbabilityValue(value)) { - throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); + throw new ArgumentOutOfRangeException(null, RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } probabilityOpenStructureBeforeFlooding = value; }