Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs =================================================================== diff -u -rba2eefab3569d05ed59629b5d02dc8420bc1163a -rfabcc9cb4752cec071fb7290280043982974dffd --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision ba2eefab3569d05ed59629b5d02dc8420bc1163a) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision fabcc9cb4752cec071fb7290280043982974dffd) @@ -95,73 +95,95 @@ #endregion - #region Model factors + protected override void UpdateStructureProperties() + { + if (Structure != null) + { + StructureNormalOrientation = Structure.StructureNormalOrientation; + LevelCrestStructureNotClosing = Structure.LevelCrestStructureNotClosing; + FlowWidthAtBottomProtection = Structure.FlowWidthAtBottomProtection; + CriticalOvertoppingDischarge = Structure.CriticalOvertoppingDischarge; + WidthFlowApertures = Structure.WidthFlowApertures; + StorageStructureArea = Structure.StorageStructureArea; + AllowedLevelIncreaseStorage = Structure.AllowedLevelIncreaseStorage; + InflowModelType = Structure.InflowModelType; + AreaFlowApertures = Structure.AreaFlowApertures; + FailureProbabilityOpenStructure = Structure.FailureProbabilityOpenStructure; + FailureProbabilityReparation = Structure.FailureProbabilityReparation; + IdenticalApertures = Structure.IdenticalApertures; + InsideWaterLevel = Structure.InsideWaterLevel; + ProbabilityOpenStructureBeforeFlooding = Structure.ProbabilityOpenStructureBeforeFlooding; + ThresholdHeightOpenWeir = Structure.ThresholdHeightOpenWeir; + } + } + #region Hydraulic data + /// - /// Gets or sets the drain coefficient. + /// Gets or sets the inside water level. + /// [m+NAP] /// - /// Only sets the mean. - public NormalDistribution DrainCoefficient + public NormalDistribution InsideWaterLevel { get { - return drainCoefficient; + return insideWaterLevel; } set { - drainCoefficient.Mean = value.Mean; + insideWaterLevel.Mean = value.Mean; + insideWaterLevel.StandardDeviation = value.StandardDeviation; } } /// - /// Gets or sets the factor for the storm duration for an open structure. + /// Gets or sets the deviation of the wave direction. + /// [degrees] /// - public RoundedDouble FactorStormDurationOpenStructure + public RoundedDouble DeviationWaveDirection { get { - return factorStormDurationOpenStructure; + return deviationWaveDirection; } set { - factorStormDurationOpenStructure = value.ToPrecision(factorStormDurationOpenStructure.NumberOfDecimalPlaces); + deviationWaveDirection = value.ToPrecision(deviationWaveDirection.NumberOfDecimalPlaces); } } #endregion - #region Hydraulic data + #region Model factors /// - /// Gets or sets the inside water level. - /// [m+NAP] + /// Gets or sets the drain coefficient. /// - public NormalDistribution InsideWaterLevel + /// Only sets the mean. + public NormalDistribution DrainCoefficient { get { - return insideWaterLevel; + return drainCoefficient; } set { - insideWaterLevel.Mean = value.Mean; - insideWaterLevel.StandardDeviation = value.StandardDeviation; + drainCoefficient.Mean = value.Mean; } } /// - /// Gets or sets the deviation of the wave direction. - /// [degrees] + /// Gets or sets the factor for the storm duration for an open structure. /// - public RoundedDouble DeviationWaveDirection + public RoundedDouble FactorStormDurationOpenStructure { get { - return deviationWaveDirection; + return factorStormDurationOpenStructure; } set { - deviationWaveDirection = value.ToPrecision(deviationWaveDirection.NumberOfDecimalPlaces); + factorStormDurationOpenStructure = value.ToPrecision(factorStormDurationOpenStructure.NumberOfDecimalPlaces); } } @@ -291,27 +313,5 @@ } #endregion - - protected override void UpdateStructureProperties() - { - if (Structure != null) - { - StructureNormalOrientation = Structure.StructureNormalOrientation; - LevelCrestStructureNotClosing = Structure.LevelCrestStructureNotClosing; - FlowWidthAtBottomProtection = Structure.FlowWidthAtBottomProtection; - CriticalOvertoppingDischarge = Structure.CriticalOvertoppingDischarge; - WidthFlowApertures = Structure.WidthFlowApertures; - StorageStructureArea = Structure.StorageStructureArea; - AllowedLevelIncreaseStorage = Structure.AllowedLevelIncreaseStorage; - InflowModelType = Structure.InflowModelType; - AreaFlowApertures = Structure.AreaFlowApertures; - FailureProbabilityOpenStructure = Structure.FailureProbabilityOpenStructure; - FailureProbabilityReparation = Structure.FailureProbabilityReparation; - IdenticalApertures = Structure.IdenticalApertures; - InsideWaterLevel = Structure.InsideWaterLevel; - ProbabilityOpenStructureBeforeFlooding = Structure.ProbabilityOpenStructureBeforeFlooding; - ThresholdHeightOpenWeir = Structure.ThresholdHeightOpenWeir; - } - } } } \ No newline at end of file Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs =================================================================== diff -u -rba2eefab3569d05ed59629b5d02dc8420bc1163a -rfabcc9cb4752cec071fb7290280043982974dffd --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs (.../ClosingStructuresInputTest.cs) (revision ba2eefab3569d05ed59629b5d02dc8420bc1163a) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs (.../ClosingStructuresInputTest.cs) (revision fabcc9cb4752cec071fb7290280043982974dffd) @@ -90,39 +90,55 @@ } [Test] - [TestCase(ClosingStructureInflowModelType.VerticalWall)] - [TestCase(ClosingStructureInflowModelType.LowSill)] - [TestCase(ClosingStructureInflowModelType.FloodedCulvert)] - public void InflowModelType_SetValue_ReturnSetValue(ClosingStructureInflowModelType inflowModelType) + public void Properties_StructureNull_DoesNotChangeValues() { + var input = new ClosingStructuresInput(); + + // Call + input.Structure = null; + + // Assert + AssertClosingStructure(null, input); + } + + [Test] + public void Properties_Structure_UpdateValuesAccordingly() + { // Setup var input = new ClosingStructuresInput(); + TestClosingStructure structure = new TestClosingStructure(); // Call - input.InflowModelType = inflowModelType; + input.Structure = structure; // Assert - Assert.AreEqual(inflowModelType, input.InflowModelType); + AssertClosingStructure(structure, input); } + #region Structure + [Test] - public void Properties_FactorStormDurationOpenStructure_ExpectedValues() + [TestCase(ClosingStructureInflowModelType.VerticalWall)] + [TestCase(ClosingStructureInflowModelType.LowSill)] + [TestCase(ClosingStructureInflowModelType.FloodedCulvert)] + public void InflowModelType_SetValue_ReturnSetValue(ClosingStructureInflowModelType inflowModelType) { // Setup - var random = new Random(22); var input = new ClosingStructuresInput(); - var factorStormDuration = new RoundedDouble(5, random.NextDouble()); // Call - input.FactorStormDurationOpenStructure = factorStormDuration; + input.InflowModelType = inflowModelType; // Assert - Assert.AreEqual(2, input.FactorStormDurationOpenStructure.NumberOfDecimalPlaces); - AssertAreEqual(factorStormDuration, input.FactorStormDurationOpenStructure); + Assert.AreEqual(inflowModelType, input.InflowModelType); } + #endregion + + #region Hydraulic data + [Test] - public void Properties_ThresholdHeightOpenWeir_ExpectedValues() + public void Properties_InsideWaterLevel_ExpectedValues() { // Setup var random = new Random(22); @@ -141,13 +157,33 @@ }; // Call - input.ThresholdHeightOpenWeir = distributionToSet; + input.InsideWaterLevel = distributionToSet; // Assert - AssertDistributionCorrectlySet(input.ThresholdHeightOpenWeir, distributionToSet, expectedDistribution); + AssertDistributionCorrectlySet(input.InsideWaterLevel, distributionToSet, expectedDistribution); } [Test] + public void Properties_DeviationWaveDirection_ExpectedValues() + { + // Setup + var random = new Random(22); + var input = new ClosingStructuresInput(); + var deviationWaveDirection = new RoundedDouble(5, random.NextDouble()); + + // Call + input.DeviationWaveDirection = deviationWaveDirection; + + // Assert + Assert.AreEqual(2, input.DeviationWaveDirection.NumberOfDecimalPlaces); + AssertAreEqual(deviationWaveDirection, input.DeviationWaveDirection); + } + + #endregion + + #region Model factors + + [Test] public void Properties_DrainCoefficient_ExpectedValues() { // Setup @@ -173,6 +209,52 @@ } [Test] + public void Properties_FactorStormDurationOpenStructure_ExpectedValues() + { + // Setup + var random = new Random(22); + var input = new ClosingStructuresInput(); + var factorStormDurationOpenStructure = new RoundedDouble(5, random.NextDouble()); + + // Call + input.FactorStormDurationOpenStructure = factorStormDurationOpenStructure; + + // Assert + Assert.AreEqual(2, input.FactorStormDurationOpenStructure.NumberOfDecimalPlaces); + AssertAreEqual(factorStormDurationOpenStructure, input.FactorStormDurationOpenStructure); + } + + #endregion + + #region Schematization + + [Test] + public void Properties_ThresholdHeightOpenWeir_ExpectedValues() + { + // Setup + var random = new Random(22); + var input = new ClosingStructuresInput(); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); + var expectedDistribution = new NormalDistribution(2) + { + Mean = mean, + StandardDeviation = standardDeviation + }; + var distributionToSet = new NormalDistribution(5) + { + Mean = mean, + StandardDeviation = standardDeviation + }; + + // Call + input.ThresholdHeightOpenWeir = distributionToSet; + + // Assert + AssertDistributionCorrectlySet(input.ThresholdHeightOpenWeir, distributionToSet, expectedDistribution); + } + + [Test] public void Properties_AreaFlowApertures_ExpectedValues() { // Setup @@ -268,13 +350,13 @@ // Setup var random = new Random(22); var input = new ClosingStructuresInput(); - int identicalAperture = random.Next(); + int identicalApertures = random.Next(); // Call - input.IdenticalApertures = identicalAperture; + input.IdenticalApertures = identicalApertures; // Assert - Assert.AreEqual(identicalAperture, input.IdenticalApertures); + Assert.AreEqual(identicalApertures, input.IdenticalApertures); } [Test] @@ -304,48 +386,6 @@ } [Test] - public void Properties_InsideWaterLevel_ExpectedValues() - { - // Setup - var random = new Random(22); - var input = new ClosingStructuresInput(); - var mean = (RoundedDouble) (0.01 + random.NextDouble()); - var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); - var expectedDistribution = new NormalDistribution(2) - { - Mean = mean, - StandardDeviation = standardDeviation - }; - var distributionToSet = new NormalDistribution(5) - { - Mean = mean, - StandardDeviation = standardDeviation - }; - - // Call - input.InsideWaterLevel = distributionToSet; - - // Assert - AssertDistributionCorrectlySet(input.InsideWaterLevel, distributionToSet, expectedDistribution); - } - - [Test] - public void Properties_DeviationWaveDirection_ExpectedValues() - { - // Setup - var random = new Random(22); - var input = new ClosingStructuresInput(); - var deviationWaveDirection = new RoundedDouble(5, random.NextDouble()); - - // Call - input.DeviationWaveDirection = deviationWaveDirection; - - // Assert - Assert.AreEqual(2, input.DeviationWaveDirection.NumberOfDecimalPlaces); - AssertAreEqual(deviationWaveDirection, input.DeviationWaveDirection); - } - - [Test] [TestCase(-1.1)] [TestCase(2)] [TestCase(double.NaN)] @@ -377,32 +417,10 @@ Assert.AreEqual(probability, input.ProbabilityOpenStructureBeforeFlooding); } - [Test] - public void Properties_StructureNull_DoesNotChangeValues() - { - var input = new ClosingStructuresInput(); + #endregion - // Call - input.Structure = null; + #region Helpers - // Assert - AssertClosingStructure(null, input); - } - - [Test] - public void Properties_Structure_UpdateValuesAccordingly() - { - // Setup - var input = new ClosingStructuresInput(); - TestClosingStructure structure = new TestClosingStructure(); - - // Call - input.Structure = structure; - - // Assert - AssertClosingStructure(structure, input); - } - private static void AssertClosingStructure(ClosingStructure expectedClosingStructure, ClosingStructuresInput input) { if (expectedClosingStructure == null) @@ -457,5 +475,7 @@ Assert.AreNotSame(setDistribution, distributionToAssert); DistributionAssert.AreEqual(expectedDistribution, distributionToAssert); } + + #endregion } } \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs =================================================================== diff -u -rba2eefab3569d05ed59629b5d02dc8420bc1163a -rfabcc9cb4752cec071fb7290280043982974dffd --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision ba2eefab3569d05ed59629b5d02dc8420bc1163a) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision fabcc9cb4752cec071fb7290280043982974dffd) @@ -55,14 +55,42 @@ } [Test] + public void Properties_StructureNull_DoesNotChangeValues() + { + // Setup + var input = new HeightStructuresInput(); + + // Call + input.Structure = null; + + // Assert + AssertHeightStructure(null, input); + } + + [Test] + public void Properties_Structure_UpdateValuesAccordingly() + { + // Setup + var input = new HeightStructuresInput(); + TestHeightStructure structure = new TestHeightStructure(); + + // Call + input.Structure = structure; + + // Assert + AssertHeightStructure(structure, input); + } + + #region Hydraulic data + + [Test] public void Properties_DeviationWaveDirection_ExpectedValues() { // Setup var random = new Random(22); var input = new HeightStructuresInput(); + var deviationWaveDirection = new RoundedDouble(5, random.NextDouble()); - RoundedDouble deviationWaveDirection = new RoundedDouble(5, random.NextDouble()); - // Call input.DeviationWaveDirection = deviationWaveDirection; @@ -71,6 +99,10 @@ AssertAreEqual(deviationWaveDirection, input.DeviationWaveDirection); } + #endregion + + #region Schematization + [Test] public void Properties_LevelCrestStructure_ExpectedValues() { @@ -97,33 +129,10 @@ AssertDistributionCorrectlySet(input.LevelCrestStructure, distributionToSet, expectedDistribution); } - [Test] - public void Properties_StructureNull_DoesNotChangeValues() - { - // Setup - var input = new HeightStructuresInput(); + #endregion - // Call - input.Structure = null; + #region Helpers - // Assert - AssertHeightStructure(null, input); - } - - [Test] - public void Properties_Structure_UpdateValuesAccordingly() - { - // Setup - var input = new HeightStructuresInput(); - TestHeightStructure structure = new TestHeightStructure(); - - // Call - input.Structure = structure; - - // Assert - AssertHeightStructure(structure, input); - } - private static void AssertHeightStructure(HeightStructure expectedHeightStructure, HeightStructuresInput input) { if (expectedHeightStructure == null) @@ -166,5 +175,7 @@ Assert.AreNotSame(setDistribution, distributionToAssert); DistributionAssert.AreEqual(expectedDistribution, distributionToAssert); } + + #endregion } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructuresInput.cs =================================================================== diff -u -rba2eefab3569d05ed59629b5d02dc8420bc1163a -rfabcc9cb4752cec071fb7290280043982974dffd --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructuresInput.cs (.../StabilityPointStructuresInput.cs) (revision ba2eefab3569d05ed59629b5d02dc8420bc1163a) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructuresInput.cs (.../StabilityPointStructuresInput.cs) (revision fabcc9cb4752cec071fb7290280043982974dffd) @@ -157,6 +157,38 @@ }; } + protected override void UpdateStructureProperties() + { + if (Structure != null) + { + AllowedLevelIncreaseStorage = Structure.AllowedLevelIncreaseStorage; + AreaFlowApertures = Structure.AreaFlowApertures; + BankWidth = Structure.BankWidth; + ConstructiveStrengthLinearLoadModel = Structure.ConstructiveStrengthLinearLoadModel; + ConstructiveStrengthQuadraticLoadModel = Structure.ConstructiveStrengthQuadraticLoadModel; + CriticalOvertoppingDischarge = Structure.CriticalOvertoppingDischarge; + EvaluationLevel = Structure.EvaluationLevel; + FailureCollisionEnergy = Structure.FailureCollisionEnergy; + FailureProbabilityRepairClosure = Structure.FailureProbabilityRepairClosure; + FlowVelocityStructureClosable = Structure.FlowVelocityStructureClosable; + FlowWidthAtBottomProtection = Structure.FlowWidthAtBottomProtection; + InflowModelType = Structure.InflowModelType; + InsideWaterLevel = Structure.InsideWaterLevel; + InsideWaterLevelFailureConstruction = Structure.InsideWaterLevelFailureConstruction; + LevelCrestStructure = Structure.LevelCrestStructure; + LevellingCount = Structure.LevellingCount; + ProbabilityCollisionSecondaryStructure = Structure.ProbabilityCollisionSecondaryStructure; + ShipMass = Structure.ShipMass; + ShipVelocity = Structure.ShipVelocity; + StabilityLinearLoadModel = Structure.StabilityLinearLoadModel; + StabilityQuadraticLoadModel = Structure.StabilityQuadraticLoadModel; + StorageStructureArea = Structure.StorageStructureArea; + ThresholdHeightOpenWeir = Structure.ThresholdHeightOpenWeir; + VerticalDistance = Structure.VerticalDistance; + WidthFlowApertures = Structure.WidthFlowApertures; + } + } + #region Structure / calculation /// @@ -225,7 +257,7 @@ #endregion - #region Model inputs and critical values + #region Model factors and critical values /// /// Gets or sets the factor for the storm duration for an open structure. @@ -549,37 +581,5 @@ } #endregion - - protected override void UpdateStructureProperties() - { - if (Structure != null) - { - AllowedLevelIncreaseStorage = Structure.AllowedLevelIncreaseStorage; - AreaFlowApertures = Structure.AreaFlowApertures; - BankWidth = Structure.BankWidth; - ConstructiveStrengthLinearLoadModel = Structure.ConstructiveStrengthLinearLoadModel; - ConstructiveStrengthQuadraticLoadModel = Structure.ConstructiveStrengthQuadraticLoadModel; - CriticalOvertoppingDischarge = Structure.CriticalOvertoppingDischarge; - EvaluationLevel = Structure.EvaluationLevel; - FailureCollisionEnergy = Structure.FailureCollisionEnergy; - FailureProbabilityRepairClosure = Structure.FailureProbabilityRepairClosure; - FlowVelocityStructureClosable = Structure.FlowVelocityStructureClosable; - FlowWidthAtBottomProtection = Structure.FlowWidthAtBottomProtection; - InflowModelType = Structure.InflowModelType; - InsideWaterLevel = Structure.InsideWaterLevel; - InsideWaterLevelFailureConstruction = Structure.InsideWaterLevelFailureConstruction; - LevelCrestStructure = Structure.LevelCrestStructure; - LevellingCount = Structure.LevellingCount; - ProbabilityCollisionSecondaryStructure = Structure.ProbabilityCollisionSecondaryStructure; - ShipMass = Structure.ShipMass; - ShipVelocity = Structure.ShipVelocity; - StabilityLinearLoadModel = Structure.StabilityLinearLoadModel; - StabilityQuadraticLoadModel = Structure.StabilityQuadraticLoadModel; - StorageStructureArea = Structure.StorageStructureArea; - ThresholdHeightOpenWeir = Structure.ThresholdHeightOpenWeir; - VerticalDistance = Structure.VerticalDistance; - WidthFlowApertures = Structure.WidthFlowApertures; - } - } } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresInputTest.cs =================================================================== diff -u -r7e18d72b65e2041b1493dca3bd0b722d1fa5a664 -rfabcc9cb4752cec071fb7290280043982974dffd --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresInputTest.cs (.../StabilityPointStructuresInputTest.cs) (revision 7e18d72b65e2041b1493dca3bd0b722d1fa5a664) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresInputTest.cs (.../StabilityPointStructuresInputTest.cs) (revision fabcc9cb4752cec071fb7290280043982974dffd) @@ -163,9 +163,35 @@ AssertAreEqual(double.NaN, input.VerticalDistance); } - # region Calculation inputs + [Test] + public void Properties_StructureNull_DoesNotChangeValues() + { + var input = new StabilityPointStructuresInput(); + // Call + input.Structure = null; + + // Assert + AssertStabilityPointStructure(null, input); + } + [Test] + public void Properties_Structure_UpdateValuesAccordingly() + { + // Setup + var input = new StabilityPointStructuresInput(); + TestStabilityPointStructure structure = new TestStabilityPointStructure(); + + // Call + input.Structure = structure; + + // Assert + AssertStabilityPointStructure(structure, input); + } + + # region Structure / calculation + + [Test] [TestCase(StabilityPointStructureInflowModelType.LowSill)] [TestCase(StabilityPointStructureInflowModelType.FloodedCulvert)] public void InflowModelType_SetValue_ReturnSetValue(StabilityPointStructureInflowModelType inflowModelType) @@ -205,9 +231,8 @@ // Setup var input = new StabilityPointStructuresInput(); var random = new Random(22); + var volumicWeightWater = new RoundedDouble(5, random.NextDouble()); - RoundedDouble volumicWeightWater = new RoundedDouble(5, random.NextDouble()); - // Call input.VolumicWeightWater = volumicWeightWater; @@ -222,13 +247,12 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - var mean = (RoundedDouble) (0.01 + random.NextDouble()); var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new NormalDistribution(2) { Mean = mean, - StandardDeviation = standardDeviation + StandardDeviation = standardDeviation }; var distributionToSet = new NormalDistribution(5) { @@ -249,9 +273,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new NormalDistribution(2) { Mean = mean, @@ -272,23 +295,22 @@ #endregion - #region Model inputs + #region Model factors and critical values [Test] public void Properties_FactorStormDurationOpenStructure_ExpectedValues() { // Setup var input = new StabilityPointStructuresInput(); var random = new Random(22); + var factorStormDurationOpenStructure = new RoundedDouble(5, random.NextDouble()); - var factorStormDuration = new RoundedDouble(5, random.NextDouble()); - // Call - input.FactorStormDurationOpenStructure = factorStormDuration; + input.FactorStormDurationOpenStructure = factorStormDurationOpenStructure; // Assert Assert.AreEqual(2, input.FactorStormDurationOpenStructure.NumberOfDecimalPlaces); - AssertAreEqual(factorStormDuration, input.FactorStormDurationOpenStructure); + AssertAreEqual(factorStormDurationOpenStructure, input.FactorStormDurationOpenStructure); } [Test] @@ -297,22 +319,20 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); - RoundedDouble initialStd = input.DrainCoefficient.StandardDeviation; + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new NormalDistribution(2) { Mean = mean, - StandardDeviation = initialStd + StandardDeviation = input.DrainCoefficient.StandardDeviation }; var distributionToSet = new NormalDistribution(5) { Mean = mean, StandardDeviation = standardDeviation }; - // Call + // Call input.DrainCoefficient = distributionToSet; // Assert @@ -325,9 +345,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new NormalDistribution(2) { Mean = mean, @@ -338,7 +357,7 @@ Mean = mean, StandardDeviation = standardDeviation }; - + // Call input.FlowVelocityStructureClosable = distributionToSet; @@ -356,9 +375,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new NormalDistribution(2) { Mean = mean, @@ -383,9 +401,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new NormalDistribution(2) { Mean = mean, @@ -410,9 +427,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new LogNormalDistribution(2) { Mean = mean, @@ -437,9 +453,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var variation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var variation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new VariationCoefficientLogNormalDistribution(2) { Mean = mean, @@ -464,9 +479,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var variation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var variation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new VariationCoefficientLogNormalDistribution(2) { Mean = mean, @@ -491,9 +505,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var variation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var variation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new VariationCoefficientLogNormalDistribution(2) { Mean = mean, @@ -518,9 +531,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var variation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var variation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new VariationCoefficientLogNormalDistribution(2) { Mean = mean, @@ -577,9 +589,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var variation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var variation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new VariationCoefficientLogNormalDistribution(2) { Mean = mean, @@ -604,9 +615,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var variation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var variation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new VariationCoefficientNormalDistribution(2) { Mean = mean, @@ -631,9 +641,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var variation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var variation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new VariationCoefficientNormalDistribution(2) { Mean = mean, @@ -658,7 +667,6 @@ // Setup var input = new StabilityPointStructuresInput(); var random = new Random(22); - int levellingCount = random.Next(); // Call @@ -706,9 +714,8 @@ // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); - - var mean = (RoundedDouble)(0.01 + random.NextDouble()); - var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); var expectedDistribution = new NormalDistribution(2) { Mean = mean, @@ -731,9 +738,8 @@ public void Properties_EvaluationLevel_ExpectedValues() { // Setup - var input = new StabilityPointStructuresInput(); - var random = new Random(22); + var input = new StabilityPointStructuresInput(); var evaluationLevel = new RoundedDouble(5, random.NextDouble()); // Call @@ -748,9 +754,8 @@ public void Properties_VerticalDistance_ExpectedValues() { // Setup - var input = new StabilityPointStructuresInput(); - var random = new Random(22); + var input = new StabilityPointStructuresInput(); var verticalDistance = new RoundedDouble(5, random.NextDouble()); // Call @@ -761,32 +766,6 @@ AssertAreEqual(verticalDistance, input.VerticalDistance); } - [Test] - public void Properties_StructureNull_DoesNotChangeValues() - { - var input = new StabilityPointStructuresInput(); - - // Call - input.Structure = null; - - // Assert - AssertStabilityPointStructure(null, input); - } - - [Test] - public void Properties_Structure_UpdateValuesAccordingly() - { - // Setup - var input = new StabilityPointStructuresInput(); - TestStabilityPointStructure structure = new TestStabilityPointStructure(); - - // Call - input.Structure = structure; - - // Assert - AssertStabilityPointStructure(structure, input); - } - #endregion #region Helpers