Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs =================================================================== diff -u -r7a7964c2eb9844cb44c4c02a807bae60e67c4bfe -rc7da0846a135f849273407e16fe52237371e8f7a --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision 7a7964c2eb9844cb44c4c02a807bae60e67c4bfe) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision c7da0846a135f849273407e16fe52237371e8f7a) @@ -32,6 +32,9 @@ namespace Ringtoets.ClosingStructures.Data { + /// + /// Class that holds all closing structures calculation specific input parameters. + /// public class ClosingStructuresInput : Observable, ICalculationInput { private readonly NormalDistribution modelFactorSuperCriticalFlow; @@ -55,6 +58,9 @@ private RoundedDouble deviationWaveDirection; private ForeshoreProfile foreshoreProfile; + /// + /// Creates a new instance of the class. + /// public ClosingStructuresInput() { structureNormalOrientation = new RoundedDouble(2); @@ -137,12 +143,95 @@ UpdateForeshoreProperties(); } - #region Hydraulic Boundary Location + #region Hydraulic load and data properties public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; set; } + #region Foreshore Profile + + /// + /// Gets or sets the foreshore profile. + /// + public ForeshoreProfile ForeshoreProfile + { + get + { + return foreshoreProfile; + } + set + { + foreshoreProfile = value; + UpdateForeshoreProperties(); + } + } + + /// + /// Gets or sets whether the needs to be taken into account. + /// + public bool UseBreakWater { get; set; } + + /// + /// Gets or sets whether the needs to be taken into account. + /// + public bool UseForeshore { get; set; } + + /// + /// Gets the geometry of the foreshore. + /// + public RoundedPoint2DCollection ForeshoreGeometry + { + get + { + return foreshoreProfile != null + ? foreshoreProfile.Geometry + : new RoundedPoint2DCollection(2, Enumerable.Empty()); + } + } + + /// + /// Gets the . + /// + public BreakWater BreakWater { get; private set; } + + private void UpdateForeshoreProperties() + { + if (foreshoreProfile == null) + { + UseForeshore = false; + UseBreakWater = false; + BreakWater = GetDefaultBreakWaterProperties(); + } + else + { + UseForeshore = foreshoreProfile.Geometry.Count() > 1; + UseBreakWater = foreshoreProfile.HasBreakWater; + BreakWater = foreshoreProfile.HasBreakWater ? + new BreakWater(foreshoreProfile.BreakWater.Type, foreshoreProfile.BreakWater.Height) : + GetDefaultBreakWaterProperties(); + } + } + + private BreakWater GetDefaultBreakWaterProperties() + { + return new BreakWater(BreakWaterType.Dam, 0.0); + } + #endregion + #endregion + + #region Model inputs + + #endregion + + #region Schematization + + #endregion + + #region Hydraulic Boundary Location + + #endregion + #region Structure properties /// @@ -176,11 +265,10 @@ } set { - RoundedDouble newOrientationValue = value.ToPrecision(structureNormalOrientation.NumberOfDecimalPlaces); newOrientationValue = ValidateStructureNormalOrientationInRange(newOrientationValue); - structureNormalOrientation = newOrientationValue; + structureNormalOrientation = newOrientationValue; } } @@ -236,7 +324,7 @@ } set { - if (value < 0 || value > 1) + if (!ValidProbabilityValue(value)) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } @@ -257,7 +345,7 @@ } set { - if (value < 0 || value > 1) + if (!ValidProbabilityValue(value)) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } @@ -278,7 +366,7 @@ } set { - if (value < 0 || value > 1) + if (!ValidProbabilityValue(value)) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } @@ -314,7 +402,7 @@ } set { - if (value < 0 || value > 1) + if (!ValidProbabilityValue(value)) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } @@ -375,7 +463,7 @@ } /// - /// Gets or sets the area flow apertures normal distribution. + /// Gets or sets the area flow apertures. /// public LogNormalDistribution AreaFlowApertures { @@ -391,7 +479,7 @@ } /// - /// Gets or sets the level crest of structure not closing normal distribution. + /// Gets or sets the level crest of structure not closing. /// public NormalDistribution LevelCrestStructureNotClosing { @@ -407,7 +495,7 @@ } /// - /// Gets or sets the water level inside normal distribution. + /// Gets or sets the inside water level. /// public NormalDistribution InsideWaterLevel { @@ -423,7 +511,7 @@ } /// - /// Gets or sets the allowable increase of level for storage log normal distribution. + /// Gets or sets the allowable increase of level for storage. /// public LogNormalDistribution AllowedLevelIncreaseStorage { @@ -439,7 +527,7 @@ } /// - /// Gets or sets the storage structure area log normal distribution. + /// Gets or sets the storage structure area. /// public LogNormalDistribution StorageStructureArea { @@ -455,7 +543,7 @@ } /// - /// Gets or sets the flow widt at bottom protection log normal distribution. + /// Gets or sets the flow widt at bottom protection. /// public LogNormalDistribution FlowWidthAtBottomProtection { @@ -471,7 +559,7 @@ } /// - /// Gets or sets the critical overtopping discharge normal distribution. + /// Gets or sets the critical overtopping discharge. /// public LogNormalDistribution CriticalOverToppingDischarge { @@ -487,7 +575,7 @@ } /// - /// Gets or sets the width of flow apertures normal distribution. + /// Gets or sets the width of flow apertures. /// public NormalDistribution WidthFlowApertures { @@ -520,75 +608,9 @@ #endregion - #region Foreshore Profile - - /// - /// Gets or sets the foreshore profile. - /// - public ForeshoreProfile ForeshoreProfile + private bool ValidProbabilityValue(double probability) { - get - { - return foreshoreProfile; - } - set - { - foreshoreProfile = value; - UpdateForeshoreProperties(); - } + return !double.IsNaN(probability) && probability <= 1 && probability >= 0; } - - /// - /// Gets or sets whether the needs to be taken into account. - /// - public bool UseBreakWater { get; set; } - - /// - /// Gets or sets whether the needs to be taken into account. - /// - public bool UseForeshore { get; set; } - - /// - /// Gets the geometry of the foreshore. - /// - public RoundedPoint2DCollection ForeshoreGeometry - { - get - { - return foreshoreProfile != null - ? foreshoreProfile.Geometry - : new RoundedPoint2DCollection(2, Enumerable.Empty()); - } - } - - /// - /// Gets the . - /// - public BreakWater BreakWater { get; private set; } - - private void UpdateForeshoreProperties() - { - if (foreshoreProfile == null) - { - UseForeshore = false; - UseBreakWater = false; - BreakWater = GetDefaultBreakWaterProperties(); - } - else - { - UseForeshore = foreshoreProfile.Geometry.Count() > 1; - UseBreakWater = foreshoreProfile.HasBreakWater; - BreakWater = foreshoreProfile.HasBreakWater ? - new BreakWater(foreshoreProfile.BreakWater.Type, foreshoreProfile.BreakWater.Height) : - GetDefaultBreakWaterProperties(); - } - } - - private BreakWater GetDefaultBreakWaterProperties() - { - return new BreakWater(BreakWaterType.Dam, 0.0); - } - - #endregion } } \ No newline at end of file Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresCalculationTest.cs =================================================================== diff -u -ra8ffe20fbe684f5020f5158354b33fad488baac9 -rc7da0846a135f849273407e16fe52237371e8f7a --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresCalculationTest.cs (.../ClosingStructuresCalculationTest.cs) (revision a8ffe20fbe684f5020f5158354b33fad488baac9) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresCalculationTest.cs (.../ClosingStructuresCalculationTest.cs) (revision c7da0846a135f849273407e16fe52237371e8f7a) @@ -69,8 +69,11 @@ Output = null }; - // Call & Assert - Assert.IsFalse(calculation.HasOutput); + // Call + bool calculationHasOutput = calculation.HasOutput; + + // Assert + Assert.IsFalse(calculationHasOutput); } [Test] @@ -82,8 +85,11 @@ Output = new TestClosingStructuresOutput() }; - // Call & Assert - Assert.IsTrue(calculation.HasOutput); + // Call + bool calculationHasOutput = calculation.HasOutput; + + // Assert + Assert.IsTrue(calculationHasOutput); } [Test] Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresCalculationTest.cs =================================================================== diff -u -r1051f838aebbd5977351542027ce6330583b0d43 -rc7da0846a135f849273407e16fe52237371e8f7a --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresCalculationTest.cs (.../HeightStructuresCalculationTest.cs) (revision 1051f838aebbd5977351542027ce6330583b0d43) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresCalculationTest.cs (.../HeightStructuresCalculationTest.cs) (revision c7da0846a135f849273407e16fe52237371e8f7a) @@ -70,8 +70,11 @@ Output = null }; - // Call & Assert - Assert.IsFalse(calculation.HasOutput); + // Call + bool calculationHasOutput = calculation.HasOutput; + + // Assert + Assert.IsFalse(calculationHasOutput); } [Test] @@ -83,8 +86,11 @@ Output = new TestHeightStructuresOutput() }; - // Call & Assert - Assert.IsTrue(calculation.HasOutput); + // Call + bool calculationHasOutput = calculation.HasOutput; + + // Assert + Assert.IsTrue(calculationHasOutput); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationTest.cs =================================================================== diff -u -rf64dceaa32788bad28dcf09f4a1c3150595f1327 -rc7da0846a135f849273407e16fe52237371e8f7a --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationTest.cs (.../PipingCalculationTest.cs) (revision f64dceaa32788bad28dcf09f4a1c3150595f1327) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationTest.cs (.../PipingCalculationTest.cs) (revision c7da0846a135f849273407e16fe52237371e8f7a) @@ -188,8 +188,11 @@ Output = null }; - // Call & Assert - Assert.IsFalse(calculation.HasOutput); + // Call + bool calculationHasOutput = calculation.HasOutput; + + // Assert + Assert.IsFalse(calculationHasOutput); } [Test] @@ -201,8 +204,11 @@ Output = new TestPipingOutput() }; - // Call & Assert - Assert.IsTrue(calculation.HasOutput); + // Call + bool calculationHasOutput = calculation.HasOutput; + + // Assert + Assert.IsTrue(calculationHasOutput); } [Test] Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresCalculationTest.cs =================================================================== diff -u -r193e94f5864e02ed187eb5f69e29faf1305e4072 -rc7da0846a135f849273407e16fe52237371e8f7a --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresCalculationTest.cs (.../StabilityPointStructuresCalculationTest.cs) (revision 193e94f5864e02ed187eb5f69e29faf1305e4072) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresCalculationTest.cs (.../StabilityPointStructuresCalculationTest.cs) (revision c7da0846a135f849273407e16fe52237371e8f7a) @@ -119,8 +119,11 @@ Output = null }; - // Call & Assert - Assert.IsFalse(calculation.HasOutput); + // Call + bool calculationHasOutput = calculation.HasOutput; + + // Assert + Assert.IsFalse(calculationHasOutput); } [Test] @@ -132,8 +135,11 @@ Output = new TestStabilityPointStructuresOutput() }; - // Call & Assert - Assert.IsTrue(calculation.HasOutput); + // Call + bool calculationHasOutput = calculation.HasOutput; + + // Assert + Assert.IsTrue(calculationHasOutput); } [Test]