Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs =================================================================== diff -u -r38cd5da3aefa4ea677c2b1796cbb9b831d41fe3c -r25b4c6adf1c80f2e25a69a172679362938dc8efb --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision 38cd5da3aefa4ea677c2b1796cbb9b831d41fe3c) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision 25b4c6adf1c80f2e25a69a172679362938dc8efb) @@ -21,6 +21,7 @@ using System; using Core.Common.Base.Data; +using Ringtoets.ClosingStructures.Data.Properties; using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; @@ -35,9 +36,11 @@ { private const int deviationWaveDirectionNumberOfDecimals = 2; - private static readonly Range deviationWaveDirectionValidityRange = new Range(new RoundedDouble(deviationWaveDirectionNumberOfDecimals, -360), - new RoundedDouble(deviationWaveDirectionNumberOfDecimals, 360)); + private static readonly Range deviationWaveDirectionValidityRange = new Range( + new RoundedDouble(deviationWaveDirectionNumberOfDecimals, -360), new RoundedDouble(deviationWaveDirectionNumberOfDecimals, 360)); + private static readonly Range identicalAperturesValidityRange = new Range(1, int.MaxValue); + private NormalDistribution thresholdHeightOpenWeir; private NormalDistribution drainCoefficient; private LogNormalDistribution areaFlowApertures; @@ -48,6 +51,7 @@ private double failureProbabilityReparation; private double probabilityOpenStructureBeforeFlooding; private RoundedDouble deviationWaveDirection; + private int identicalApertures; /// /// Creates a new instance of the class. @@ -172,7 +176,7 @@ StandardDeviation = RoundedDouble.NaN }; - IdenticalApertures = 0; + IdenticalApertures = 1; InflowModelType = 0; } @@ -331,7 +335,23 @@ /// /// Gets or sets the amount of identical apertures. /// - public int IdenticalApertures { get; set; } + /// Thrown when the value is smaller than 1. + public int IdenticalApertures + { + get + { + return identicalApertures; + } + set + { + if (!identicalAperturesValidityRange.InRange(value)) + { + throw new ArgumentOutOfRangeException(nameof(IdenticalApertures), + Resources.ClosingStructuresInput_IdenticalApertures_must_be_equal_or_greater_to_one); + } + identicalApertures = value; + } + } /// /// Gets or sets the level of crest of the structures that are not closed.