Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ClosingStructures/ClosingStructureEntityReadExtensions.cs =================================================================== diff -u -r8e8f8c83c45656f65adaa8e47600379dc5ae8f61 -r6e717246d970bc18500da686a51f82101296ff46 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ClosingStructures/ClosingStructureEntityReadExtensions.cs (.../ClosingStructureEntityReadExtensions.cs) (revision 8e8f8c83c45656f65adaa8e47600379dc5ae8f61) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ClosingStructures/ClosingStructureEntityReadExtensions.cs (.../ClosingStructureEntityReadExtensions.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -57,7 +57,7 @@ Name = entity.Name, Id = entity.Id, Location = new Point2D(entity.X.ToNullAsNaN(), entity.Y.ToNullAsNaN()), - StructureNormalOrientation = entity.StructureNormalOrientation.ToNullAsNaN(), + StructureNormalOrientation = (RoundedDouble) entity.StructureNormalOrientation.ToNullAsNaN(), StorageStructureArea = { Mean = (RoundedDouble) entity.StorageStructureAreaMean.ToNullAsNaN(), Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/HeightStructures/HeightStructureEntityReadExtensions.cs =================================================================== diff -u -r8e8f8c83c45656f65adaa8e47600379dc5ae8f61 -r6e717246d970bc18500da686a51f82101296ff46 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/HeightStructures/HeightStructureEntityReadExtensions.cs (.../HeightStructureEntityReadExtensions.cs) (revision 8e8f8c83c45656f65adaa8e47600379dc5ae8f61) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/HeightStructures/HeightStructureEntityReadExtensions.cs (.../HeightStructureEntityReadExtensions.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -57,7 +57,7 @@ Name = entity.Name, Id = entity.Id, Location = new Point2D(entity.X.ToNullAsNaN(), entity.Y.ToNullAsNaN()), - StructureNormalOrientation = entity.StructureNormalOrientation.ToNullAsNaN(), + StructureNormalOrientation = (RoundedDouble) entity.StructureNormalOrientation.ToNullAsNaN(), LevelCrestStructure = { Mean = (RoundedDouble) entity.LevelCrestStructureMean.ToNullAsNaN(), Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StabilityPointStructures/StabilityPointStructureEntityReadExtensions.cs =================================================================== diff -u -r6ced2c3bd4adaef7cf2363ba75a84911b09c3924 -r6e717246d970bc18500da686a51f82101296ff46 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StabilityPointStructures/StabilityPointStructureEntityReadExtensions.cs (.../StabilityPointStructureEntityReadExtensions.cs) (revision 6ced2c3bd4adaef7cf2363ba75a84911b09c3924) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StabilityPointStructures/StabilityPointStructureEntityReadExtensions.cs (.../StabilityPointStructureEntityReadExtensions.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -57,7 +57,7 @@ Name = entity.Name, Id = entity.Id, Location = new Point2D(entity.X.ToNullAsNaN(), entity.Y.ToNullAsNaN()), - StructureNormalOrientation = entity.StructureNormalOrientation.ToNullAsNaN(), + StructureNormalOrientation = (RoundedDouble) entity.StructureNormalOrientation.ToNullAsNaN(), StorageStructureArea = { Mean = (RoundedDouble) entity.StorageStructureAreaMean.ToNullAsNaN(), Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/ClosingStructures/ClosingStructureCreateExtensionsTest.cs =================================================================== diff -u -r8e8f8c83c45656f65adaa8e47600379dc5ae8f61 -r6e717246d970bc18500da686a51f82101296ff46 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/ClosingStructures/ClosingStructureCreateExtensionsTest.cs (.../ClosingStructureCreateExtensionsTest.cs) (revision 8e8f8c83c45656f65adaa8e47600379dc5ae8f61) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/ClosingStructures/ClosingStructureCreateExtensionsTest.cs (.../ClosingStructureCreateExtensionsTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -106,7 +106,7 @@ Name = "A", Id = "B", Location = new Point2D(double.NaN, double.NaN), - StructureNormalOrientation = double.NaN, + StructureNormalOrientation = RoundedDouble.NaN, StorageStructureArea = { Mean = RoundedDouble.NaN, Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/HeightStructures/HeightStructureCreateExtensionsTest.cs =================================================================== diff -u -r8e8f8c83c45656f65adaa8e47600379dc5ae8f61 -r6e717246d970bc18500da686a51f82101296ff46 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/HeightStructures/HeightStructureCreateExtensionsTest.cs (.../HeightStructureCreateExtensionsTest.cs) (revision 8e8f8c83c45656f65adaa8e47600379dc5ae8f61) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/HeightStructures/HeightStructureCreateExtensionsTest.cs (.../HeightStructureCreateExtensionsTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -95,7 +95,7 @@ Name = "A", Id = "B", Location = new Point2D(double.NaN, double.NaN), - StructureNormalOrientation = double.NaN, + StructureNormalOrientation = RoundedDouble.NaN, AllowedLevelIncreaseStorage = { Mean = RoundedDouble.NaN, Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityPointStructures/StabilityPointStructureCreateExtensionsTest.cs =================================================================== diff -u -r6ced2c3bd4adaef7cf2363ba75a84911b09c3924 -r6e717246d970bc18500da686a51f82101296ff46 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityPointStructures/StabilityPointStructureCreateExtensionsTest.cs (.../StabilityPointStructureCreateExtensionsTest.cs) (revision 6ced2c3bd4adaef7cf2363ba75a84911b09c3924) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityPointStructures/StabilityPointStructureCreateExtensionsTest.cs (.../StabilityPointStructureCreateExtensionsTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -126,7 +126,7 @@ Name = "A", Id = "B", Location = new Point2D(double.NaN, double.NaN), - StructureNormalOrientation = double.NaN, + StructureNormalOrientation = RoundedDouble.NaN, StorageStructureArea = { Mean = RoundedDouble.NaN, Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs =================================================================== diff -u -r154172b6706fadc1364f90533138d410a2115571 -r6e717246d970bc18500da686a51f82101296ff46 --- Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 154172b6706fadc1364f90533138d410a2115571) +++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -404,7 +404,7 @@ { Id = "KUNST1", Name = "KUNST1", Location = new Point2D(12345.56789, 9876.54321), - StructureNormalOrientation = 10.0, + StructureNormalOrientation = (RoundedDouble) 10.0, LevelCrestStructure = { Mean = (RoundedDouble) 4.95, @@ -473,7 +473,7 @@ Mean = (RoundedDouble) 0.2, StandardDeviation = (RoundedDouble) 0.1 }, - StructureNormalOrientation = 10.0, + StructureNormalOrientation = (RoundedDouble) 10.0, WidthFlowApertures = { Mean = (RoundedDouble) 21, @@ -588,7 +588,7 @@ new StabilityPointStructure.ConstructionProperties { Name = "Kunstwerk", Id = "Kunstwerk id", Location = new Point2D(131470.777221421, 548329.82912364), - StructureNormalOrientation = 10, + StructureNormalOrientation = (RoundedDouble) 10, StorageStructureArea = { Mean = (RoundedDouble) 20000, Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructure.cs =================================================================== diff -u -rbdb4f3a790928e7f4046703414a6ab131d5c03e7 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructure.cs (.../ClosingStructure.cs) (revision bdb4f3a790928e7f4046703414a6ab131d5c03e7) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructure.cs (.../ClosingStructure.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -239,8 +239,6 @@ IdenticalApertures = 1; FailureProbabilityReparation = 1; InflowModelType = ClosingStructureInflowModelType.VerticalWall; - - StructureNormalOrientation = double.NaN; } /// Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/ClosingStructuresImporter.cs =================================================================== diff -u -r006e2461c3c2f32451e7f8715e3cece92230a27a -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/ClosingStructuresImporter.cs (.../ClosingStructuresImporter.cs) (revision 006e2461c3c2f32451e7f8715e3cece92230a27a) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.IO/ClosingStructuresImporter.cs (.../ClosingStructuresImporter.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -118,7 +118,7 @@ rowData, StructureFilesKeywords.ClosingStructureParameterKeyword2); - TrySetConstructionProperty((properties, rows, key) => properties.StructureNormalOrientation = rows[key].NumericalValue, + TrySetConstructionProperty((properties, rows, key) => properties.StructureNormalOrientation = (RoundedDouble) rows[key].NumericalValue, constructionProperties, rowData, StructureFilesKeywords.ClosingStructureParameterKeyword3); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructureTest.cs =================================================================== diff -u -rbdb4f3a790928e7f4046703414a6ab131d5c03e7 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructureTest.cs (.../ClosingStructureTest.cs) (revision bdb4f3a790928e7f4046703414a6ab131d5c03e7) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructureTest.cs (.../ClosingStructureTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -54,7 +54,7 @@ Mean = (RoundedDouble) 234.567, StandardDeviation = (RoundedDouble) 0.234 }, - StructureNormalOrientation = 345.678, + StructureNormalOrientation = (RoundedDouble) 345.678, WidthFlowApertures = { Mean = (RoundedDouble) 456.789, @@ -104,7 +104,6 @@ Assert.AreEqual(location.X, structure.Location.X); Assert.AreEqual(location.Y, structure.Location.Y); - Assert.AreEqual(2, structure.StructureNormalOrientation.NumberOfDecimalPlaces); Assert.AreEqual(345.68, structure.StructureNormalOrientation, structure.StructureNormalOrientation.GetAccuracy()); VariationCoefficientLogNormalDistribution storageStructureArea = structure.StorageStructureArea; @@ -191,8 +190,7 @@ Assert.AreEqual(location.X, structure.Location.X); Assert.AreEqual(location.Y, structure.Location.Y); - Assert.AreEqual(2, structure.StructureNormalOrientation.NumberOfDecimalPlaces); - Assert.AreEqual(double.NaN, structure.StructureNormalOrientation, structure.StructureNormalOrientation.GetAccuracy()); + Assert.IsNaN(structure.StructureNormalOrientation); VariationCoefficientLogNormalDistribution storageStructureArea = structure.StorageStructureArea; Assert.AreEqual(2, storageStructureArea.Mean.NumberOfDecimalPlaces); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil/TestClosingStructure.cs =================================================================== diff -u -r85d3615793ddf3f8f72eb02409a23286396f5cf1 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil/TestClosingStructure.cs (.../TestClosingStructure.cs) (revision 85d3615793ddf3f8f72eb02409a23286396f5cf1) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil/TestClosingStructure.cs (.../TestClosingStructure.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -77,7 +77,7 @@ Mean = (RoundedDouble) 0.2, StandardDeviation = (RoundedDouble) 0.1 }, - StructureNormalOrientation = 10.0, + StructureNormalOrientation = (RoundedDouble) 10.0, WidthFlowApertures = { Mean = (RoundedDouble) 21, Index: Ringtoets/Common/src/Ringtoets.Common.Data/StructureBase.cs =================================================================== diff -u -r589249bddd12bd66da39205d408ff6e907220116 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/Common/src/Ringtoets.Common.Data/StructureBase.cs (.../StructureBase.cs) (revision 589249bddd12bd66da39205d408ff6e907220116) +++ Ringtoets/Common/src/Ringtoets.Common.Data/StructureBase.cs (.../StructureBase.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -56,32 +56,13 @@ Name = constructionProperties.Name; Id = constructionProperties.Id; Location = constructionProperties.Location; - StructureNormalOrientation = new RoundedDouble(2, constructionProperties.StructureNormalOrientation); + StructureNormalOrientation = constructionProperties.StructureNormalOrientation; } /// - /// Creates a new instance of . - /// - /// The name of the structure. - /// The identifier of the structure. - /// The location of the structure. - /// The orientation of the structure, relative to north. - /// Thrown when or is null - /// , empty or consists of whitespace. - /// Thrown when is null. - protected StructureBase(string name, string id, Point2D location, double structureNormalOrientation) : - this(new ConstructionProperties - { - Name = name, - Id = id, - Location = location, - StructureNormalOrientation = (RoundedDouble) structureNormalOrientation - }) {} - - /// /// Gets the name of the structure. /// - public string Name { get; private set; } + public string Name { get; } /// /// Gets the identifier of the structure. @@ -109,6 +90,13 @@ /// public class ConstructionProperties { + private RoundedDouble structureNormalOrientation; + + public ConstructionProperties() + { + structureNormalOrientation = new RoundedDouble(2, double.NaN); + } + /// /// Gets or sets the name of the structure. /// @@ -128,7 +116,17 @@ /// Gets or sets the orientation of the closing structure, relative to north. /// [degrees] /// - public double StructureNormalOrientation { internal get; set; } + public RoundedDouble StructureNormalOrientation + { + internal get + { + return structureNormalOrientation; + } + set + { + structureNormalOrientation = value.ToPrecision(structureNormalOrientation.NumberOfDecimalPlaces); + } + } } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs =================================================================== diff -u -r3e3087bd9c43ca5a3910438b3c9daf0defcb09bf -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs (.../StructureBaseTest.cs) (revision 3e3087bd9c43ca5a3910438b3c9daf0defcb09bf) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs (.../StructureBaseTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; @@ -90,9 +91,40 @@ structure.StructureNormalOrientation.GetAccuracy()); } + [Test] + public void Constructor_DefaultValues_ExpectedValues() + { + // Setup + var location = new Point2D(1.22, 2.333); + + // Call + var structure = new TestStructure("aName", "anId", location); + + // Assert + Assert.AreEqual("aName", structure.Name); + Assert.AreEqual("anId", structure.Id); + Assert.AreEqual(location.X, structure.Location.X); + Assert.AreEqual(location.Y, structure.Location.Y); + Assert.AreEqual("aName", structure.ToString()); + Assert.AreEqual(2, structure.StructureNormalOrientation.NumberOfDecimalPlaces); + Assert.IsNaN(structure.StructureNormalOrientation); + } + private class TestStructure : StructureBase { - public TestStructure(string name, string id, Point2D location, double normal) : base(name, id, location, normal) {} + public TestStructure(string name, string id, Point2D location) : base(new ConstructionProperties + { + Name = name, + Id = id, + Location = location + }) { } + + public TestStructure(string name, string id, Point2D location, double normal) : base(new ConstructionProperties + { + Name = name, + Id = id, + Location = location, + StructureNormalOrientation = (RoundedDouble) normal}) {} } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresInputBasePropertiesTest.cs =================================================================== diff -u -r5a28016b2c6566fbb91341bcc06d9f2dff927384 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresInputBasePropertiesTest.cs (.../StructuresInputBasePropertiesTest.cs) (revision 5a28016b2c6566fbb91341bcc06d9f2dff927384) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresInputBasePropertiesTest.cs (.../StructuresInputBasePropertiesTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -1118,9 +1118,15 @@ private class SimpleStructure : StructureBase { - public SimpleStructure() : base("Name", "Id", new Point2D(0, 0), 0.0) {} + public SimpleStructure() : this(new Point2D(0, 0)) {} - public SimpleStructure(Point2D location) : base("Name", "Id", location, 0.0) {} + public SimpleStructure(Point2D location) : base(new ConstructionProperties + { + Name = "Name", + Id = "Id", + Location = location, + StructureNormalOrientation = (RoundedDouble) 0 + }) {} } private class SimpleStructureInput : StructuresInputBase Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/StructureSelectionDialogTest.cs =================================================================== diff -u -r8905298103eb01ce13dd5c1a2f267f879d4fda3e -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/StructureSelectionDialogTest.cs (.../StructureSelectionDialogTest.cs) (revision 8905298103eb01ce13dd5c1a2f267f879d4fda3e) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/StructureSelectionDialogTest.cs (.../StructureSelectionDialogTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -22,6 +22,7 @@ using System; using System.Linq; using System.Windows.Forms; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Controls.DataGrid; using NUnit.Extensions.Forms; @@ -117,7 +118,7 @@ Name = testname, Id = "anId", Location = new Point2D(0, 0), - StructureNormalOrientation = 0.0 + StructureNormalOrientation = (RoundedDouble) 0.0 }; var structure = new TestStructure(constructionProperties); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/UITypeEditors/StructureEditorTest.cs =================================================================== diff -u -rc94cb1b5a316ba340decc1afe0e6be1afb49cde1 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/UITypeEditors/StructureEditorTest.cs (.../StructureEditorTest.cs) (revision c94cb1b5a316ba340decc1afe0e6be1afb49cde1) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/UITypeEditors/StructureEditorTest.cs (.../StructureEditorTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -23,6 +23,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms.Design; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Gui.PropertyBag; using Core.Common.Gui.UITypeEditors; @@ -71,7 +72,7 @@ mockRepository.ReplayAll(); // Call - var result = editor.EditValue(descriptorContextStub, serviceProviderStub, someValue); + object result = editor.EditValue(descriptorContextStub, serviceProviderStub, someValue); // Assert Assert.AreSame(someValue, result); @@ -98,7 +99,7 @@ mockRepository.ReplayAll(); // Call - var result = editor.EditValue(descriptorContextStub, serviceProviderStub, someValue); + object result = editor.EditValue(descriptorContextStub, serviceProviderStub, someValue); // Assert Assert.AreSame(simpleStructure, result); @@ -107,29 +108,28 @@ private class SimpleStructure : StructureBase { - public SimpleStructure() : base("Name", "Id", new Point2D(0, 0), 0.0) {} + public SimpleStructure() : base(new ConstructionProperties + { + Name = "Name", + Id = "Id", + Location = new Point2D(0, 0), + StructureNormalOrientation = (RoundedDouble) 0 + }) {} } private class ObjectPropertiesWithStructure : IHasStructureProperty { - private readonly SimpleStructure structure; private readonly IEnumerable availableStructures; public ObjectPropertiesWithStructure(SimpleStructure structure, IEnumerable availableStructures) { - this.structure = structure; + this.Structure = structure; this.availableStructures = availableStructures; } public object Data { get; set; } - public SimpleStructure Structure - { - get - { - return structure; - } - } + public SimpleStructure Structure { get; } public IEnumerable GetAvailableStructures() { Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Import/CalculationConfigurationImporterTest.cs =================================================================== diff -u -r65c74eaad22b576971bae588c9793d76950b8cad -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Import/CalculationConfigurationImporterTest.cs (.../CalculationConfigurationImporterTest.cs) (revision 65c74eaad22b576971bae588c9793d76950b8cad) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Import/CalculationConfigurationImporterTest.cs (.../CalculationConfigurationImporterTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -867,7 +867,13 @@ private class TestStructure : StructureBase { - public TestStructure(string name) : base(name, "id", new Point2D(0, 0), 2) { } + public TestStructure(string name) : base(new ConstructionProperties + { + Name = name, + Id = "Id", + Location = new Point2D(0, 0), + StructureNormalOrientation = (RoundedDouble) 2 + }) { } } private class TestInputWithForeshoreProfileAndBreakWater : Observable, IUseBreakWater, IUseForeshore Index: Ringtoets/Common/test/Ringtoets.Common.Utils.Test/StructuresHelperTest.cs =================================================================== diff -u -r2a896243ca24205f8e98db1b61e8148d1d9b9062 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/Common/test/Ringtoets.Common.Utils.Test/StructuresHelperTest.cs (.../StructuresHelperTest.cs) (revision 2a896243ca24205f8e98db1b61e8148d1d9b9062) +++ Ringtoets/Common/test/Ringtoets.Common.Utils.Test/StructuresHelperTest.cs (.../StructuresHelperTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -22,6 +22,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; @@ -277,7 +278,13 @@ private class TestStructure : StructureBase { - public TestStructure(string name, string id, Point2D location, double normal) : base(name, id, location, normal) {} + public TestStructure(string name, string id, Point2D location, double normal) : base(new ConstructionProperties + { + Name = name, + Id = id, + Location = location, + StructureNormalOrientation = (RoundedDouble) normal + }) {} } #endregion Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructure.cs =================================================================== diff -u -r6bb7d994986cbe36a45ae72e9f28921f7d75d473 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructure.cs (.../HeightStructure.cs) (revision 6bb7d994986cbe36a45ae72e9f28921f7d75d473) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructure.cs (.../HeightStructure.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -158,8 +158,6 @@ }; FailureProbabilityStructureWithErosion = 1.0; - - StructureNormalOrientation = double.NaN; } /// Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresImporter.cs =================================================================== diff -u -r006e2461c3c2f32451e7f8715e3cece92230a27a -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresImporter.cs (.../HeightStructuresImporter.cs) (revision 006e2461c3c2f32451e7f8715e3cece92230a27a) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresImporter.cs (.../HeightStructuresImporter.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -103,7 +103,7 @@ Location = structureLocation.Point }; - TrySetConstructionProperty((properties, rows, key) => properties.StructureNormalOrientation = rows[key].NumericalValue, + TrySetConstructionProperty((properties, rows, key) => properties.StructureNormalOrientation = (RoundedDouble) rows[key].NumericalValue, constructionProperties, rowData, StructureFilesKeywords.HeightStructureParameterKeyword1); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructureTest.cs =================================================================== diff -u -r6bb7d994986cbe36a45ae72e9f28921f7d75d473 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructureTest.cs (.../HeightStructureTest.cs) (revision 6bb7d994986cbe36a45ae72e9f28921f7d75d473) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructureTest.cs (.../HeightStructureTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -41,7 +41,7 @@ new HeightStructure.ConstructionProperties { Name = "aName", Id = "anId", Location = location, - StructureNormalOrientation = 0.12345, + StructureNormalOrientation = (RoundedDouble) 0.12345, LevelCrestStructure = { Mean = (RoundedDouble) 234.567, @@ -149,9 +149,7 @@ Assert.AreEqual(location.X, heightStructure.Location.X); Assert.AreEqual(location.Y, heightStructure.Location.Y); - Assert.IsInstanceOf(heightStructure.StructureNormalOrientation); - Assert.AreEqual(2, heightStructure.StructureNormalOrientation.NumberOfDecimalPlaces); - Assert.AreEqual(double.NaN, heightStructure.StructureNormalOrientation.Value); + Assert.IsNaN(heightStructure.StructureNormalOrientation); NormalDistribution levelCrestStructure = heightStructure.LevelCrestStructure; Assert.AreEqual(2, levelCrestStructure.Mean.NumberOfDecimalPlaces); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructure.cs =================================================================== diff -u -rbe64b9f33b3065a4d80c0a93c1cafe3d74f43513 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructure.cs (.../TestHeightStructure.cs) (revision be64b9f33b3065a4d80c0a93c1cafe3d74f43513) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructure.cs (.../TestHeightStructure.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -60,7 +60,7 @@ Name = name, Id = "Id", Location = location, - StructureNormalOrientation = 0.12345, + StructureNormalOrientation = (RoundedDouble) 0.12345, LevelCrestStructure = { Mean = (RoundedDouble) 234.567, Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructure.cs =================================================================== diff -u -r6ced2c3bd4adaef7cf2363ba75a84911b09c3924 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructure.cs (.../StabilityPointStructure.cs) (revision 6ced2c3bd4adaef7cf2363ba75a84911b09c3924) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructure.cs (.../StabilityPointStructure.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -303,92 +303,173 @@ /// public ConstructionProperties() { - StorageStructureArea = new VariationCoefficientLogNormalDistribution(2); - AllowedLevelIncreaseStorage = new LogNormalDistribution(2); - WidthFlowApertures = new NormalDistribution(2); - InsideWaterLevel = new NormalDistribution(2); - ThresholdHeightOpenWeir = new NormalDistribution(2); - CriticalOvertoppingDischarge = new VariationCoefficientLogNormalDistribution(2); - FlowWidthAtBottomProtection = new LogNormalDistribution(2); - ConstructiveStrengthLinearLoadModel = new VariationCoefficientLogNormalDistribution(2); - ConstructiveStrengthQuadraticLoadModel = new VariationCoefficientLogNormalDistribution(2); - BankWidth = new NormalDistribution(2); - InsideWaterLevelFailureConstruction = new NormalDistribution(2); - LevelCrestStructure = new NormalDistribution(2); - FailureCollisionEnergy = new VariationCoefficientLogNormalDistribution(2); - ShipMass = new VariationCoefficientNormalDistribution(2); - ShipVelocity = new VariationCoefficientNormalDistribution(2); - FlowVelocityStructureClosable = new VariationCoefficientNormalDistribution(2); - StabilityLinearLoadModel = new VariationCoefficientLogNormalDistribution(2); - StabilityQuadraticLoadModel = new VariationCoefficientLogNormalDistribution(2); - AreaFlowApertures = new LogNormalDistribution(2); + StorageStructureArea = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = (RoundedDouble) 0.1 + }; + AllowedLevelIncreaseStorage = new LogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + StandardDeviation = (RoundedDouble) 0.1 + }; + WidthFlowApertures = new NormalDistribution(2) + { + Mean = RoundedDouble.NaN, + StandardDeviation = (RoundedDouble) 0.2 + }; + InsideWaterLevel = new NormalDistribution(2) + { + Mean = RoundedDouble.NaN, + StandardDeviation = (RoundedDouble) 0.1 + }; + ThresholdHeightOpenWeir = new NormalDistribution(2) + { + Mean = RoundedDouble.NaN, + StandardDeviation = (RoundedDouble) 0.1 + }; + CriticalOvertoppingDischarge = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = (RoundedDouble) 0.15 + }; + FlowWidthAtBottomProtection = new LogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + StandardDeviation = (RoundedDouble) 0.05 + }; + ConstructiveStrengthLinearLoadModel = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = (RoundedDouble) 0.1 + }; + ConstructiveStrengthQuadraticLoadModel = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = (RoundedDouble) 0.1 + }; + BankWidth = new NormalDistribution(2) + { + Mean = RoundedDouble.NaN, + StandardDeviation = RoundedDouble.NaN + }; + InsideWaterLevelFailureConstruction = new NormalDistribution(2) + { + Mean = RoundedDouble.NaN, + StandardDeviation = (RoundedDouble) 0.1 + }; + LevelCrestStructure = new NormalDistribution(2) + { + Mean = RoundedDouble.NaN, + StandardDeviation = (RoundedDouble) 0.05 + }; + VerticalDistance = double.NaN; + FailureProbabilityRepairClosure = 1; + FailureCollisionEnergy = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = (RoundedDouble) 0.3 + }; + ShipMass = new VariationCoefficientNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = (RoundedDouble) 0.2 + }; + ShipVelocity = new VariationCoefficientNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = (RoundedDouble) 0.2 + }; + LevellingCount = 1; + ProbabilityCollisionSecondaryStructure = 1; + FlowVelocityStructureClosable = new VariationCoefficientNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = (RoundedDouble) 0.2 + }; + StabilityLinearLoadModel = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = (RoundedDouble) 0.1 + }; + StabilityQuadraticLoadModel = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = (RoundedDouble) 0.1 + }; + AreaFlowApertures = new LogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + StandardDeviation = (RoundedDouble) 0.01 + }; + InflowModelType = StabilityPointStructureInflowModelType.LowSill; } /// /// Gets the storage area of the stability point structure. /// [m^2] /// - public VariationCoefficientLogNormalDistribution StorageStructureArea { get; private set; } + public VariationCoefficientLogNormalDistribution StorageStructureArea { get; } /// /// Gets the allowed increase of level for storage of the stability point structure. /// [m] /// - public LogNormalDistribution AllowedLevelIncreaseStorage { get; private set; } + public LogNormalDistribution AllowedLevelIncreaseStorage { get; } /// /// Gets the width of the flow apertures of the stability point structure. /// [m] /// - public NormalDistribution WidthFlowApertures { get; private set; } + public NormalDistribution WidthFlowApertures { get; } /// /// Gets the interior water level of the stability point structure. /// [m+NAP] /// - public NormalDistribution InsideWaterLevel { get; private set; } + public NormalDistribution InsideWaterLevel { get; } /// /// Gets the threshold height of the opened stability point structure. /// [m+NAP] /// - public NormalDistribution ThresholdHeightOpenWeir { get; private set; } + public NormalDistribution ThresholdHeightOpenWeir { get; } /// /// Gets the critical overtopping discharge per meter of the stability point structure. /// [m^3/s/m] /// - public VariationCoefficientLogNormalDistribution CriticalOvertoppingDischarge { get; private set; } + public VariationCoefficientLogNormalDistribution CriticalOvertoppingDischarge { get; } /// /// Gets the flow width of the stability point structure at the bottom protection. /// [m] /// - public LogNormalDistribution FlowWidthAtBottomProtection { get; private set; } + public LogNormalDistribution FlowWidthAtBottomProtection { get; } /// /// Gets the constructive strength of the linear load model of the stability point structure. /// [kN/m^2] /// - public VariationCoefficientLogNormalDistribution ConstructiveStrengthLinearLoadModel { get; private set; } + public VariationCoefficientLogNormalDistribution ConstructiveStrengthLinearLoadModel { get; } /// /// Gets the constructive strength of the quadratic load model of the stability point structure. /// [kN/m] /// - public VariationCoefficientLogNormalDistribution ConstructiveStrengthQuadraticLoadModel { get; private set; } + public VariationCoefficientLogNormalDistribution ConstructiveStrengthQuadraticLoadModel { get; } /// /// Gets the bank width of the stability point structure. /// [m] /// - public NormalDistribution BankWidth { get; private set; } + public NormalDistribution BankWidth { get; } /// /// Gets the inside water level failure construction of the stability point structure. /// [m+NAP] /// - public NormalDistribution InsideWaterLevelFailureConstruction { get; private set; } + public NormalDistribution InsideWaterLevelFailureConstruction { get; } /// /// Gets or sets the evaluation level of the stability point structure. @@ -400,7 +481,7 @@ /// Gets the crest level of the stability point structure. /// [m+NAP] /// - public NormalDistribution LevelCrestStructure { get; private set; } + public NormalDistribution LevelCrestStructure { get; } /// /// Gets or sets the vertical distance of the stability point structure. @@ -418,19 +499,19 @@ /// Gets the failure collision energy of the stability point structure. /// [kN m] /// - public VariationCoefficientLogNormalDistribution FailureCollisionEnergy { get; private set; } + public VariationCoefficientLogNormalDistribution FailureCollisionEnergy { get; } /// /// Gets the mass of the ship. /// [ton] /// - public VariationCoefficientNormalDistribution ShipMass { get; private set; } + public VariationCoefficientNormalDistribution ShipMass { get; } /// /// Gets the velocity of the ship. /// [m/s] /// - public VariationCoefficientNormalDistribution ShipVelocity { get; private set; } + public VariationCoefficientNormalDistribution ShipVelocity { get; } /// /// Gets or sets the levelling count. @@ -448,25 +529,25 @@ /// Gets the maximum flow velocity at which the structure is closable. /// [m/s] /// - public VariationCoefficientNormalDistribution FlowVelocityStructureClosable { get; private set; } + public VariationCoefficientNormalDistribution FlowVelocityStructureClosable { get; } /// /// Gets the stability properties of the linear load model of the stability point structure. /// [kN/m^2] /// - public VariationCoefficientLogNormalDistribution StabilityLinearLoadModel { get; private set; } + public VariationCoefficientLogNormalDistribution StabilityLinearLoadModel { get; } /// /// Gets the stability properties of the quadratic load model of the stability point structure. /// [kN/m] /// - public VariationCoefficientLogNormalDistribution StabilityQuadraticLoadModel { get; private set; } + public VariationCoefficientLogNormalDistribution StabilityQuadraticLoadModel { get; } /// /// Gets the area of the flow aperture of the stability point structure. /// [m^2] /// - public LogNormalDistribution AreaFlowApertures { get; private set; } + public LogNormalDistribution AreaFlowApertures { get; } /// /// Gets or sets the type of stability point structure inflow model. Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresImporter.cs =================================================================== diff -u -rbdba242bf394db36636077b0652e46f32f9c9e7b -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresImporter.cs (.../StabilityPointStructuresImporter.cs) (revision bdba242bf394db36636077b0652e46f32f9c9e7b) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresImporter.cs (.../StabilityPointStructuresImporter.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -100,7 +100,7 @@ Location = structureLocation.Point, }; - TrySetConstructionProperty((properties, rows, key) => properties.StructureNormalOrientation = rows[key].NumericalValue, + TrySetConstructionProperty((properties, rows, key) => properties.StructureNormalOrientation = (RoundedDouble) rows[key].NumericalValue, constructionProperties, rowData, StructureFilesKeywords.StabilityPointStructureParameterKeyword1); Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructureTest.cs =================================================================== diff -u -r6ced2c3bd4adaef7cf2363ba75a84911b09c3924 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructureTest.cs (.../StabilityPointStructureTest.cs) (revision 6ced2c3bd4adaef7cf2363ba75a84911b09c3924) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructureTest.cs (.../StabilityPointStructureTest.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -34,15 +34,14 @@ [Test] public void Constructor_ValidData_ExpectedValues() { - // Setup - var location = new Point2D(1.22, 2.333); - // Call var structure = new StabilityPointStructure( new StabilityPointStructure.ConstructionProperties { - Name = "aName", Id = "anId", Location = location, - StructureNormalOrientation = 123.456, + Name = "aName", + Id = "anId", + Location = new Point2D(1.22, 2.333), + StructureNormalOrientation = (RoundedDouble) 123.456, StorageStructureArea = { Mean = (RoundedDouble) 234.567, @@ -279,5 +278,153 @@ Assert.AreEqual(StabilityPointStructureInflowModelType.FloodedCulvert, structure.InflowModelType); } + + [Test] + public void Constructor_DefaultData_ExpectedValues() + { + // Call + var structure = new StabilityPointStructure( + new StabilityPointStructure.ConstructionProperties + { + Name = "aName", + Id = "anId", + Location = new Point2D(1.22, 2.333) + }); + + // Assert + Assert.IsInstanceOf(structure); + + Assert.IsNaN(structure.StructureNormalOrientation); + + VariationCoefficientLogNormalDistribution storageStructureArea = structure.StorageStructureArea; + Assert.AreEqual(2, storageStructureArea.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(storageStructureArea.Mean); + Assert.AreEqual(2, storageStructureArea.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, storageStructureArea.CoefficientOfVariation, storageStructureArea.CoefficientOfVariation.GetAccuracy()); + + LogNormalDistribution allowedLevelIncreaseStorage = structure.AllowedLevelIncreaseStorage; + Assert.AreEqual(2, allowedLevelIncreaseStorage.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(allowedLevelIncreaseStorage.Mean); + Assert.AreEqual(2, allowedLevelIncreaseStorage.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, allowedLevelIncreaseStorage.StandardDeviation, allowedLevelIncreaseStorage.StandardDeviation.GetAccuracy()); + + NormalDistribution widthFlowApertures = structure.WidthFlowApertures; + Assert.AreEqual(2, widthFlowApertures.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(widthFlowApertures.Mean); + Assert.AreEqual(2, widthFlowApertures.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.2, widthFlowApertures.StandardDeviation, widthFlowApertures.StandardDeviation.GetAccuracy()); + + NormalDistribution insideWaterLevel = structure.InsideWaterLevel; + Assert.AreEqual(2, insideWaterLevel.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(insideWaterLevel.Mean); + Assert.AreEqual(2, insideWaterLevel.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, insideWaterLevel.StandardDeviation, insideWaterLevel.StandardDeviation.GetAccuracy()); + + NormalDistribution thresholdHeightOpenWeir = structure.ThresholdHeightOpenWeir; + Assert.AreEqual(2, thresholdHeightOpenWeir.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(thresholdHeightOpenWeir.Mean); + Assert.AreEqual(2, thresholdHeightOpenWeir.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, thresholdHeightOpenWeir.StandardDeviation, thresholdHeightOpenWeir.StandardDeviation.GetAccuracy()); + + VariationCoefficientLogNormalDistribution criticalOvertoppingDischarge = structure.CriticalOvertoppingDischarge; + Assert.AreEqual(2, criticalOvertoppingDischarge.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(criticalOvertoppingDischarge.Mean); + Assert.AreEqual(2, criticalOvertoppingDischarge.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.15, criticalOvertoppingDischarge.CoefficientOfVariation, criticalOvertoppingDischarge.CoefficientOfVariation.GetAccuracy()); + + LogNormalDistribution flowWidthAtBottomProtection = structure.FlowWidthAtBottomProtection; + Assert.AreEqual(2, flowWidthAtBottomProtection.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(flowWidthAtBottomProtection.Mean); + Assert.AreEqual(2, flowWidthAtBottomProtection.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.05, flowWidthAtBottomProtection.StandardDeviation, flowWidthAtBottomProtection.StandardDeviation.GetAccuracy()); + + VariationCoefficientLogNormalDistribution constructiveStrengthLinearLoadModel = structure.ConstructiveStrengthLinearLoadModel; + Assert.AreEqual(2, constructiveStrengthLinearLoadModel.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(constructiveStrengthLinearLoadModel.Mean); + Assert.AreEqual(2, constructiveStrengthLinearLoadModel.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, constructiveStrengthLinearLoadModel.CoefficientOfVariation, constructiveStrengthLinearLoadModel.CoefficientOfVariation.GetAccuracy()); + + VariationCoefficientLogNormalDistribution constructiveStrengthQuadraticLoadModel = structure.ConstructiveStrengthQuadraticLoadModel; + Assert.AreEqual(2, constructiveStrengthQuadraticLoadModel.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(constructiveStrengthQuadraticLoadModel.Mean); + Assert.AreEqual(2, constructiveStrengthQuadraticLoadModel.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, constructiveStrengthQuadraticLoadModel.CoefficientOfVariation, constructiveStrengthQuadraticLoadModel.CoefficientOfVariation.GetAccuracy()); + + NormalDistribution bankWidth = structure.BankWidth; + Assert.AreEqual(2, bankWidth.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(bankWidth.Mean); + Assert.AreEqual(2, bankWidth.StandardDeviation.NumberOfDecimalPlaces); + Assert.IsNaN(bankWidth.StandardDeviation); + + NormalDistribution insideWaterLevelFailureConstruction = structure.InsideWaterLevelFailureConstruction; + Assert.AreEqual(2, insideWaterLevelFailureConstruction.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(insideWaterLevelFailureConstruction.Mean); + Assert.AreEqual(2, insideWaterLevelFailureConstruction.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, insideWaterLevelFailureConstruction.StandardDeviation, insideWaterLevelFailureConstruction.StandardDeviation.GetAccuracy()); + + Assert.IsInstanceOf(structure.EvaluationLevel); + Assert.AreEqual(2, structure.EvaluationLevel.NumberOfDecimalPlaces); + Assert.AreEqual(0, structure.EvaluationLevel, structure.EvaluationLevel.GetAccuracy()); + + NormalDistribution levelCrestStructure = structure.LevelCrestStructure; + Assert.AreEqual(2, levelCrestStructure.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(levelCrestStructure.Mean); + Assert.AreEqual(2, levelCrestStructure.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.05, levelCrestStructure.StandardDeviation, levelCrestStructure.StandardDeviation.GetAccuracy()); + + Assert.IsInstanceOf(structure.VerticalDistance); + Assert.AreEqual(2, structure.VerticalDistance.NumberOfDecimalPlaces); + Assert.IsNaN(structure.VerticalDistance); + + Assert.AreEqual(1, structure.FailureProbabilityRepairClosure); + + VariationCoefficientLogNormalDistribution failureCollisionEnergy = structure.FailureCollisionEnergy; + Assert.AreEqual(2, failureCollisionEnergy.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(failureCollisionEnergy.Mean); + Assert.AreEqual(2, failureCollisionEnergy.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.3, failureCollisionEnergy.CoefficientOfVariation, failureCollisionEnergy.CoefficientOfVariation.GetAccuracy()); + + VariationCoefficientNormalDistribution shipMass = structure.ShipMass; + Assert.AreEqual(2, shipMass.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(shipMass.Mean); + Assert.AreEqual(2, shipMass.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.2, shipMass.CoefficientOfVariation, shipMass.CoefficientOfVariation.GetAccuracy()); + + VariationCoefficientNormalDistribution shipVelocity = structure.ShipVelocity; + Assert.AreEqual(2, shipVelocity.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(shipVelocity.Mean); + Assert.AreEqual(2, shipVelocity.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.2, shipVelocity.CoefficientOfVariation, shipVelocity.CoefficientOfVariation.GetAccuracy()); + + Assert.AreEqual(1, structure.LevellingCount); + + Assert.AreEqual(1, structure.ProbabilityCollisionSecondaryStructure); + + VariationCoefficientNormalDistribution flowVelocityStructureClosable = structure.FlowVelocityStructureClosable; + Assert.AreEqual(2, flowVelocityStructureClosable.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(flowVelocityStructureClosable.Mean); + Assert.AreEqual(2, flowVelocityStructureClosable.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.2, flowVelocityStructureClosable.CoefficientOfVariation, flowVelocityStructureClosable.CoefficientOfVariation.GetAccuracy()); + + VariationCoefficientLogNormalDistribution stabilityLinearLoadModel = structure.StabilityLinearLoadModel; + Assert.AreEqual(2, stabilityLinearLoadModel.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(stabilityLinearLoadModel.Mean); + Assert.AreEqual(2, stabilityLinearLoadModel.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, stabilityLinearLoadModel.CoefficientOfVariation, stabilityLinearLoadModel.CoefficientOfVariation.GetAccuracy()); + + VariationCoefficientLogNormalDistribution stabilityQuadraticLoadModel = structure.StabilityQuadraticLoadModel; + Assert.AreEqual(2, stabilityQuadraticLoadModel.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(stabilityQuadraticLoadModel.Mean); + Assert.AreEqual(2, stabilityQuadraticLoadModel.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, stabilityQuadraticLoadModel.CoefficientOfVariation, stabilityQuadraticLoadModel.CoefficientOfVariation.GetAccuracy()); + + LogNormalDistribution areaFlowApertures = structure.AreaFlowApertures; + Assert.AreEqual(2, areaFlowApertures.Mean.NumberOfDecimalPlaces); + Assert.IsNaN(areaFlowApertures.Mean); + Assert.AreEqual(2, areaFlowApertures.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.01, areaFlowApertures.StandardDeviation, areaFlowApertures.StandardDeviation.GetAccuracy()); + + Assert.AreEqual(StabilityPointStructureInflowModelType.LowSill, structure.InflowModelType); + } } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil/TestStabilityPointStructure.cs =================================================================== diff -u -r85d3615793ddf3f8f72eb02409a23286396f5cf1 -r6e717246d970bc18500da686a51f82101296ff46 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil/TestStabilityPointStructure.cs (.../TestStabilityPointStructure.cs) (revision 85d3615793ddf3f8f72eb02409a23286396f5cf1) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil/TestStabilityPointStructure.cs (.../TestStabilityPointStructure.cs) (revision 6e717246d970bc18500da686a51f82101296ff46) @@ -57,7 +57,7 @@ Name = name, Id = "anId", Location = location, - StructureNormalOrientation = 123.456, + StructureNormalOrientation = (RoundedDouble) 123.456, StorageStructureArea = { Mean = (RoundedDouble) 234.567,