Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/Configurations/ClosingStructuresCalculationConfigurationExporter.cs =================================================================== diff -u -rf88343c0590cb04c7135ce141872940e59325927 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/Configurations/ClosingStructuresCalculationConfigurationExporter.cs (.../ClosingStructuresCalculationConfigurationExporter.cs) (revision f88343c0590cb04c7135ce141872940e59325927) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/Configurations/ClosingStructuresCalculationConfigurationExporter.cs (.../ClosingStructuresCalculationConfigurationExporter.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -57,7 +57,7 @@ if (input.Structure != null) { - calculationConfiguration.StructureName = input.Structure.Name; + calculationConfiguration.StructureId = input.Structure.Id; calculationConfiguration.StructureNormalOrientation = input.StructureNormalOrientation; calculationConfiguration.InflowModelType = (ConfigurationClosingStructureInflowModelType?) new ConfigurationClosingStructureInflowModelTypeConverter().ConvertFrom(input.InflowModelType); Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/Configurations/ClosingStructuresCalculationConfigurationImporter.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/Configurations/ClosingStructuresCalculationConfigurationImporter.cs (.../ClosingStructuresCalculationConfigurationImporter.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/Configurations/ClosingStructuresCalculationConfigurationImporter.cs (.../ClosingStructuresCalculationConfigurationImporter.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -114,7 +114,7 @@ Name = readCalculation.Name }; - if (TrySetStructure(readCalculation.StructureName, calculation) + if (TrySetStructure(readCalculation.StructureId, calculation) && TrySetHydraulicBoundaryLocation(readCalculation.HydraulicBoundaryLocationName, calculation) && TrySetForeshoreProfile(readCalculation.ForeshoreProfileId, calculation) && TrySetStochasts(readCalculation, calculation) @@ -444,11 +444,11 @@ return false; } - private bool TrySetStructure(string structureName, StructuresCalculation calculation) + private bool TrySetStructure(string structureId, StructuresCalculation calculation) { ClosingStructure structure; - if (TryReadStructure(structureName, calculation.Name, availableStructures, out structure)) + if (TryReadStructure(structureId, calculation.Name, availableStructures, out structure)) { calculation.InputParameters.Structure = structure; return true; Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/Configurations/ClosingStructuresCalculationConfigurationReader.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/Configurations/ClosingStructuresCalculationConfigurationReader.cs (.../ClosingStructuresCalculationConfigurationReader.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/Configurations/ClosingStructuresCalculationConfigurationReader.cs (.../ClosingStructuresCalculationConfigurationReader.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -107,7 +107,7 @@ IdenticalApertures = calculationElement.GetIntegerValueFromDescendantElement(ClosingStructuresConfigurationSchemaIdentifiers.IdenticalApertures), ForeshoreProfileId = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.ForeshoreProfileNameElement), HydraulicBoundaryLocationName = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.HydraulicBoundaryLocationElement), - StructureName = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.StructureElement), + StructureId = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.StructureElement), WaveReduction = GetWaveReductionParameters(calculationElement), AreaFlowApertures = calculationElement.GetStochastConfiguration(ClosingStructuresConfigurationSchemaIdentifiers.AreaFlowAperturesStochastName), DrainCoefficient = calculationElement.GetStochastConfiguration(ClosingStructuresConfigurationSchemaIdentifiers.DrainCoefficientStochastName), Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil.Test/TestClosingStructureTest.cs =================================================================== diff -u -rf88343c0590cb04c7135ce141872940e59325927 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil.Test/TestClosingStructureTest.cs (.../TestClosingStructureTest.cs) (revision f88343c0590cb04c7135ce141872940e59325927) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil.Test/TestClosingStructureTest.cs (.../TestClosingStructureTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -36,6 +36,7 @@ // Assert Assert.IsInstanceOf(structure); Assert.AreEqual("test", structure.Name); + Assert.AreEqual("id", structure.Id); Assert.AreEqual(new Point2D(12345.56789, 9876.54321), structure.Location); Assert.AreEqual(ClosingStructureInflowModelType.VerticalWall, structure.InflowModelType); AssertTestClosingStructureDefaults(structure); @@ -53,12 +54,32 @@ // Assert Assert.IsInstanceOf(structure); Assert.AreEqual(name, structure.Name); + Assert.AreEqual("id", structure.Id); Assert.AreEqual(new Point2D(12345.56789, 9876.54321), structure.Location); Assert.AreEqual(ClosingStructureInflowModelType.VerticalWall, structure.InflowModelType); AssertTestClosingStructureDefaults(structure); } [Test] + public void Constructor_WithStructureNameAndId_ExpectedValues() + { + // Setup + const string name = ""; + const string id = "(structure); + Assert.AreEqual(name, structure.Name); + Assert.AreEqual(id, structure.Id); + Assert.AreEqual(new Point2D(12345.56789, 9876.54321), structure.Location); + Assert.AreEqual(ClosingStructureInflowModelType.VerticalWall, structure.InflowModelType); + AssertTestClosingStructureDefaults(structure); + } + + [Test] public void Constructor_WithLocation_ExpectedValues() { // Setup @@ -70,6 +91,7 @@ // Assert Assert.IsInstanceOf(structure); Assert.AreEqual("test", structure.Name); + Assert.AreEqual("id", structure.Id); Assert.AreEqual(location, structure.Location); Assert.AreEqual(ClosingStructureInflowModelType.VerticalWall, structure.InflowModelType); AssertTestClosingStructureDefaults(structure); @@ -87,15 +109,14 @@ // Assert Assert.IsInstanceOf(structure); Assert.AreEqual("test", structure.Name); + Assert.AreEqual("id", structure.Id); Assert.AreEqual(new Point2D(12345.56789, 9876.54321), structure.Location); Assert.AreEqual(type, structure.InflowModelType); AssertTestClosingStructureDefaults(structure); } private static void AssertTestClosingStructureDefaults(ClosingStructure structure) { - Assert.AreEqual("id", structure.Id); - Assert.AreEqual(10.0, structure.StructureNormalOrientation.Value); Assert.AreEqual(20000, structure.StorageStructureArea.Mean.Value); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil/TestClosingStructure.cs =================================================================== diff -u -rf88343c0590cb04c7135ce141872940e59325927 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil/TestClosingStructure.cs (.../TestClosingStructure.cs) (revision f88343c0590cb04c7135ce141872940e59325927) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil/TestClosingStructure.cs (.../TestClosingStructure.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Core.Common.Base.Data; using Core.Common.Base.Geometry; @@ -39,33 +40,52 @@ /// Creates a new instance of . /// /// The name of the structure. + /// Thrown when + /// is null, empty or consists of only whitespaces. public TestClosingStructure(string name) - : this(name, new Point2D(12345.56789, 9876.54321), ClosingStructureInflowModelType.VerticalWall) {} + : this(name, "id", new Point2D(12345.56789, 9876.54321), ClosingStructureInflowModelType.VerticalWall) {} /// /// Creates a new instance of . /// + /// The name of the structure. + /// The id of the structure. + /// Thrown when + /// or is null, empty or consists of only whitespaces. + public TestClosingStructure(string name, string id) + : this(name, id, new Point2D(12345.56789, 9876.54321), ClosingStructureInflowModelType.VerticalWall) { } + + /// + /// Creates a new instance of . + /// /// The location of the structure. - public TestClosingStructure(Point2D location) : this("test", location, ClosingStructureInflowModelType.VerticalWall) {} + /// Thrown when + /// is null. + public TestClosingStructure(Point2D location) : this("test", "id", location, ClosingStructureInflowModelType.VerticalWall) {} /// /// Creates a new instance of . /// /// The inflow model type of the structure. public TestClosingStructure(ClosingStructureInflowModelType type) - : this("test", new Point2D(12345.56789, 9876.54321), type) {} + : this("test", "id", new Point2D(12345.56789, 9876.54321), type) {} /// /// Creates a new instance of . /// /// The name of the structure. + /// The id of the structure /// The location of the structure. /// The inflow model type of the structure. - private TestClosingStructure(string name, Point2D location, ClosingStructureInflowModelType type) + /// Thrown when + /// is null. + /// Thrown when + /// or is null, empty or consists of only whitespaces. + private TestClosingStructure(string name, string id, Point2D location, ClosingStructureInflowModelType type) : base(new ConstructionProperties { Name = name, - Id = "id", + Id = id, Location = location, StorageStructureArea = { Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationExporterTest.cs =================================================================== diff -u -rf88343c0590cb04c7135ce141872940e59325927 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationExporterTest.cs (.../ClosingStructuresCalculationConfigurationExporterTest.cs) (revision f88343c0590cb04c7135ce141872940e59325927) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationExporterTest.cs (.../ClosingStructuresCalculationConfigurationExporterTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -125,7 +125,7 @@ InputParameters = { HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation("Locatie1"), - Structure = new TestClosingStructure("kunstwerk1"), + Structure = new TestClosingStructure("kunstwerk1", "kunstwerk1"), ForeshoreProfile = new TestForeshoreProfile("profiel1"), FailureProbabilityStructureWithErosion = 1e-4, StructureNormalOrientation = (RoundedDouble) 67.1, @@ -245,7 +245,7 @@ Name = "with structure", InputParameters = { - Structure = new TestClosingStructure("kunstwerk1") + Structure = new TestClosingStructure("kunstwerk1", "kunstwerk1") } }; } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationImporterTest.cs =================================================================== diff -u -rde6048a31dbe63930a6ea68b04a4f37879333106 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationImporterTest.cs (.../ClosingStructuresCalculationConfigurationImporterTest.cs) (revision de6048a31dbe63930a6ea68b04a4f37879333106) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationImporterTest.cs (.../ClosingStructuresCalculationConfigurationImporterTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -219,7 +219,7 @@ Enumerable.Empty(), new ClosingStructuresFailureMechanism()); - // Assert + // AssertTC Assert.IsInstanceOf>(importer); } @@ -296,7 +296,7 @@ string filePath = Path.Combine(importerPath, file); var calculationGroup = new CalculationGroup(); - var structure = new TestClosingStructure("kunstwerk1"); + var structure = new TestClosingStructure("kunstwerk1", "kunstwerk1"); var foreshoreProfile = new TestForeshoreProfile("profiel 1"); var importer = new ClosingStructuresCalculationConfigurationImporter(filePath, @@ -366,7 +366,7 @@ { new Point2D(0, 3) }); - var structure = new TestClosingStructure("kunstwerk1"); + var structure = new TestClosingStructure("kunstwerk1", "kunstwerk1"); var importer = new ClosingStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -483,7 +483,7 @@ string filePath = Path.Combine(importerPath, "validConfigurationStochastMeansOnly.xml"); var calculationGroup = new CalculationGroup(); - var structure = new TestClosingStructure("kunstwerk1"); + var structure = new TestClosingStructure("kunstwerk1", "kunstwerk1"); var importer = new ClosingStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -568,7 +568,7 @@ string filePath = Path.Combine(importerPath, "validConfigurationStochastStandardDeviationVariationCoefficientOnly.xml"); var calculationGroup = new CalculationGroup(); - var structure = new TestClosingStructure("kunstwerk1"); + var structure = new TestClosingStructure("kunstwerk1", "kunstwerk1"); var importer = new ClosingStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -645,7 +645,7 @@ string filePath = Path.Combine(importerPath, file); var calculationGroup = new CalculationGroup(); - var structure = new TestClosingStructure("kunstwerk1"); + var structure = new TestClosingStructure("kunstwerk1", "kunstwerk1"); var importer = new ClosingStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -676,7 +676,7 @@ [TestCase("validConfigurationUnknownHydraulicBoundaryLocation.xml", "De locatie met hydraulische randvoorwaarden 'unknown' bestaat niet.")] [TestCase("validConfigurationUnknownStructure.xml", - "Het kunstwerk 'unknown' bestaat niet.")] + "Het kunstwerk met ID 'unknown' bestaat niet.")] public void Import_ValidConfigurationUnknownData_LogMessageAndContinueImport(string file, string expectedErrorMessage) { // Setup Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationReaderTest.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationReaderTest.cs (.../ClosingStructuresCalculationConfigurationReaderTest.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationReaderTest.cs (.../ClosingStructuresCalculationConfigurationReaderTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -305,7 +305,7 @@ var calculation = (ClosingStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.IsNull(calculation.StructureNormalOrientation); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.IsNull(calculation.HydraulicBoundaryLocationName); Assert.IsNull(calculation.ForeshoreProfileId); Assert.IsNull(calculation.FailureProbabilityStructureWithErosion); @@ -339,7 +339,7 @@ var calculation = (ClosingStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.AreEqual(67.1, calculation.StructureNormalOrientation); - Assert.AreEqual("kunstwerk1", calculation.StructureName); + Assert.AreEqual("kunstwerk1", calculation.StructureId); Assert.AreEqual("Locatie1", calculation.HydraulicBoundaryLocationName); Assert.AreEqual("profiel1", calculation.ForeshoreProfileId); Assert.AreEqual(0.002, calculation.FactorStormDurationOpenStructure); @@ -397,7 +397,7 @@ var calculation = (ClosingStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.IsTrue(double.IsNegativeInfinity(calculation.StructureNormalOrientation.Value)); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.IsNull(calculation.HydraulicBoundaryLocationName); Assert.IsNull(calculation.ForeshoreProfileId); Assert.IsTrue(double.IsPositiveInfinity(calculation.FactorStormDurationOpenStructure.Value)); @@ -453,7 +453,7 @@ var calculation = (ClosingStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.IsNaN(calculation.StructureNormalOrientation); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.IsNull(calculation.HydraulicBoundaryLocationName); Assert.IsNull(calculation.ForeshoreProfileId); Assert.IsNaN(calculation.FactorStormDurationOpenStructure); @@ -509,7 +509,7 @@ var calculation = (ClosingStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.IsNull(calculation.StructureNormalOrientation); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.AreEqual("Locatie1", calculation.HydraulicBoundaryLocationName); Assert.AreEqual("profiel1", calculation.ForeshoreProfileId); Assert.IsNull(calculation.FailureProbabilityStructureWithErosion); @@ -560,7 +560,7 @@ var calculation = (ClosingStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.IsNull(calculation.StructureNormalOrientation); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.IsNull(calculation.HydraulicBoundaryLocationName); Assert.IsNull(calculation.ForeshoreProfileId); Assert.IsNull(calculation.FailureProbabilityStructureWithErosion); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationWriterTest.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationWriterTest.cs (.../ClosingStructuresCalculationConfigurationWriterTest.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationConfigurationWriterTest.cs (.../ClosingStructuresCalculationConfigurationWriterTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -108,7 +108,7 @@ return new ClosingStructuresCalculationConfiguration("Berekening 1") { HydraulicBoundaryLocationName = "Locatie1", - StructureName = "kunstwerk1", + StructureId = "kunstwerk1", ForeshoreProfileId = "profiel1", FailureProbabilityStructureWithErosion = 1e-4, StructureNormalOrientation = 67.1, Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationStochastAssignerTest.cs =================================================================== diff -u -rf88343c0590cb04c7135ce141872940e59325927 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationStochastAssignerTest.cs (.../ClosingStructuresCalculationStochastAssignerTest.cs) (revision f88343c0590cb04c7135ce141872940e59325927) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.IO.Test/Configurations/ClosingStructuresCalculationStochastAssignerTest.cs (.../ClosingStructuresCalculationStochastAssignerTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -93,7 +93,7 @@ // Setup var configuration = new ClosingStructuresCalculationConfiguration("name") { - StructureName = "some structure" + StructureId = "some structure" }; modify(configuration); @@ -118,7 +118,7 @@ // Setup var configuration = new ClosingStructuresCalculationConfiguration("name") { - StructureName = "some structure" + StructureId = "some structure" }; configuration.DrainCoefficient = new StochastConfiguration(); configuration.DrainCoefficient.Mean = 8.1; @@ -154,7 +154,7 @@ // Setup var configuration = new ClosingStructuresCalculationConfiguration("name") { - StructureName = "some structure", + StructureId = "some structure", LevelCrestStructureNotClosing = new StochastConfiguration { Mean = 1.1, Index: Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/Export/StructureCalculationConfigurationWriter.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/Export/StructureCalculationConfigurationWriter.cs (.../StructureCalculationConfigurationWriter.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/Export/StructureCalculationConfigurationWriter.cs (.../StructureCalculationConfigurationWriter.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -81,7 +81,7 @@ configuration.HydraulicBoundaryLocationName); WriteElementWhenContentAvailable(writer, ConfigurationSchemaIdentifiers.StructureElement, - configuration.StructureName); + configuration.StructureId); WriteElementWhenContentAvailable(writer, ConfigurationSchemaIdentifiers.Orientation, configuration.StructureNormalOrientation); Index: Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/Import/CalculationConfigurationImporter.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/Import/CalculationConfigurationImporter.cs (.../CalculationConfigurationImporter.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/Import/CalculationConfigurationImporter.cs (.../CalculationConfigurationImporter.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -170,21 +170,21 @@ } /// - /// Tries to find the structure with the given + /// Tries to find the structure with the given /// in the . /// /// The type of the to read. - /// The name of the structure to find. + /// The id of the structure to find. /// Name of the calculation to assign the structure to. /// The collection of to search in. - /// The structure with the name equal to + /// The structure with the name equal to /// if there was any. - /// true if no is given, or when a structure with - /// the name was found, false otherwise. + /// true if no is given, or when a structure with + /// the name was found, false otherwise. /// Thrown when /// or is null. protected bool TryReadStructure( - string structureName, + string structureId, string calculationName, IEnumerable structures, out T foundStructure) @@ -199,15 +199,15 @@ throw new ArgumentNullException(nameof(structures)); } foundStructure = null; - if (structureName != null) + if (structureId != null) { - T structure = structures.FirstOrDefault(l => l.Name == structureName); + T structure = structures.FirstOrDefault(l => l.Id == structureId); if (structure == null) { Log.LogCalculationConversionError(string.Format( Resources.CalculationConfigurationImporter_ReadStructure_Structure_0_does_not_exist, - structureName), + structureId), calculationName); return false; Index: Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/StructuresCalculationConfiguration.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/StructuresCalculationConfiguration.cs (.../StructuresCalculationConfiguration.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/StructuresCalculationConfiguration.cs (.../StructuresCalculationConfiguration.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -41,9 +41,9 @@ } /// - /// Gets or sets the name of the structure. + /// Gets or sets the Id of the structure. /// - public string StructureName { get; set; } + public string StructureId { get; set; } /// /// Gets or sets the name of the hydraulic boundary location. Index: Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/StructuresCalculationStochastAssigner.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/StructuresCalculationStochastAssigner.cs (.../StructuresCalculationStochastAssigner.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/StructuresCalculationStochastAssigner.cs (.../StructuresCalculationStochastAssigner.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -119,7 +119,7 @@ { return ValidateBaseStochasts() && ValidateSpecificStochasts() - && (Configuration.StructureName != null || GetStochastsForParameterValidation().All(ValidateNoParametersDefined)); + && (Configuration.StructureId != null || GetStochastsForParameterValidation().All(ValidateNoParametersDefined)); } private bool SetVariationCoefficientStochast(VariationCoefficientDefinition definition) Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs =================================================================== diff -u -r96708dc3012a1398efc8829a487369abc24a64c1 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 96708dc3012a1398efc8829a487369abc24a64c1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -216,7 +216,7 @@ } /// - /// Looks up a localized string similar to Het kunstwerk '{0}' bestaat niet.. + /// Looks up a localized string similar to Het kunstwerk met ID '{0}' bestaat niet.. /// public static string CalculationConfigurationImporter_ReadStructure_Structure_0_does_not_exist { get { @@ -1404,14 +1404,14 @@ } /// - /// Looks up a localized string similar to BEGIN TRANSACTION; - ///CREATE TABLE "TimeIntegrationSettings" ( - /// "LocationID" INTEGER NOT NULL, - /// "CalculationTypeID" INTEGER NOT NULL, - /// "TimeIntegrationSchemeID" INTEGER NOT NULL, - /// CONSTRAINT timeintegrationsettings_pk PRIMARY KEY ("LocationID", "CalculationTypeID"), - /// CONSTRAINT calculationtypes_timeintegrationsettings_fk FOREIGN KEY ("CalculationTypeID") REFERENCES CalculationTypes ("CalculationTypeID") ON DELETE NO ACTION ON UPDATE NO ACTION - ///); + /// Looks up a localized string similar to BEGIN TRANSACTION; + ///CREATE TABLE "TimeIntegrationSettings" ( + /// "LocationID" INTEGER NOT NULL, + /// "CalculationTypeID" INTEGER NOT NULL, + /// "TimeIntegrationSchemeID" INTEGER NOT NULL, + /// CONSTRAINT timeintegrationsettings_pk PRIMARY KEY ("LocationID", "CalculationTypeID"), + /// CONSTRAINT calculationtypes_timeintegrationsettings_fk FOREIGN KEY ("CalculationTypeID") REFERENCES CalculationTypes ("CalculationTypeID") ON DELETE NO ACTION ON UPDATE NO ACTION + ///); ///CREATE TABLE "Numeri [rest of string was truncated]";. /// public static string settings_schema { Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx =================================================================== diff -u -r96708dc3012a1398efc8829a487369abc24a64c1 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision 96708dc3012a1398efc8829a487369abc24a64c1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -551,7 +551,7 @@ De locatie met hydraulische randvoorwaarden '{0}' bestaat niet. - Het kunstwerk '{0}' bestaat niet. + Het kunstwerk met ID '{0}' bestaat niet. {0} importeren afgebroken. Geen data ingelezen. Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Export/StructureCalculationConfigurationWriterTest.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Export/StructureCalculationConfigurationWriterTest.cs (.../StructureCalculationConfigurationWriterTest.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Export/StructureCalculationConfigurationWriterTest.cs (.../StructureCalculationConfigurationWriterTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -144,7 +144,7 @@ VariationCoefficient = 1.2 }, StructureNormalOrientation = 5.6, - StructureName = "Kunstwerk", + StructureId = "Kunstwerk", WaveReduction = new WaveReductionConfiguration { BreakWaterType = ConfigurationBreakWaterType.Caisson, Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Import/CalculationConfigurationImporterTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Import/CalculationConfigurationImporterTest.cs (.../CalculationConfigurationImporterTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Import/CalculationConfigurationImporterTest.cs (.../CalculationConfigurationImporterTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -661,14 +661,14 @@ StructureBase profile = null; var valid = true; - const string structureName = "someName"; + const string structureId = "someAwesomeId"; const string calculationName = "name"; // Call - Action validate = () => valid = importer.PublicTryReadStructure(structureName, calculationName, Enumerable.Empty(), out profile); + Action validate = () => valid = importer.PublicTryReadStructure(structureId, calculationName, Enumerable.Empty(), out profile); // Assert - string expectedMessage = $"Het kunstwerk '{structureName}' bestaat niet. Berekening '{calculationName}' is overgeslagen."; + string expectedMessage = $"Het kunstwerk met ID '{structureId}' bestaat niet. Berekening '{calculationName}' is overgeslagen."; TestHelper.AssertLogMessageWithLevelIsGenerated(validate, Tuple.Create(expectedMessage, LogLevelConstant.Error)); Assert.IsFalse(valid); Assert.IsNull(profile); @@ -867,10 +867,10 @@ private class TestStructure : StructureBase { - public TestStructure(string name) : base(new ConstructionProperties + public TestStructure(string Id) : base(new ConstructionProperties { - Name = name, - Id = "Id", + Name = "Name", + Id = Id, Location = new Point2D(0, 0), StructureNormalOrientation = (RoundedDouble) 2 }) {} Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/StructureCalculationConfigurationTest.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/StructureCalculationConfigurationTest.cs (.../StructureCalculationConfigurationTest.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/StructureCalculationConfigurationTest.cs (.../StructureCalculationConfigurationTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -51,7 +51,7 @@ Assert.IsInstanceOf(configuration); Assert.AreEqual(name, configuration.Name); Assert.IsNull(configuration.ModelFactorSuperCriticalFlow); - Assert.IsNull(configuration.StructureName); + Assert.IsNull(configuration.StructureId); Assert.IsNull(configuration.HydraulicBoundaryLocationName); Assert.IsNull(configuration.StormDuration); Assert.IsNull(configuration.StructureNormalOrientation); @@ -72,7 +72,7 @@ const string configurationName = "some name"; var configuration = new SimpleStructuresCalculationConfiguration(configurationName); - const string structureName = "some structure"; + const string structureId = "some structure"; const string hydraulicBoundaryLocationName = "some hydraulic boundary location"; const string foreshoreProfileName = "some foreshore profile"; @@ -93,7 +93,7 @@ configuration.Name = configurationName; configuration.ModelFactorSuperCriticalFlow = modelFactorSuperCriticalFlow; configuration.StormDuration = stormDuration; - configuration.StructureName = structureName; + configuration.StructureId = structureId; configuration.HydraulicBoundaryLocationName = hydraulicBoundaryLocationName; configuration.StructureNormalOrientation = structureNormalOrientation; configuration.AllowedLevelIncreaseStorage = allowedLevelIncreaseStorage; @@ -109,7 +109,7 @@ Assert.AreEqual(configurationName, configuration.Name); Assert.AreSame(modelFactorSuperCriticalFlow, configuration.ModelFactorSuperCriticalFlow); Assert.AreSame(stormDuration, configuration.StormDuration); - Assert.AreEqual(structureName, configuration.StructureName); + Assert.AreEqual(structureId, configuration.StructureId); Assert.AreEqual(hydraulicBoundaryLocationName, configuration.HydraulicBoundaryLocationName); Assert.AreEqual(structureNormalOrientation, configuration.StructureNormalOrientation); Assert.AreSame(allowedLevelIncreaseStorage, configuration.AllowedLevelIncreaseStorage); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/StructuresCalculationStochastAssignerTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/StructuresCalculationStochastAssignerTest.cs (.../StructuresCalculationStochastAssignerTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/StructuresCalculationStochastAssignerTest.cs (.../StructuresCalculationStochastAssignerTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -244,7 +244,7 @@ var configuration = mocks.Stub(calculationName); mocks.ReplayAll(); - configuration.StructureName = "some name"; + configuration.StructureId = "some ID"; var calculation = new StructuresCalculation(); @@ -303,7 +303,7 @@ var configuration = mocks.Stub(calculationName); mocks.ReplayAll(); - configuration.StructureName = "some name"; + configuration.StructureId = "some ID"; var random = new Random(21); double allowedLevelIncreaseStorageMean = setStandardDeviationStochastSuccessful ? random.NextDouble() : -1; Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationExporter.cs =================================================================== diff -u -r4bf59bb3506b840b284efe0c0f4431b7876e0e5b -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationExporter.cs (.../HeightStructuresCalculationConfigurationExporter.cs) (revision 4bf59bb3506b840b284efe0c0f4431b7876e0e5b) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationExporter.cs (.../HeightStructuresCalculationConfigurationExporter.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -55,7 +55,7 @@ if (input.Structure != null) { - calculationConfiguration.StructureName = input.Structure.Name; + calculationConfiguration.StructureId = input.Structure.Name; calculationConfiguration.StructureNormalOrientation = input.StructureNormalOrientation; calculationConfiguration.FailureProbabilityStructureWithErosion = input.FailureProbabilityStructureWithErosion; Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationImporter.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationImporter.cs (.../HeightStructuresCalculationConfigurationImporter.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationImporter.cs (.../HeightStructuresCalculationConfigurationImporter.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -113,7 +113,7 @@ Name = readCalculation.Name }; - if (TrySetStructure(readCalculation.StructureName, calculation) + if (TrySetStructure(readCalculation.StructureId, calculation) && TrySetHydraulicBoundaryLocation(readCalculation.HydraulicBoundaryLocationName, calculation) && TrySetForeshoreProfile(readCalculation.ForeshoreProfileId, calculation) && TrySetStochasts(readCalculation, calculation) @@ -239,11 +239,11 @@ return false; } - private bool TrySetStructure(string structureName, StructuresCalculation calculation) + private bool TrySetStructure(string structureId, StructuresCalculation calculation) { HeightStructure structure; - if (TryReadStructure(structureName, calculation.Name, availableStructures, out structure)) + if (TryReadStructure(structureId, calculation.Name, availableStructures, out structure)) { calculation.InputParameters.Structure = structure; return true; Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationReader.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationReader.cs (.../HeightStructuresCalculationConfigurationReader.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationReader.cs (.../HeightStructuresCalculationConfigurationReader.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -98,7 +98,7 @@ configuration.ForeshoreProfileId = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.ForeshoreProfileNameElement); configuration.HydraulicBoundaryLocationName = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.HydraulicBoundaryLocationElement); - configuration.StructureName = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.StructureElement); + configuration.StructureId = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.StructureElement); configuration.WaveReduction = GetWaveReductionParameters(calculationElement); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/TestHeightStructureTest.cs =================================================================== diff -u -r4bf59bb3506b840b284efe0c0f4431b7876e0e5b -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/TestHeightStructureTest.cs (.../TestHeightStructureTest.cs) (revision 4bf59bb3506b840b284efe0c0f4431b7876e0e5b) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/TestHeightStructureTest.cs (.../TestHeightStructureTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -40,7 +40,7 @@ var heightStructure = new TestHeightStructure(); // Assert - AssertTestHeightStructure(heightStructure, expectedName, expectedLocation); + AssertTestHeightStructure(heightStructure, expectedName, "Id", expectedLocation); } [Test] @@ -54,7 +54,7 @@ var heightStructure = new TestHeightStructure(customLocation); // Assert - AssertTestHeightStructure(heightStructure, expectedName, customLocation); + AssertTestHeightStructure(heightStructure, expectedName, "Id", customLocation); } [Test] @@ -68,28 +68,30 @@ var heightStructure = new TestHeightStructure(customName); // Assert - AssertTestHeightStructure(heightStructure, customName, expectedLocation); + AssertTestHeightStructure(heightStructure, customName, "Id", expectedLocation); } [Test] public void Constructor_CustomNameAndLocation_ExpectedValues() { // Setup const string customName = "A different name for structure"; + const string customId = "an different id for structure"; var customLocation = new Point2D(10, 20); // Call - var heightStructure = new TestHeightStructure(customName, customLocation); + var heightStructure = new TestHeightStructure(customName, customId, customLocation); // Assert - AssertTestHeightStructure(heightStructure, customName, customLocation); + AssertTestHeightStructure(heightStructure, customName, customId, customLocation); } - private static void AssertTestHeightStructure(TestHeightStructure heightStructure, string expectedName, Point2D expectedLocation) + private static void AssertTestHeightStructure(TestHeightStructure heightStructure, string expectedName, + string expectedId, Point2D expectedLocation) { Assert.IsInstanceOf(heightStructure); Assert.AreEqual(expectedName, heightStructure.Name); - Assert.AreEqual("Id", heightStructure.Id); + Assert.AreEqual(expectedId, heightStructure.Id); Assert.AreEqual(expectedLocation.X, heightStructure.Location.X); Assert.AreEqual(expectedLocation.Y, heightStructure.Location.Y); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructure.cs =================================================================== diff -u -r4bf59bb3506b840b284efe0c0f4431b7876e0e5b -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructure.cs (.../TestHeightStructure.cs) (revision 4bf59bb3506b840b284efe0c0f4431b7876e0e5b) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructure.cs (.../TestHeightStructure.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Core.Common.Base.Data; using Core.Common.Base.Geometry; @@ -39,26 +40,57 @@ /// Creates a new instance of . /// /// The name of the structure. + /// Thrown when + /// is null, empty or consists of only whitespaces. public TestHeightStructure(string name) - : this(name, new Point2D(0.0, 0.0)) {} + : this(name, "Id", new Point2D(0.0, 0.0)) {} /// /// Creates a new instance of . /// + /// The name of the structure. + /// The id of the structure. + /// Thrown when + /// or is null, empty or consists of only whitespaces. + public TestHeightStructure(string name, string id) + : this(name, id, new Point2D(0.0, 0.0)) {} + + /// + /// Creates a new instance of . + /// /// The location of the structure. + /// Thrown when + /// is null. public TestHeightStructure(Point2D location) - : this("Test", location) {} + : this("Test", "Id", location) {} /// /// Creates a new instance of . /// + /// The location of the structure. + /// The id of the structure. + /// Thrown when + /// is null. + /// Thrown when + /// is null, empty or consists of only whitespaces. + public TestHeightStructure(Point2D location, string id) + : this("Test", id, location) {} + + /// + /// Creates a new instance of . + /// /// The name of the structure. + /// The id of the structure. /// The location of the structure. - public TestHeightStructure(string name, Point2D location) + /// Thrown when + /// is null. + /// Thrown when + /// or is null, empty or consists of only whitespaces. + public TestHeightStructure(string name, string id, Point2D location) : base(new ConstructionProperties { Name = name, - Id = "Id", + Id = id, Location = location, StructureNormalOrientation = (RoundedDouble) 0.12345, LevelCrestStructure = Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationImporterTest.cs =================================================================== diff -u -rde6048a31dbe63930a6ea68b04a4f37879333106 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationImporterTest.cs (.../HeightStructuresCalculationConfigurationImporterTest.cs) (revision de6048a31dbe63930a6ea68b04a4f37879333106) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationImporterTest.cs (.../HeightStructuresCalculationConfigurationImporterTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -240,7 +240,7 @@ string filePath = Path.Combine(importerPath, file); var calculationGroup = new CalculationGroup(); - var structure = new TestHeightStructure("kunstwerk1"); + var structure = new TestHeightStructure("kunstwerk1", "kunstwerk1"); var foreshoreProfile = new TestForeshoreProfile("profiel 1"); var importer = new HeightStructuresCalculationConfigurationImporter(filePath, @@ -310,7 +310,7 @@ { new Point2D(0, 3) }); - var structure = new TestHeightStructure("kunstwerk1"); + var structure = new TestHeightStructure("kunstwerk1", "kunstwerk1"); var importer = new HeightStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -402,7 +402,7 @@ string filePath = Path.Combine(importerPath, "validConfigurationStochastMeansOnly.xml"); var calculationGroup = new CalculationGroup(); - var structure = new TestHeightStructure("kunstwerk1"); + var structure = new TestHeightStructure("kunstwerk1", "kunstwerk1"); var importer = new HeightStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -471,7 +471,7 @@ string filePath = Path.Combine(importerPath, "validConfigurationStochastStandardDeviationVariationCoefficientOnly.xml"); var calculationGroup = new CalculationGroup(); - var structure = new TestHeightStructure("kunstwerk1"); + var structure = new TestHeightStructure("kunstwerk1", "kunstwerk1"); var importer = new HeightStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -536,7 +536,7 @@ string filePath = Path.Combine(importerPath, file); var calculationGroup = new CalculationGroup(); - var structure = new TestHeightStructure("kunstwerk1"); + var structure = new TestHeightStructure("kunstwerk1", "kunstwerk1"); var importer = new HeightStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -567,7 +567,7 @@ [TestCase("validConfigurationUnknownHydraulicBoundaryLocation.xml", "De locatie met hydraulische randvoorwaarden 'unknown' bestaat niet.")] [TestCase("validConfigurationUnknownStructure.xml", - "Het kunstwerk 'unknown' bestaat niet.")] + "Het kunstwerk met ID 'unknown' bestaat niet.")] public void Import_ValidConfigurationUnknownData_LogMessageAndContinueImport(string file, string expectedErrorMessage) { // Setup Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationReaderTest.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationReaderTest.cs (.../HeightStructuresCalculationConfigurationReaderTest.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationReaderTest.cs (.../HeightStructuresCalculationConfigurationReaderTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -231,7 +231,7 @@ var calculation = (HeightStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.IsNull(calculation.StructureNormalOrientation); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.IsNull(calculation.HydraulicBoundaryLocationName); Assert.IsNull(calculation.ForeshoreProfileId); Assert.IsNull(calculation.FailureProbabilityStructureWithErosion); @@ -265,7 +265,7 @@ var calculation = (HeightStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.AreEqual(67.1, calculation.StructureNormalOrientation); - Assert.AreEqual("kunstwerk1", calculation.StructureName); + Assert.AreEqual("kunstwerk1", calculation.StructureId); Assert.AreEqual("Locatie1", calculation.HydraulicBoundaryLocationName); Assert.AreEqual("profiel1", calculation.ForeshoreProfileId); Assert.AreEqual(1e-6, calculation.FailureProbabilityStructureWithErosion); @@ -309,7 +309,7 @@ var calculation = (HeightStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.IsTrue(double.IsNegativeInfinity(calculation.StructureNormalOrientation.Value)); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.IsNull(calculation.HydraulicBoundaryLocationName); Assert.IsNull(calculation.ForeshoreProfileId); Assert.IsTrue(double.IsNegativeInfinity(calculation.FailureProbabilityStructureWithErosion.Value)); @@ -353,7 +353,7 @@ var calculation = (HeightStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.IsNaN(calculation.StructureNormalOrientation); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.IsNull(calculation.HydraulicBoundaryLocationName); Assert.IsNull(calculation.ForeshoreProfileId); Assert.IsNaN(calculation.FailureProbabilityStructureWithErosion); @@ -397,7 +397,7 @@ var calculation = (HeightStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.IsNull(calculation.StructureNormalOrientation); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.AreEqual("Locatie1", calculation.HydraulicBoundaryLocationName); Assert.AreEqual("profiel1", calculation.ForeshoreProfileId); Assert.IsNull(calculation.FailureProbabilityStructureWithErosion); @@ -437,7 +437,7 @@ var calculation = (HeightStructuresCalculationConfiguration) readConfigurationItems[0]; Assert.IsNull(calculation.StructureNormalOrientation); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.IsNull(calculation.HydraulicBoundaryLocationName); Assert.IsNull(calculation.ForeshoreProfileId); Assert.IsNull(calculation.FailureProbabilityStructureWithErosion); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationWriterTest.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationWriterTest.cs (.../HeightStructuresCalculationConfigurationWriterTest.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationWriterTest.cs (.../HeightStructuresCalculationConfigurationWriterTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -108,7 +108,7 @@ return new HeightStructuresCalculationConfiguration("Berekening 1") { HydraulicBoundaryLocationName = "Locatie1", - StructureName = "kunstwerk1", + StructureId = "kunstwerk1", ForeshoreProfileId = "profiel1", FailureProbabilityStructureWithErosion = 1e-6, StructureNormalOrientation = 67.1, Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationStochastAssignerTest.cs =================================================================== diff -u -r4bf59bb3506b840b284efe0c0f4431b7876e0e5b -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationStochastAssignerTest.cs (.../HeightStructuresCalculationStochastAssignerTest.cs) (revision 4bf59bb3506b840b284efe0c0f4431b7876e0e5b) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationStochastAssignerTest.cs (.../HeightStructuresCalculationStochastAssignerTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -92,7 +92,7 @@ // Setup var configuration = new HeightStructuresCalculationConfiguration("name") { - StructureName = "some structure" + StructureId = "some structure" }; modify(configuration); @@ -115,7 +115,7 @@ // Setup var configuration = new HeightStructuresCalculationConfiguration("name") { - StructureName = "some structure", + StructureId = "some structure", LevelCrestStructure = new StochastConfiguration { Mean = 1.1, Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Configurations/StabilityPointStructuresCalculationConfigurationExporter.cs =================================================================== diff -u -rff948d4633181ead2677ab35467a93b4118c6751 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Configurations/StabilityPointStructuresCalculationConfigurationExporter.cs (.../StabilityPointStructuresCalculationConfigurationExporter.cs) (revision ff948d4633181ead2677ab35467a93b4118c6751) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Configurations/StabilityPointStructuresCalculationConfigurationExporter.cs (.../StabilityPointStructuresCalculationConfigurationExporter.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -120,7 +120,7 @@ calculationConfiguration.StabilityLinearLoadModel = input.StabilityLinearLoadModel.ToStochastConfiguration(); calculationConfiguration.StabilityQuadraticLoadModel = input.StabilityQuadraticLoadModel.ToStochastConfiguration(); calculationConfiguration.StorageStructureArea = input.StorageStructureArea.ToStochastConfiguration(); - calculationConfiguration.StructureName = input.Structure.Name; + calculationConfiguration.StructureId = input.Structure.Id; calculationConfiguration.StructureNormalOrientation = input.StructureNormalOrientation; calculationConfiguration.ThresholdHeightOpenWeir = input.ThresholdHeightOpenWeir.ToStochastConfiguration(); Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Configurations/StabilityPointStructuresCalculationConfigurationImporter.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Configurations/StabilityPointStructuresCalculationConfigurationImporter.cs (.../StabilityPointStructuresCalculationConfigurationImporter.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Configurations/StabilityPointStructuresCalculationConfigurationImporter.cs (.../StabilityPointStructuresCalculationConfigurationImporter.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -118,7 +118,7 @@ Name = readCalculation.Name }; - if (TrySetStructure(readCalculation.StructureName, calculation) + if (TrySetStructure(readCalculation.StructureId, calculation) && TrySetHydraulicBoundaryLocation(readCalculation.HydraulicBoundaryLocationName, calculation) && TrySetForeshoreProfile(readCalculation.ForeshoreProfileId, calculation) && TrySetEvaluationLevel(readCalculation, calculation) @@ -495,11 +495,11 @@ return false; } - private bool TrySetStructure(string structureName, StructuresCalculation calculation) + private bool TrySetStructure(string structureId, StructuresCalculation calculation) { StabilityPointStructure structure; - if (TryReadStructure(structureName, calculation.Name, availableStructures, out structure)) + if (TryReadStructure(structureId, calculation.Name, availableStructures, out structure)) { calculation.InputParameters.Structure = structure; return true; Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Configurations/StabilityPointStructuresCalculationConfigurationReader.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Configurations/StabilityPointStructuresCalculationConfigurationReader.cs (.../StabilityPointStructuresCalculationConfigurationReader.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Configurations/StabilityPointStructuresCalculationConfigurationReader.cs (.../StabilityPointStructuresCalculationConfigurationReader.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -128,7 +128,7 @@ ShipVelocity = calculationElement.GetStochastConfiguration(StabilityPointStructuresConfigurationSchemaIdentifiers.ShipVelocityStochastName), StabilityLinearLoadModel = calculationElement.GetStochastConfiguration(StabilityPointStructuresConfigurationSchemaIdentifiers.StabilityLinearLoadModelStochastName), StabilityQuadraticLoadModel = calculationElement.GetStochastConfiguration(StabilityPointStructuresConfigurationSchemaIdentifiers.StabilityQuadraticLoadModelStochastName), - StructureName = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.StructureElement), + StructureId = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.StructureElement), StorageStructureArea = calculationElement.GetStochastConfiguration(ConfigurationSchemaIdentifiers.StorageStructureAreaStochastName), StormDuration = calculationElement.GetStochastConfiguration(ConfigurationSchemaIdentifiers.StormDurationStochastName), StructureNormalOrientation = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.Orientation), Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil.Test/TestStabilityPointStructureTest.cs =================================================================== diff -u -rff948d4633181ead2677ab35467a93b4118c6751 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil.Test/TestStabilityPointStructureTest.cs (.../TestStabilityPointStructureTest.cs) (revision ff948d4633181ead2677ab35467a93b4118c6751) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil.Test/TestStabilityPointStructureTest.cs (.../TestStabilityPointStructureTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -40,74 +40,7 @@ Assert.AreEqual("aName", structure.Name); Assert.AreEqual("anId", structure.Id); Assert.AreEqual(new Point2D(1.234, 2.3456), structure.Location); - AssertAreEqual(123.456, structure.StructureNormalOrientation); - - AssertAreEqual(234.567, structure.StorageStructureArea.Mean); - AssertAreEqual(0.234, structure.StorageStructureArea.CoefficientOfVariation); - - AssertAreEqual(345.678, structure.AllowedLevelIncreaseStorage.Mean); - AssertAreEqual(0.35, structure.AllowedLevelIncreaseStorage.StandardDeviation); - - AssertAreEqual(456.789, structure.WidthFlowApertures.Mean); - AssertAreEqual(0.456, structure.WidthFlowApertures.StandardDeviation); - - AssertAreEqual(567.890, structure.InsideWaterLevel.Mean); - AssertAreEqual(0.567, structure.InsideWaterLevel.StandardDeviation); - - AssertAreEqual(678.901, structure.ThresholdHeightOpenWeir.Mean); - AssertAreEqual(0.678, structure.ThresholdHeightOpenWeir.StandardDeviation); - - AssertAreEqual(789.012, structure.CriticalOvertoppingDischarge.Mean); - AssertAreEqual(0.789, structure.CriticalOvertoppingDischarge.CoefficientOfVariation); - - AssertAreEqual(890.123, structure.FlowWidthAtBottomProtection.Mean); - AssertAreEqual(0.890, structure.FlowWidthAtBottomProtection.StandardDeviation); - - AssertAreEqual(901.234, structure.ConstructiveStrengthLinearLoadModel.Mean); - AssertAreEqual(0.901, structure.ConstructiveStrengthLinearLoadModel.CoefficientOfVariation); - - AssertAreEqual(123.456, structure.ConstructiveStrengthQuadraticLoadModel.Mean); - AssertAreEqual(0.123, structure.ConstructiveStrengthQuadraticLoadModel.CoefficientOfVariation); - - AssertAreEqual(234.567, structure.BankWidth.Mean); - AssertAreEqual(0.234, structure.BankWidth.StandardDeviation); - - AssertAreEqual(345.678, structure.InsideWaterLevelFailureConstruction.Mean); - AssertAreEqual(0.35, structure.InsideWaterLevelFailureConstruction.StandardDeviation); - - AssertAreEqual(555.555, structure.EvaluationLevel); - - AssertAreEqual(456.789, structure.LevelCrestStructure.Mean); - AssertAreEqual(0.456, structure.LevelCrestStructure.StandardDeviation); - - AssertAreEqual(555.55, structure.VerticalDistance); - Assert.AreEqual(0.55, structure.FailureProbabilityRepairClosure); - - AssertAreEqual(567.890, structure.FailureCollisionEnergy.Mean); - AssertAreEqual(0.567, structure.FailureCollisionEnergy.CoefficientOfVariation); - - AssertAreEqual(7777777.777, structure.ShipMass.Mean); - AssertAreEqual(0.777, structure.ShipMass.CoefficientOfVariation); - - AssertAreEqual(567.890, structure.ShipVelocity.Mean); - AssertAreEqual(0.567, structure.ShipVelocity.CoefficientOfVariation); - - Assert.AreEqual(42, structure.LevellingCount); - Assert.AreEqual(0.55, structure.ProbabilityCollisionSecondaryStructure); - - AssertAreEqual(678.901, structure.FlowVelocityStructureClosable.Mean); - AssertAreEqual(0.2, structure.FlowVelocityStructureClosable.CoefficientOfVariation); - - AssertAreEqual(789.012, structure.StabilityLinearLoadModel.Mean); - AssertAreEqual(0.789, structure.StabilityLinearLoadModel.CoefficientOfVariation); - - AssertAreEqual(890.123, structure.StabilityQuadraticLoadModel.Mean); - AssertAreEqual(0.890, structure.StabilityQuadraticLoadModel.CoefficientOfVariation); - - AssertAreEqual(901.234, structure.AreaFlowApertures.Mean); - AssertAreEqual(0.901, structure.AreaFlowApertures.StandardDeviation); - - Assert.AreEqual(StabilityPointStructureInflowModelType.FloodedCulvert, structure.InflowModelType); + AssertStabilityPointStructuresDefault(structure); } [Test] @@ -124,74 +57,25 @@ Assert.AreEqual(name, structure.Name); Assert.AreEqual("anId", structure.Id); Assert.AreEqual(new Point2D(1.234, 2.3456), structure.Location); - AssertAreEqual(123.456, structure.StructureNormalOrientation); + AssertStabilityPointStructuresDefault(structure); + } - AssertAreEqual(234.567, structure.StorageStructureArea.Mean); - AssertAreEqual(0.234, structure.StorageStructureArea.CoefficientOfVariation); + [Test] + public void Constructor_WithNameAndId_ExpectedValues() + { + // Setup + const string name = "cool name!"; + const string id = "and a cool Id too!"; - AssertAreEqual(345.678, structure.AllowedLevelIncreaseStorage.Mean); - AssertAreEqual(0.35, structure.AllowedLevelIncreaseStorage.StandardDeviation); + // Call + var structure = new TestStabilityPointStructure(name, id); - AssertAreEqual(456.789, structure.WidthFlowApertures.Mean); - AssertAreEqual(0.456, structure.WidthFlowApertures.StandardDeviation); - - AssertAreEqual(567.890, structure.InsideWaterLevel.Mean); - AssertAreEqual(0.567, structure.InsideWaterLevel.StandardDeviation); - - AssertAreEqual(678.901, structure.ThresholdHeightOpenWeir.Mean); - AssertAreEqual(0.678, structure.ThresholdHeightOpenWeir.StandardDeviation); - - AssertAreEqual(789.012, structure.CriticalOvertoppingDischarge.Mean); - AssertAreEqual(0.789, structure.CriticalOvertoppingDischarge.CoefficientOfVariation); - - AssertAreEqual(890.123, structure.FlowWidthAtBottomProtection.Mean); - AssertAreEqual(0.890, structure.FlowWidthAtBottomProtection.StandardDeviation); - - AssertAreEqual(901.234, structure.ConstructiveStrengthLinearLoadModel.Mean); - AssertAreEqual(0.901, structure.ConstructiveStrengthLinearLoadModel.CoefficientOfVariation); - - AssertAreEqual(123.456, structure.ConstructiveStrengthQuadraticLoadModel.Mean); - AssertAreEqual(0.123, structure.ConstructiveStrengthQuadraticLoadModel.CoefficientOfVariation); - - AssertAreEqual(234.567, structure.BankWidth.Mean); - AssertAreEqual(0.234, structure.BankWidth.StandardDeviation); - - AssertAreEqual(345.678, structure.InsideWaterLevelFailureConstruction.Mean); - AssertAreEqual(0.35, structure.InsideWaterLevelFailureConstruction.StandardDeviation); - - AssertAreEqual(555.555, structure.EvaluationLevel); - - AssertAreEqual(456.789, structure.LevelCrestStructure.Mean); - AssertAreEqual(0.456, structure.LevelCrestStructure.StandardDeviation); - - AssertAreEqual(555.55, structure.VerticalDistance); - Assert.AreEqual(0.55, structure.FailureProbabilityRepairClosure); - - AssertAreEqual(567.890, structure.FailureCollisionEnergy.Mean); - AssertAreEqual(0.567, structure.FailureCollisionEnergy.CoefficientOfVariation); - - AssertAreEqual(7777777.777, structure.ShipMass.Mean); - AssertAreEqual(0.777, structure.ShipMass.CoefficientOfVariation); - - AssertAreEqual(567.890, structure.ShipVelocity.Mean); - AssertAreEqual(0.567, structure.ShipVelocity.CoefficientOfVariation); - - Assert.AreEqual(42, structure.LevellingCount); - Assert.AreEqual(0.55, structure.ProbabilityCollisionSecondaryStructure); - - AssertAreEqual(678.901, structure.FlowVelocityStructureClosable.Mean); - AssertAreEqual(0.2, structure.FlowVelocityStructureClosable.CoefficientOfVariation); - - AssertAreEqual(789.012, structure.StabilityLinearLoadModel.Mean); - AssertAreEqual(0.789, structure.StabilityLinearLoadModel.CoefficientOfVariation); - - AssertAreEqual(890.123, structure.StabilityQuadraticLoadModel.Mean); - AssertAreEqual(0.890, structure.StabilityQuadraticLoadModel.CoefficientOfVariation); - - AssertAreEqual(901.234, structure.AreaFlowApertures.Mean); - AssertAreEqual(0.901, structure.AreaFlowApertures.StandardDeviation); - - Assert.AreEqual(StabilityPointStructureInflowModelType.FloodedCulvert, structure.InflowModelType); + // Assert + Assert.IsInstanceOf(structure); + Assert.AreEqual(name, structure.Name); + Assert.AreEqual(id, structure.Id); + Assert.AreEqual(new Point2D(1.234, 2.3456), structure.Location); + AssertStabilityPointStructuresDefault(structure); } [Test] @@ -208,6 +92,11 @@ Assert.AreEqual("aName", structure.Name); Assert.AreEqual("anId", structure.Id); Assert.AreEqual(point, structure.Location); + AssertStabilityPointStructuresDefault(structure); + } + + private static void AssertStabilityPointStructuresDefault(TestStabilityPointStructure structure) + { AssertAreEqual(123.456, structure.StructureNormalOrientation); AssertAreEqual(234.567, structure.StorageStructureArea.Mean); Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil/TestStabilityPointStructure.cs =================================================================== diff -u -rff948d4633181ead2677ab35467a93b4118c6751 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil/TestStabilityPointStructure.cs (.../TestStabilityPointStructure.cs) (revision ff948d4633181ead2677ab35467a93b4118c6751) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil/TestStabilityPointStructure.cs (.../TestStabilityPointStructure.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Core.Common.Base.Data; using Core.Common.Base.Geometry; @@ -32,30 +33,48 @@ /// /// Creates a new instance of . /// - public TestStabilityPointStructure() : this("aName", new Point2D(1.234, 2.3456)) {} + public TestStabilityPointStructure() : this("aName", "anId", new Point2D(1.234, 2.3456)) {} /// /// Creates a new instance of . /// /// The name of the structure. - public TestStabilityPointStructure(string name) : this(name, new Point2D(1.234, 2.3456)) {} + /// Thrown when + /// is null, empty or consists of only whitespaces. + public TestStabilityPointStructure(string name) : this(name, "anId", new Point2D(1.234, 2.3456)) {} /// /// Creates a new instance of . /// + /// The name of the structure. + /// The id of the structure. + /// Thrown when + /// or is null, empty or consists of only whitespaces. + public TestStabilityPointStructure(string name, string id) : this(name, id, new Point2D(1.234, 2.3456)) { } + + /// + /// Creates a new instance of . + /// /// The location of the structure. - public TestStabilityPointStructure(Point2D location) : this("aName", location) {} + /// Thrown when + /// is null. + public TestStabilityPointStructure(Point2D location) : this("aName", "anId", location) {} /// /// Creates a new instance of . /// /// The name of the structure. + /// /// The location of the structure. - private TestStabilityPointStructure(string name, Point2D location) + /// Thrown when + /// is null. + /// Thrown when + /// or is null, empty or consists of only whitespaces. + private TestStabilityPointStructure(string name, string id, Point2D location) : base(new ConstructionProperties { Name = name, - Id = "anId", + Id = id, Location = location, StructureNormalOrientation = (RoundedDouble) 123.456, StorageStructureArea = Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationExporterTest.cs =================================================================== diff -u -rff948d4633181ead2677ab35467a93b4118c6751 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationExporterTest.cs (.../StabilityPointStructuresCalculationConfigurationExporterTest.cs) (revision ff948d4633181ead2677ab35467a93b4118c6751) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationExporterTest.cs (.../StabilityPointStructuresCalculationConfigurationExporterTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -127,7 +127,7 @@ Name = "with LoadSchematizationType set to Linear and InflowModelType to FloodedCulvert", InputParameters = { - Structure = new TestStabilityPointStructure("kunstwerk1"), + Structure = new TestStabilityPointStructure("kunstwerk1", "kunstwerk1"), LoadSchematizationType = LoadSchematizationType.Linear, InflowModelType = StabilityPointStructureInflowModelType.FloodedCulvert } @@ -141,7 +141,7 @@ Name = "with LoadSchematizationType set to Qadratic and InflowModelType to LowSil", InputParameters = { - Structure = new TestStabilityPointStructure("kunstwerk1"), + Structure = new TestStabilityPointStructure("kunstwerk1", "kunstwerk1"), LoadSchematizationType = LoadSchematizationType.Quadratic, InflowModelType = StabilityPointStructureInflowModelType.LowSill } @@ -155,7 +155,7 @@ Name = "with structure", InputParameters = { - Structure = new TestStabilityPointStructure("kunstwerk1") + Structure = new TestStabilityPointStructure("kunstwerk1", "kunstwerk1") } }; } @@ -207,7 +207,7 @@ InputParameters = { ForeshoreProfile = new TestForeshoreProfile("profiel1"), - Structure = new TestStabilityPointStructure("kunstwerk1"), + Structure = new TestStabilityPointStructure("kunstwerk1", "kunstwerk1"), AllowedLevelIncreaseStorage = new LogNormalDistribution { Mean = (RoundedDouble) 0.2, Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationImporterTest.cs =================================================================== diff -u -rde6048a31dbe63930a6ea68b04a4f37879333106 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationImporterTest.cs (.../StabilityPointStructuresCalculationConfigurationImporterTest.cs) (revision de6048a31dbe63930a6ea68b04a4f37879333106) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationImporterTest.cs (.../StabilityPointStructuresCalculationConfigurationImporterTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -560,7 +560,7 @@ string filePath = Path.Combine(importerPath, file); var calculationGroup = new CalculationGroup(); - var structure = new TestStabilityPointStructure("kunstwerk1"); + var structure = new TestStabilityPointStructure("kunstwerk1", "kunstwerk1"); var foreshoreProfile = new TestForeshoreProfile("profiel 1"); var importer = new StabilityPointStructuresCalculationConfigurationImporter( @@ -627,7 +627,7 @@ string filePath = Path.Combine(importerPath, "validConfigurationStochastMeansOnly.xml"); var calculationGroup = new CalculationGroup(); - var structure = new TestStabilityPointStructure("kunstwerk1"); + var structure = new TestStabilityPointStructure("kunstwerk1", "kunstwerk1"); var importer = new StabilityPointStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -753,7 +753,7 @@ string filePath = Path.Combine(importerPath, "validConfigurationStochastStandardDeviationVariationCoefficientOnly.xml"); var calculationGroup = new CalculationGroup(); - var structure = new TestStabilityPointStructure("kunstwerk1"); + var structure = new TestStabilityPointStructure("kunstwerk1", "kunstwerk1"); var importer = new StabilityPointStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -867,7 +867,7 @@ string filePath = Path.Combine(importerPath, file); var calculationGroup = new CalculationGroup(); - var structure = new TestStabilityPointStructure("kunstwerk1"); + var structure = new TestStabilityPointStructure("kunstwerk1", "kunstwerk1"); var importer = new StabilityPointStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -905,7 +905,7 @@ { new Point2D(0, 3) }); - var structure = new TestStabilityPointStructure("kunstwerk1"); + var structure = new TestStabilityPointStructure("kunstwerk1", "kunstwerk1"); var importer = new StabilityPointStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -1077,7 +1077,7 @@ string filePath = Path.Combine(importerPath, "validConfigurationUnrounded.xml"); var calculationGroup = new CalculationGroup(); - var structure = new TestStabilityPointStructure("kunstwerk1"); + var structure = new TestStabilityPointStructure("kunstwerk1", "kunstwerk1"); var importer = new StabilityPointStructuresCalculationConfigurationImporter( filePath, calculationGroup, @@ -1108,7 +1108,7 @@ "De locatie met hydraulische randvoorwaarden 'unknown' bestaat niet.", TestName = "Import_UnknownData({0:80})")] [TestCase("validConfigurationUnknownStructure.xml", - "Het kunstwerk 'unknown' bestaat niet.", + "Het kunstwerk met ID 'unknown' bestaat niet.", TestName = "Import_UnknownData({0:80})")] public void Import_ValidConfigurationUnknownData_LogMessageAndContinueImport(string file, string expectedErrorMessage) { Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationReaderTest.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationReaderTest.cs (.../StabilityPointStructuresCalculationConfigurationReaderTest.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationReaderTest.cs (.../StabilityPointStructuresCalculationConfigurationReaderTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -464,7 +464,7 @@ Assert.AreEqual(7, calculation.StructureNormalOrientation); - Assert.AreEqual("kunstwerk1", calculation.StructureName); + Assert.AreEqual("kunstwerk1", calculation.StructureId); Assert.AreEqual(1.2, calculation.ThresholdHeightOpenWeir.Mean); Assert.AreEqual(0.1, calculation.ThresholdHeightOpenWeir.StandardDeviation); @@ -499,7 +499,7 @@ Assert.AreEqual("profiel1", calculation.ForeshoreProfileId); Assert.AreEqual("Locatie1", calculation.HydraulicBoundaryLocationName); Assert.AreEqual(9.81, calculation.VolumicWeightWater); - Assert.AreEqual("kunstwerk1", calculation.StructureName); + Assert.AreEqual("kunstwerk1", calculation.StructureId); Assert.AreEqual(ConfigurationBreakWaterType.Dam, calculation.WaveReduction.BreakWaterType); Assert.AreEqual(1.23, calculation.WaveReduction.BreakWaterHeight); Assert.IsTrue(calculation.WaveReduction.UseBreakWater); @@ -598,7 +598,7 @@ Assert.IsNull(calculation.ProbabilityCollisionSecondaryStructure); Assert.IsNull(calculation.VolumicWeightWater); Assert.IsNull(calculation.StructureNormalOrientation); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.IsNull(calculation.VerticalDistance); Assert.IsNull(calculation.WaveReduction); @@ -676,7 +676,7 @@ Assert.IsNull(calculation.ProbabilityCollisionSecondaryStructure); Assert.IsNull(calculation.VolumicWeightWater); Assert.IsNull(calculation.StructureNormalOrientation); - Assert.IsNull(calculation.StructureName); + Assert.IsNull(calculation.StructureId); Assert.IsNull(calculation.VerticalDistance); Assert.IsNull(calculation.WaveReduction); Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationWriterTest.cs =================================================================== diff -u -rddfc49cdc5d478ea4fc5da9c625834def6dd1939 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationWriterTest.cs (.../StabilityPointStructuresCalculationConfigurationWriterTest.cs) (revision ddfc49cdc5d478ea4fc5da9c625834def6dd1939) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationConfigurationWriterTest.cs (.../StabilityPointStructuresCalculationConfigurationWriterTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -208,7 +208,7 @@ Mean = 0.18, VariationCoefficient = 0.28 }, - StructureName = "kunstwerk1", + StructureId = "kunstwerk1", StructureNormalOrientation = 6.6, StorageStructureArea = new StochastConfiguration { Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationStochastAssignerTest.cs =================================================================== diff -u -rff948d4633181ead2677ab35467a93b4118c6751 -r8cbb4a20c556600eeabe49b979ea5fce12e1a6b3 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationStochastAssignerTest.cs (.../StabilityPointStructuresCalculationStochastAssignerTest.cs) (revision ff948d4633181ead2677ab35467a93b4118c6751) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Configurations/StabilityPointStructuresCalculationStochastAssignerTest.cs (.../StabilityPointStructuresCalculationStochastAssignerTest.cs) (revision 8cbb4a20c556600eeabe49b979ea5fce12e1a6b3) @@ -58,7 +58,7 @@ // Setup var configuration = new StabilityPointStructuresCalculationConfiguration("name") { - StructureName = "some structure" + StructureId = "some structure" }; configuration.DrainCoefficient = new StochastConfiguration(); configuration.DrainCoefficient.Mean = 8.1; @@ -96,7 +96,7 @@ // Setup var configuration = new StabilityPointStructuresCalculationConfiguration("name") { - StructureName = "some structure" + StructureId = "some structure" }; configuration.FlowVelocityStructureClosable = new StochastConfiguration(); configuration.FlowVelocityStructureClosable.Mean = 8.1; @@ -238,7 +238,7 @@ { Mean = 11 }, - StructureName = "some structure" + StructureId = "some structure" }; var calculation = new StructuresCalculation(); @@ -268,7 +268,7 @@ // Setup var configuration = new StabilityPointStructuresCalculationConfiguration("name") { - StructureName = "some structure" + StructureId = "some structure" }; updateConfiguration(configuration);