Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructure.cs =================================================================== diff -u -r492fe6c36c8cfc83d4c624bad14fb4f5120c953d -r53ce804a943dda8a3605dedafff85c3d86dbea44 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructure.cs (.../HeightStructure.cs) (revision 492fe6c36c8cfc83d4c624bad14fb4f5120c953d) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructure.cs (.../HeightStructure.cs) (revision 53ce804a943dda8a3605dedafff85c3d86dbea44) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data; using Ringtoets.Common.Data.Probabilistics; using BaseConstructionProperties = Ringtoets.Common.Data.StructureBase.ConstructionProperties; @@ -125,12 +126,36 @@ /// public ConstructionProperties() { - LevelCrestStructure = new NormalDistribution(2); - FlowWidthAtBottomProtection = new LogNormalDistribution(2); - CriticalOvertoppingDischarge = new VariationCoefficientLogNormalDistribution(2); - WidthFlowApertures = new NormalDistribution(2); - StorageStructureArea = new VariationCoefficientLogNormalDistribution(2); - AllowedLevelIncreaseStorage = new LogNormalDistribution(2); + LevelCrestStructure = new NormalDistribution(2) + { + StandardDeviation = (RoundedDouble) 0.05 + }; + FlowWidthAtBottomProtection = new LogNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + StandardDeviation = (RoundedDouble) 0.05 + }; + CriticalOvertoppingDischarge = new VariationCoefficientLogNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + CoefficientOfVariation = (RoundedDouble) 0.15 + }; + WidthFlowApertures = new NormalDistribution(2) + { + StandardDeviation = (RoundedDouble) 0.2 + }; + StorageStructureArea = new VariationCoefficientLogNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + CoefficientOfVariation = (RoundedDouble) 0.1 + }; + AllowedLevelIncreaseStorage = new LogNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + StandardDeviation = (RoundedDouble) 0.1 + }; + + FailureProbabilityStructureWithErosion = 1.0; } /// Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructureTest.cs =================================================================== diff -u -r8e8f8c83c45656f65adaa8e47600379dc5ae8f61 -r53ce804a943dda8a3605dedafff85c3d86dbea44 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructureTest.cs (.../HeightStructureTest.cs) (revision 8e8f8c83c45656f65adaa8e47600379dc5ae8f61) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructureTest.cs (.../HeightStructureTest.cs) (revision 53ce804a943dda8a3605dedafff85c3d86dbea44) @@ -125,5 +125,71 @@ Assert.AreEqual(2, allowedLevelIncreaseStorage.StandardDeviation.NumberOfDecimalPlaces); Assert.AreEqual(0.23, allowedLevelIncreaseStorage.StandardDeviation.Value); } + + [Test] + public void Constructor_DefaultConstructorProperties_ExpectedValues() + { + // Setup + var location = new Point2D(1.22, 2.333); + + // Call + var heightStructure = new HeightStructure( + new HeightStructure.ConstructionProperties + { + Name = "aName", + Id = "anId", + Location = location + }); + + // Assert + Assert.IsInstanceOf(heightStructure); + Assert.AreEqual("aName", heightStructure.Name); + Assert.AreEqual("anId", heightStructure.Id); + Assert.IsInstanceOf(heightStructure.Location); + 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(0, heightStructure.StructureNormalOrientation.Value); + + NormalDistribution levelCrestStructure = heightStructure.LevelCrestStructure; + Assert.AreEqual(2, levelCrestStructure.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(0, levelCrestStructure.Mean.Value); + Assert.AreEqual(2, levelCrestStructure.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.05, levelCrestStructure.StandardDeviation.Value); + + LogNormalDistribution flowWidthAtBottomProtection = heightStructure.FlowWidthAtBottomProtection; + Assert.AreEqual(2, flowWidthAtBottomProtection.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(1, flowWidthAtBottomProtection.Mean.Value); + Assert.AreEqual(2, flowWidthAtBottomProtection.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.05, flowWidthAtBottomProtection.StandardDeviation.Value); + + VariationCoefficientLogNormalDistribution criticalOvertoppingDischarge = heightStructure.CriticalOvertoppingDischarge; + Assert.AreEqual(2, criticalOvertoppingDischarge.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(1, criticalOvertoppingDischarge.Mean.Value); + Assert.AreEqual(2, criticalOvertoppingDischarge.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.15, criticalOvertoppingDischarge.CoefficientOfVariation.Value); + + NormalDistribution widthFlowApertures = heightStructure.WidthFlowApertures; + Assert.AreEqual(2, widthFlowApertures.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(0, widthFlowApertures.Mean.Value); + Assert.AreEqual(2, widthFlowApertures.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.2, widthFlowApertures.StandardDeviation.Value); + + Assert.AreEqual(1, heightStructure.FailureProbabilityStructureWithErosion); + + VariationCoefficientLogNormalDistribution storageStructureArea = heightStructure.StorageStructureArea; + Assert.AreEqual(2, storageStructureArea.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(1, storageStructureArea.Mean.Value); + Assert.AreEqual(2, storageStructureArea.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, storageStructureArea.CoefficientOfVariation.Value); + + LogNormalDistribution allowedLevelIncreaseStorage = heightStructure.AllowedLevelIncreaseStorage; + Assert.AreEqual(2, allowedLevelIncreaseStorage.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(1, allowedLevelIncreaseStorage.Mean.Value); + Assert.AreEqual(2, allowedLevelIncreaseStorage.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.1, allowedLevelIncreaseStorage.StandardDeviation.Value); + } } } \ No newline at end of file