Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rdab03b7e80b00b4187e2dd118fc0a04a62d22007 -ra39f463976dde75aa79b34ddb0b27323b95e295a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision dab03b7e80b00b4187e2dd118fc0a04a62d22007) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision a39f463976dde75aa79b34ddb0b27323b95e295a) @@ -100,6 +100,15 @@ } /// + /// Looks up a localized string similar to Overslagdebiet. + /// + public static string Categories_OvertoppingRate_Result { + get { + return ResourceManager.GetString("Categories_OvertoppingRate_Result", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Kritisch overslagdebiet per strekkende meter.. /// public static string CriticalFlowRate_Description { @@ -353,6 +362,24 @@ } /// + /// Looks up a localized string similar to Het berekende overslagdebiet.. + /// + public static string GrassCoverErosionInwardsOutput_OvertoppingRate_Description { + get { + return ResourceManager.GetString("GrassCoverErosionInwardsOutput_OvertoppingRate_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Overslagdebiet [m3/s]. + /// + public static string GrassCoverErosionInwardsOutput_OvertoppingRate_DisplayName { + get { + return ResourceManager.GetString("GrassCoverErosionInwardsOutput_OvertoppingRate_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to De golfhoogte van de overslag deelberekening.. /// public static string GrassCoverErosionInwardsOutput_WaveHeight_Description { @@ -380,6 +407,15 @@ } /// + /// Looks up a localized string similar to Is convergentie bereikt in de overslagdebiet berekening?. + /// + public static string OvertoppingRateAssessmentOutput_Convergence_Description { + get { + return ResourceManager.GetString("OvertoppingRateAssessmentOutput_Convergence_Description", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Geeft aan of ook het overslagdebiet moet worden berekend.. /// public static string OvertoppingRateCalculationType_Description { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx =================================================================== diff -u -rdab03b7e80b00b4187e2dd118fc0a04a62d22007 -ra39f463976dde75aa79b34ddb0b27323b95e295a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision dab03b7e80b00b4187e2dd118fc0a04a62d22007) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision a39f463976dde75aa79b34ddb0b27323b95e295a) @@ -225,4 +225,16 @@ Is convergentie bereikt in de HBN berekening? + + Overslagdebiet + + + Het berekende overslagdebiet. + + + Overslagdebiet [m3/s] + + + Is convergentie bereikt in de overslagdebiet berekening? + \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsOutputProperties.cs =================================================================== diff -u -r8cb270db5fbcb82f19d6f3a390f083e9e0516d8c -ra39f463976dde75aa79b34ddb0b27323b95e295a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsOutputProperties.cs (.../GrassCoverErosionInwardsOutputProperties.cs) (revision 8cb270db5fbcb82f19d6f3a390f083e9e0516d8c) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsOutputProperties.cs (.../GrassCoverErosionInwardsOutputProperties.cs) (revision a39f463976dde75aa79b34ddb0b27323b95e295a) @@ -42,13 +42,14 @@ [DynamicVisibleValidationMethod] public bool DynamicVisibleValidationMethod(string propertyName) { - return data.DikeHeightAssessmentOutput != null; + return propertyName.Contains(nameof(DikeHeight)) && data.DikeHeightAssessmentOutput != null + || propertyName.Contains(nameof(OvertoppingRate)) && data.OvertoppingRateAssessmentOutput != null; } #region GrassCoverErosionInwards result [PropertyOrder(1)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 2)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ProbabilityAssessmentOutput_RequiredProbability_Displayname))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ProbabilityAssessmentOutput_RequiredProbability_Description))] public string RequiredProbability @@ -60,7 +61,7 @@ } [PropertyOrder(2)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 2)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ProbabilityAssessmentOutput_RequiredReliability_Displayname))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ProbabilityAssessmentOutput_RequiredReliability_Description))] public RoundedDouble RequiredReliability @@ -72,7 +73,7 @@ } [PropertyOrder(3)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 2)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ProbabilityAssessmentOutput_Probability_Displayname))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ProbabilityAssessmentOutput_Probability_Description))] public string Probability @@ -84,7 +85,7 @@ } [PropertyOrder(4)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 2)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ProbabilityAssessmentOutput_Reliability_Displayname))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ProbabilityAssessmentOutput_Reliability_Description))] public RoundedDouble Reliability @@ -96,7 +97,7 @@ } [PropertyOrder(5)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 2)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ProbabilityAssessmentOutput_FactorOfSafety_Displayname))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ProbabilityAssessmentOutput_FactorOfSafety_Description))] public RoundedDouble FactorOfSafety @@ -108,7 +109,7 @@ } [PropertyOrder(6)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 2)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 3)] [ResourcesDisplayName(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_WaveHeight_Displayname))] [ResourcesDescription(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_WaveHeight_Description))] public RoundedDouble WaveHeight @@ -120,7 +121,7 @@ } [PropertyOrder(7)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 2)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result), 1, 3)] [ResourcesDisplayName(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_IsOvertoppingDominant_Displayname))] [ResourcesDescription(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_IsOvertoppingDominant_Description))] public bool IsOvertoppingDominant @@ -137,98 +138,184 @@ [PropertyOrder(8)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 2)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 3)] [ResourcesDisplayName(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_DikeHeight_DisplayName))] [ResourcesDescription(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_DikeHeight_Description))] public RoundedDouble DikeHeight { get { - return data.DikeHeightAssessmentOutput == null - ? RoundedDouble.NaN - : data.DikeHeightAssessmentOutput.Result; + return data.DikeHeightAssessmentOutput?.Result + ?? RoundedDouble.NaN; } } [PropertyOrder(9)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 2)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetProbability_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetProbability_Description))] [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] - public double TargetProbability + public double DikeHeightTargetProbability { get { - return data.DikeHeightAssessmentOutput == null - ? double.NaN - : data.DikeHeightAssessmentOutput.TargetProbability; + return data.DikeHeightAssessmentOutput?.TargetProbability + ?? double.NaN; } } [PropertyOrder(10)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 2)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetReliability_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetReliability_Description))] [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble TargetReliability + public RoundedDouble DikeHeightTargetReliability { get { - return data.DikeHeightAssessmentOutput == null - ? RoundedDouble.NaN - : data.DikeHeightAssessmentOutput.TargetReliability; + return data.DikeHeightAssessmentOutput?.TargetReliability + ?? RoundedDouble.NaN; } } [PropertyOrder(11)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 2)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedProbability_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedProbability_Description))] [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] - public double CalculatedProbability + public double DikeHeightCalculatedProbability { get { - return data.DikeHeightAssessmentOutput == null - ? double.NaN - : data.DikeHeightAssessmentOutput.CalculatedProbability; + return data.DikeHeightAssessmentOutput?.CalculatedProbability + ?? double.NaN; } } [PropertyOrder(12)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 2)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedReliability_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedReliability_Description))] [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble CalculatedReliability + public RoundedDouble DikeHeightCalculatedReliability { get { - return data.DikeHeightAssessmentOutput == null - ? RoundedDouble.NaN - : data.DikeHeightAssessmentOutput.CalculatedReliability; + return data.DikeHeightAssessmentOutput?.CalculatedReliability + ?? RoundedDouble.NaN; } } [PropertyOrder(13)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 2)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_DikeHeight_Result), 2, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_Convergence_DisplayName))] [ResourcesDescription(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.DikeHeightAssessmentOutput_Convergence_Description))] - public string Convergence + public string DikeHeightConvergence { get { - return new EnumDisplayWrapper(data.DikeHeightAssessmentOutput == null - ? CalculationConvergence.NotCalculated - : data.DikeHeightAssessmentOutput.CalculationConvergence).DisplayName; + return new EnumDisplayWrapper(data.DikeHeightAssessmentOutput?.CalculationConvergence + ?? CalculationConvergence.NotCalculated).DisplayName; } } #endregion + + #region Overtopping rate + + [PropertyOrder(14)] + [DynamicVisible] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesDisplayName(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_OvertoppingRate_DisplayName))] + [ResourcesDescription(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_OvertoppingRate_Description))] + public RoundedDouble OvertoppingRate + { + get + { + return data.OvertoppingRateAssessmentOutput?.Result + ?? RoundedDouble.NaN; + } + } + + [PropertyOrder(15)] + [DynamicVisible] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetProbability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetProbability_Description))] + [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] + public double OvertoppingRateTargetProbability + { + get + { + return data.OvertoppingRateAssessmentOutput?.TargetProbability + ?? double.NaN; + } + } + + [PropertyOrder(16)] + [DynamicVisible] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetReliability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetReliability_Description))] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble OvertoppingRateTargetReliability + { + get + { + return data.OvertoppingRateAssessmentOutput?.TargetReliability + ?? RoundedDouble.NaN; + } + } + + [PropertyOrder(17)] + [DynamicVisible] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedProbability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedProbability_Description))] + [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] + public double OvertoppingRateCalculatedProbability + { + get + { + return data.OvertoppingRateAssessmentOutput?.CalculatedProbability + ?? double.NaN; + } + } + + [PropertyOrder(18)] + [DynamicVisible] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedReliability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedReliability_Description))] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble OvertoppingRateCalculatedReliability + { + get + { + return data.OvertoppingRateAssessmentOutput?.CalculatedReliability + ?? RoundedDouble.NaN; + } + } + + [PropertyOrder(19)] + [DynamicVisible] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_Convergence_DisplayName))] + [ResourcesDescription(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.OvertoppingRateAssessmentOutput_Convergence_Description))] + public string OvertoppingRateConvergence + { + get + { + return new EnumDisplayWrapper(data.OvertoppingRateAssessmentOutput?.CalculationConvergence + ?? CalculationConvergence.NotCalculated).DisplayName; + } + } + + #endregion } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsOutputPropertiesTest.cs =================================================================== diff -u -r8cb270db5fbcb82f19d6f3a390f083e9e0516d8c -ra39f463976dde75aa79b34ddb0b27323b95e295a --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsOutputPropertiesTest.cs (.../GrassCoverErosionInwardsOutputPropertiesTest.cs) (revision 8cb270db5fbcb82f19d6f3a390f083e9e0516d8c) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsOutputPropertiesTest.cs (.../GrassCoverErosionInwardsOutputPropertiesTest.cs) (revision a39f463976dde75aa79b34ddb0b27323b95e295a) @@ -47,13 +47,10 @@ private const int factorOfSafetyPropertyIndex = 4; private const int waveHeightIndex = 5; private const int isDominantIndex = 6; - private const int dikeHeightIndex = 7; - private const int dikeHeightTargetProbabilityIndex = 8; - private const int dikeHeightTargetReliabilityIndex = 9; - private const int dikeHeightCalculatedProbabilityIndex = 10; - private const int dikeHeightCalculatedReliabilityIndex = 11; - private const int dikeHeightCalculationConvergenceIndex = 12; + private const int firstSubCalculationOutputIndex = 7; + private const int secondSubCalculationOutputIndex = 13; + [Test] public void Constructor_ExpectedValues() { @@ -116,25 +113,43 @@ Assert.AreEqual(2, properties.DikeHeight.NumberOfDecimalPlaces); Assert.AreEqual(dikeHeight, properties.DikeHeight, properties.DikeHeight.GetAccuracy()); - Assert.AreEqual(dikeHeightTargetProbability, properties.TargetProbability); + Assert.AreEqual(dikeHeightTargetProbability, properties.DikeHeightTargetProbability); Assert.IsTrue(TypeUtils.HasTypeConverter(p => p.TargetProbability)); - Assert.AreEqual(dikeHeightTargetReliability, properties.TargetReliability, properties.TargetReliability.GetAccuracy()); + NoProbabilityValueDoubleConverter>(p => p.DikeHeightTargetProbability)); + Assert.AreEqual(dikeHeightTargetReliability, properties.DikeHeightTargetReliability, properties.DikeHeightTargetReliability.GetAccuracy()); Assert.IsTrue(TypeUtils.HasTypeConverter(p => p.TargetReliability)); - Assert.AreEqual(dikeHeightCalculatedProbability, properties.CalculatedProbability); + NoValueRoundedDoubleConverter>(p => p.DikeHeightTargetReliability)); + Assert.AreEqual(dikeHeightCalculatedProbability, properties.DikeHeightCalculatedProbability); Assert.IsTrue(TypeUtils.HasTypeConverter(p => p.CalculatedProbability)); - Assert.AreEqual(dikeHeightCalculatedReliability, properties.CalculatedReliability, properties.CalculatedReliability.GetAccuracy()); + NoProbabilityValueDoubleConverter>(p => p.DikeHeightCalculatedProbability)); + Assert.AreEqual(dikeHeightCalculatedReliability, properties.DikeHeightCalculatedReliability, properties.DikeHeightCalculatedReliability.GetAccuracy()); Assert.IsTrue(TypeUtils.HasTypeConverter(p => p.CalculatedReliability)); + NoValueRoundedDoubleConverter>(p => p.DikeHeightCalculatedReliability)); - string convergenceValue = new EnumDisplayWrapper(dikeHeightConvergence).DisplayName; - Assert.AreEqual(convergenceValue, properties.Convergence); + string dikeHeightConvergenceValue = new EnumDisplayWrapper(dikeHeightConvergence).DisplayName; + Assert.AreEqual(dikeHeightConvergenceValue, properties.DikeHeightConvergence); + + Assert.AreEqual(2, properties.OvertoppingRate.NumberOfDecimalPlaces); + Assert.AreEqual(overtoppingRate, properties.OvertoppingRate, properties.OvertoppingRate.GetAccuracy()); + Assert.AreEqual(overtoppingRateTargetProbability, properties.OvertoppingRateTargetProbability); + Assert.IsTrue(TypeUtils.HasTypeConverter(p => p.OvertoppingRateTargetProbability)); + Assert.AreEqual(overtoppingRateTargetReliability, properties.OvertoppingRateTargetReliability, properties.OvertoppingRateTargetReliability.GetAccuracy()); + Assert.IsTrue(TypeUtils.HasTypeConverter(p => p.OvertoppingRateTargetReliability)); + Assert.AreEqual(overtoppingRateCalculatedProbability, properties.OvertoppingRateCalculatedProbability); + Assert.IsTrue(TypeUtils.HasTypeConverter(p => p.OvertoppingRateCalculatedProbability)); + Assert.AreEqual(overtoppingRateCalculatedReliability, properties.OvertoppingRateCalculatedReliability, properties.OvertoppingRateCalculatedReliability.GetAccuracy()); + Assert.IsTrue(TypeUtils.HasTypeConverter(p => p.OvertoppingRateCalculatedReliability)); + + string overtoppingRateConvergenceValue = new EnumDisplayWrapper(overtoppingRateConvergence).DisplayName; + Assert.AreEqual(overtoppingRateConvergenceValue, properties.OvertoppingRateConvergence); } [Test] - public void PropertyAttributes_WithDikeHeightCalculated_ReturnExpectedValues() + public void PropertyAttributes_WithDikeHeightAndOvertoppingRateCalculated_ReturnExpectedValues() { // Setup var probabilityAssessmentOutput = new ProbabilityAssessmentOutput(double.NaN, double.NaN, double.NaN, double.NaN, double.NaN); @@ -152,11 +167,85 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(19, dynamicProperties.Count); + + AssertResultOutputProperties(dynamicProperties); + AssertDikeHeightOutputProperties(dynamicProperties, firstSubCalculationOutputIndex); + AssertOvertoppingRateOutputProperties(dynamicProperties, secondSubCalculationOutputIndex); + } + + [Test] + [TestCase(true, false)] + [TestCase(false, true)] + public void PropertyAttributes_WithDikeHeightOrOvertoppingRateCalculated_ReturnExpectedValues(bool dikeHeightCalculated, + bool overtoppingRateCalculated) + { + // Setup + var probabilityAssessmentOutput = new ProbabilityAssessmentOutput(double.NaN, double.NaN, double.NaN, double.NaN, double.NaN); + SubCalculationAssessmentOutput dikeHeightAssessmentOutput = null; + SubCalculationAssessmentOutput overtoppingRateAssessmentOutput = null; + + if (dikeHeightCalculated) + { + dikeHeightAssessmentOutput = new TestSubCalculationAssessmentOutput(double.NaN); + } + + if (overtoppingRateCalculated) + { + overtoppingRateAssessmentOutput = new TestSubCalculationAssessmentOutput(double.NaN); + } + + var output = new GrassCoverErosionInwardsOutput(double.NaN, true, probabilityAssessmentOutput, + dikeHeightAssessmentOutput, + overtoppingRateAssessmentOutput); + + // Call + var properties = new GrassCoverErosionInwardsOutputProperties + { + Data = output + }; + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(13, dynamicProperties.Count); + AssertResultOutputProperties(dynamicProperties); + + if (dikeHeightCalculated) + { + AssertDikeHeightOutputProperties(dynamicProperties, firstSubCalculationOutputIndex); + } + + if (overtoppingRateCalculated) + { + AssertOvertoppingRateOutputProperties(dynamicProperties, firstSubCalculationOutputIndex); + } + } + + [Test] + public void PropertyAttributes_WithoutDikeHeightAndOvertoppingRateCalculated_ReturnExpectedValues() + { + // Setup + var probabilityAssessmentOutput = new ProbabilityAssessmentOutput(double.NaN, double.NaN, double.NaN, double.NaN, double.NaN); + var output = new GrassCoverErosionInwardsOutput(double.NaN, true, probabilityAssessmentOutput, null, null); + + // Call + var properties = new GrassCoverErosionInwardsOutputProperties + { + Data = output + }; + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(7, dynamicProperties.Count); + + AssertResultOutputProperties(dynamicProperties); + } + + private static void AssertResultOutputProperties(PropertyDescriptorCollection dynamicProperties) + { + const string resultCategory = "\t\tResultaat"; PropertyDescriptor requiredProbabilityProperty = dynamicProperties[requiredProbabilityPropertyIndex]; - const string resultCategory = "\tResultaat"; - const string hbnCategory = "HBN"; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(requiredProbabilityProperty, resultCategory, "Faalkanseis [1/jaar]", @@ -204,116 +293,98 @@ "Overslag dominant [-]", "Is het resultaat van de overslag deelberekening dominant over de overloop deelberekening.", true); + } + private static void AssertDikeHeightOutputProperties(PropertyDescriptorCollection dynamicProperties, int dikeHeightIndex) + { + const string category = "\tHBN"; PropertyDescriptor dikeHeightProperty = dynamicProperties[dikeHeightIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dikeHeightProperty, - hbnCategory, + category, "HBN [m+NAP]", "Het berekende Hydraulisch Belasting Niveau (HBN).", true); - PropertyDescriptor dikeHeightTargetProbability = dynamicProperties[dikeHeightTargetProbabilityIndex]; + PropertyDescriptor dikeHeightTargetProbability = dynamicProperties[dikeHeightIndex + 1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dikeHeightTargetProbability, - hbnCategory, + category, "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); - PropertyDescriptor dikeHeightTargetReliability = dynamicProperties[dikeHeightTargetReliabilityIndex]; + PropertyDescriptor dikeHeightTargetReliability = dynamicProperties[dikeHeightIndex + 2]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dikeHeightTargetReliability, - hbnCategory, + category, "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); - PropertyDescriptor dikeHeightCalculatedProbability = dynamicProperties[dikeHeightCalculatedProbabilityIndex]; + PropertyDescriptor dikeHeightCalculatedProbability = dynamicProperties[dikeHeightIndex + 3]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dikeHeightCalculatedProbability, - hbnCategory, + category, "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); - PropertyDescriptor dikeHeightCalculatedReliability = dynamicProperties[dikeHeightCalculatedReliabilityIndex]; + PropertyDescriptor dikeHeightCalculatedReliability = dynamicProperties[dikeHeightIndex + 4]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dikeHeightCalculatedReliability, - hbnCategory, + category, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); - PropertyDescriptor dikeHeightCalculationConvergence = dynamicProperties[dikeHeightCalculationConvergenceIndex]; + PropertyDescriptor dikeHeightCalculationConvergence = dynamicProperties[dikeHeightIndex + 5]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dikeHeightCalculationConvergence, - hbnCategory, + category, "Convergentie", "Is convergentie bereikt in de HBN berekening?", true); } - [Test] - public void PropertyAttributes_WithoutDikeHeightCalculated_ReturnExpectedValues() + private static void AssertOvertoppingRateOutputProperties(PropertyDescriptorCollection dynamicProperties, int overtoppingRateIndex) { - // Setup - var probabilityAssessmentOutput = new ProbabilityAssessmentOutput(double.NaN, double.NaN, double.NaN, double.NaN, double.NaN); - var output = new GrassCoverErosionInwardsOutput(double.NaN, true, probabilityAssessmentOutput, null, null); - - // Call - var properties = new GrassCoverErosionInwardsOutputProperties - { - Data = output - }; - - // Assert - PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(7, dynamicProperties.Count); - - PropertyDescriptor requiredProbabilityProperty = dynamicProperties[requiredProbabilityPropertyIndex]; - const string resultCategory = "\tResultaat"; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(requiredProbabilityProperty, - resultCategory, - "Faalkanseis [1/jaar]", - "De maximaal toegestane faalkanseis voor het toetsspoor.", + const string overtoppingRateCategory = "Overslagdebiet"; + PropertyDescriptor overtoppingRateProperty = dynamicProperties[overtoppingRateIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(overtoppingRateProperty, + overtoppingRateCategory, + "Overslagdebiet [m3/s]", + "Het berekende overslagdebiet.", true); - PropertyDescriptor requiredReliabilityProperty = dynamicProperties[requiredReliabilityPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(requiredReliabilityProperty, - resultCategory, - "Betrouwbaarheidsindex faalkanseis [-]", - "De betrouwbaarheidsindex van de faalkanseis voor het toetsspoor.", + PropertyDescriptor overtoppingRateTargetProbability = dynamicProperties[overtoppingRateIndex + 1]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(overtoppingRateTargetProbability, + overtoppingRateCategory, + "Doelkans [1/jaar]", + "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); - PropertyDescriptor probabilityProperty = dynamicProperties[probabilityPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(probabilityProperty, - resultCategory, - "Faalkans [1/jaar]", - "De kans dat het toetsspoor optreedt voor deze berekening.", + PropertyDescriptor overtoppingRateTargetReliability = dynamicProperties[overtoppingRateIndex + 2]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(overtoppingRateTargetReliability, + overtoppingRateCategory, + "Betrouwbaarheidsindex doelkans [-]", + "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); - PropertyDescriptor reliabilityProperty = dynamicProperties[reliabilityPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(reliabilityProperty, - resultCategory, - "Betrouwbaarheidsindex faalkans [-]", - "De betrouwbaarheidsindex van de faalkans voor deze berekening.", + PropertyDescriptor overtoppingRateCalculatedProbability = dynamicProperties[overtoppingRateIndex + 3]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(overtoppingRateCalculatedProbability, + overtoppingRateCategory, + "Berekende kans [1/jaar]", + "De berekende kans van voorkomen van het berekende resultaat.", true); - PropertyDescriptor factorOfSafetyProperty = dynamicProperties[factorOfSafetyPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(factorOfSafetyProperty, - resultCategory, - "Veiligheidsfactor [-]", - "De veiligheidsfactor voor deze berekening.", + PropertyDescriptor overtoppingRateCalculatedReliability = dynamicProperties[overtoppingRateIndex + 4]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(overtoppingRateCalculatedReliability, + overtoppingRateCategory, + "Betrouwbaarheidsindex berekende kans [-]", + "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); - PropertyDescriptor waveHeightProperty = dynamicProperties[waveHeightIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveHeightProperty, - resultCategory, - "Indicatieve golfhoogte (Hs) [m]", - "De golfhoogte van de overslag deelberekening.", + PropertyDescriptor overtoppingRateCalculationConvergence = dynamicProperties[overtoppingRateIndex + 5]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(overtoppingRateCalculationConvergence, + overtoppingRateCategory, + "Convergentie", + "Is convergentie bereikt in de overslagdebiet berekening?", true); - - PropertyDescriptor isDominantProperty = dynamicProperties[isDominantIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(isDominantProperty, - resultCategory, - "Overslag dominant [-]", - "Is het resultaat van de overslag deelberekening dominant over de overloop deelberekening.", - true); } } } \ No newline at end of file