Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.IO/Model/SerializableAssembly.cs =================================================================== diff -u -ra30b67748bed77736f62b6b3c30c82649bb9cf4e -r6405d29291fd0a248baa49eac46911b0c9bb35af --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.IO/Model/SerializableAssembly.cs (.../SerializableAssembly.cs) (revision a30b67748bed77736f62b6b3c30c82649bb9cf4e) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.IO/Model/SerializableAssembly.cs (.../SerializableAssembly.cs) (revision 6405d29291fd0a248baa49eac46911b0c9bb35af) @@ -24,6 +24,7 @@ using System.Xml.Serialization; using Core.Common.Base.Geometry; using Ringtoets.AssemblyTool.IO.Model.Gml; +using Ringtoets.AssemblyTool.IO.Model.Helpers; namespace Ringtoets.AssemblyTool.IO.Model { @@ -58,8 +59,8 @@ /// belong to the assembly. /// The collection of that /// belong to the assembly. - /// Thrown when is null or empty. - /// Thrown when any parameter except is null. + /// Thrown when is invalid. + /// Thrown when any parameter is null. public SerializableAssembly(string id, Point2D lowerCorner, Point2D upperCorner, @@ -72,9 +73,9 @@ IEnumerable failureMechanismSectionCollections, IEnumerable failureMechanismSections) { - if (string.IsNullOrEmpty(id)) + if (!IdValidator.Validate(id)) { - throw new ArgumentException($@"'{nameof(id)}' must have a value."); + throw new ArgumentException($@"'{nameof(id)}' must have a value and consist only of alphanumerical characters, '-', '_' or '.'."); } if (lowerCorner == null)