Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs =================================================================== diff -u -r04d96e936610eab56e9ddc09c055526efe9b9652 -rc33fbb6a840ef596c665774b609f82b948f3b512 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 04d96e936610eab56e9ddc09c055526efe9b9652) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision c33fbb6a840ef596c665774b609f82b948f3b512) @@ -89,7 +89,6 @@ /// length of . /// [m] /// - /// is less than 0. public RoundedDouble EntryPointL { get @@ -98,13 +97,14 @@ } set { - RoundedDouble roundedValue = value.ToPrecision(entryPointL.NumberOfDecimalPlaces); + var newEntryPoint = value.ToPrecision(entryPointL.NumberOfDecimalPlaces); - if (roundedValue < 0.0) + if (!double.IsNaN(exitPointL)) { - throw new ArgumentOutOfRangeException("value", Resources.PipingInput_EntryPointL_Value_must_be_greater_than_or_equal_to_zero); + ValidateEntryExitPoint(newEntryPoint, exitPointL); } - entryPointL = roundedValue; + + entryPointL = newEntryPoint; } } @@ -114,7 +114,6 @@ /// length of . /// [m] /// - /// is less than or equal to 0. public RoundedDouble ExitPointL { get @@ -123,17 +122,25 @@ } set { - RoundedDouble roundedValue = value.ToPrecision(exitPointL.NumberOfDecimalPlaces); + var newExitPoint = value.ToPrecision(exitPointL.NumberOfDecimalPlaces); - if (roundedValue <= 0.0) + if (!double.IsNaN(entryPointL)) { - throw new ArgumentOutOfRangeException("value", Resources.PipingInput_ExitPointL_Value_must_be_greater_than_zero); + ValidateEntryExitPoint(entryPointL, newExitPoint); } - exitPointL = roundedValue; + exitPointL = newExitPoint; } } + private void ValidateEntryExitPoint(RoundedDouble entryPoint, RoundedDouble exitPoint) + { + if (entryPoint >= exitPoint) + { + throw new ArgumentOutOfRangeException(null, Resources.PipingInput_EntryPointL_greater_or_equal_to_ExitPointL); + } + } + /// /// Gets or sets the surface line. ///