Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/DikeProfiles/DikeProfileLocation.cs =================================================================== diff -u -re71f7a8977226f7bdbc146c4e5aac1f13c39e3eb -r5a421e7bb0b0c52d5d1d9ca20d495cd11bfa10e8 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/DikeProfiles/DikeProfileLocation.cs (.../DikeProfileLocation.cs) (revision e71f7a8977226f7bdbc146c4e5aac1f13c39e3eb) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/DikeProfiles/DikeProfileLocation.cs (.../DikeProfileLocation.cs) (revision 5a421e7bb0b0c52d5d1d9ca20d495cd11bfa10e8) @@ -19,7 +19,10 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; +using System.Linq; using Core.Common.Base.Geometry; +using GrasCoverErosionInwardsIoResources = Ringtoets.GrassCoverErosionInwards.IO.Properties.Resources; namespace Ringtoets.GrassCoverErosionInwards.IO.DikeProfiles { @@ -35,8 +38,29 @@ /// The name of this /// The coordinate offset in the local coordinate system for this /// The coordinates of the location as a . + /// + /// The Id parameter is null. + /// The Id parameter contains illegal characters. + /// The Point parameter is null. + /// public DikeProfileLocation(string id, string name, double offset, Point2D point) { + if (id == null) + { + throw new ArgumentException(GrasCoverErosionInwardsIoResources.DikeProfileLocation_DikeProfileLocation_Id_is_null); + } + if (!id.All(char.IsLetterOrDigit)) + { + throw new ArgumentException(GrasCoverErosionInwardsIoResources.DikeProfileLocation_DikeProfileLocation_Id_is_invalid); + } + if (double.IsNaN(offset) || double.IsInfinity(offset)) + { + throw new ArgumentException(GrasCoverErosionInwardsIoResources.DikeProfileLocation_DikeProfileLocation_X0_is_invalid); + } + if (point == null) + { + throw new ArgumentException(GrasCoverErosionInwardsIoResources.DikeProfileLocation_DikeProfileLocation_Point_is_null); + } Id = id; Name = name; Offset = offset;