Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PropertyClasses/OvertoppingOutputProperties.cs =================================================================== diff -u -rd035c50148ee25842cf79e54725cf00a53b9be9f -r274a262e162c6766c8cfe71bca8b7d2420983dbc --- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PropertyClasses/OvertoppingOutputProperties.cs (.../OvertoppingOutputProperties.cs) (revision d035c50148ee25842cf79e54725cf00a53b9be9f) +++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PropertyClasses/OvertoppingOutputProperties.cs (.../OvertoppingOutputProperties.cs) (revision 274a262e162c6766c8cfe71bca8b7d2420983dbc) @@ -82,30 +82,6 @@ [PropertyOrder(1)] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 2)] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_RequiredProbability_Displayname))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_RequiredProbability_Description))] - public string RequiredProbability - { - get - { - return ProbabilityFormattingHelper.Format(derivedOutput.RequiredProbability); - } - } - - [PropertyOrder(2)] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 2)] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_RequiredReliability_Displayname))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_RequiredReliability_Description))] - public RoundedDouble RequiredReliability - { - get - { - return derivedOutput.RequiredReliability; - } - } - - [PropertyOrder(3)] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 2)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_Probability_Displayname))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_Probability_Description))] public string Probability @@ -116,7 +92,7 @@ } } - [PropertyOrder(4)] + [PropertyOrder(2)] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 2)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_Reliability_Displayname))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_Reliability_Description))] @@ -128,19 +104,7 @@ } } - [PropertyOrder(5)] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 2)] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_FactorOfSafety_Displayname))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_FactorOfSafety_Description))] - public RoundedDouble FactorOfSafety - { - get - { - return derivedOutput.FactorOfSafety; - } - } - - [PropertyOrder(6)] + [PropertyOrder(3)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 2)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.GrassCoverErosionInwardsOutput_WaveHeight_Displayname))] @@ -153,7 +117,7 @@ } } - [PropertyOrder(7)] + [PropertyOrder(4)] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 2)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.GrassCoverErosionInwardsOutput_IsOvertoppingDominant_Displayname))] [ResourcesDescription(typeof(Resources), nameof(Resources.GrassCoverErosionInwardsOutput_IsOvertoppingDominant_Description))] Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PropertyClasses/OvertoppingOutputPropertiesTest.cs =================================================================== diff -u -r1ba3eebbfe2ac3df531f67700f8f787302d8582c -r274a262e162c6766c8cfe71bca8b7d2420983dbc --- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PropertyClasses/OvertoppingOutputPropertiesTest.cs (.../OvertoppingOutputPropertiesTest.cs) (revision 1ba3eebbfe2ac3df531f67700f8f787302d8582c) +++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PropertyClasses/OvertoppingOutputPropertiesTest.cs (.../OvertoppingOutputPropertiesTest.cs) (revision 274a262e162c6766c8cfe71bca8b7d2420983dbc) @@ -43,17 +43,14 @@ [TestFixture] public class OvertoppingOutputPropertiesTest { - private const int requiredProbabilityPropertyIndex = 0; - private const int requiredReliabilityPropertyIndex = 1; - private const int probabilityPropertyIndex = 2; - private const int reliabilityPropertyIndex = 3; - private const int factorOfSafetyPropertyIndex = 4; - private const int waveHeightIndex = 5; - private const int isDominantIndex = 6; - private const int windDirectionPropertyIndex = 7; - private const int alphaValuesPropertyIndex = 8; - private const int durationsPropertyIndex = 9; - private const int illustrationPointsPropertyIndex = 10; + private const int probabilityPropertyIndex = 0; + private const int reliabilityPropertyIndex = 1; + private const int waveHeightIndex = 2; + private const int isDominantIndex = 3; + private const int windDirectionPropertyIndex = 4; + private const int alphaValuesPropertyIndex = 5; + private const int durationsPropertyIndex = 6; + private const int illustrationPointsPropertyIndex = 7; private const string resultCategoryName = "\tSterkte berekening"; private const string illustrationPointsCategoryName = "Illustratiepunten"; @@ -92,10 +89,10 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call - TestDelegate test = () => new OvertoppingOutputProperties(null, failureMechanism, assessmentSection); + void Call() => new OvertoppingOutputProperties(null, failureMechanism, assessmentSection); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("overtoppingOutput", exception.ParamName); mocks.VerifyAll(); } @@ -109,10 +106,10 @@ mocks.ReplayAll(); // Call - TestDelegate test = () => new OvertoppingOutputProperties(new TestOvertoppingOutput(0), null, assessmentSection); + void Call() => new OvertoppingOutputProperties(new TestOvertoppingOutput(0), null, assessmentSection); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); mocks.VerifyAll(); } @@ -121,12 +118,10 @@ public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new OvertoppingOutputProperties(new TestOvertoppingOutput(0), - new GrassCoverErosionInwardsFailureMechanism(), - null); + void Call() => new OvertoppingOutputProperties(new TestOvertoppingOutput(0), new GrassCoverErosionInwardsFailureMechanism(), null); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("assessmentSection", exception.ParamName); } @@ -161,11 +156,7 @@ Assert.AreEqual(2, properties.WaveHeight.NumberOfDecimalPlaces); Assert.AreEqual(waveHeight, properties.WaveHeight, properties.WaveHeight.GetAccuracy()); Assert.AreEqual(reliability, properties.Reliability, properties.Reliability.GetAccuracy()); - Assert.AreEqual(double.PositiveInfinity, properties.RequiredReliability, properties.RequiredReliability.GetAccuracy()); - Assert.AreEqual(3, properties.FactorOfSafety.NumberOfDecimalPlaces); - Assert.AreEqual(0, properties.FactorOfSafety, properties.FactorOfSafety.GetAccuracy()); - Assert.AreEqual(ProbabilityFormattingHelper.Format(0), properties.RequiredProbability); Assert.AreEqual(ProbabilityFormattingHelper.Format(0.5), properties.Probability); Assert.AreEqual(isOvertoppingDominant, properties.IsOvertoppingDominant); @@ -236,25 +227,11 @@ var properties = new OvertoppingOutputProperties(overtoppingOutput, failureMechanism, assessmentSection); // Assert - int propertiesCount = overtoppingOutput.HasWaveHeight ? 7 : 6; + int propertiesCount = overtoppingOutput.HasWaveHeight ? 4 : 3; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(propertiesCount, dynamicProperties.Count); - PropertyDescriptor requiredProbabilityProperty = dynamicProperties[requiredProbabilityPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(requiredProbabilityProperty, - resultCategoryName, - "Faalkanseis [1/jaar]", - "De maximaal toegestane faalkanseis voor het toetsspoor.", - true); - - PropertyDescriptor requiredReliabilityProperty = dynamicProperties[requiredReliabilityPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(requiredReliabilityProperty, - resultCategoryName, - "Betrouwbaarheidsindex faalkanseis [-]", - "De betrouwbaarheidsindex van de faalkanseis voor het toetsspoor.", - true); - PropertyDescriptor probabilityProperty = dynamicProperties[probabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(probabilityProperty, resultCategoryName, @@ -269,13 +246,6 @@ "De betrouwbaarheidsindex van de faalkans voor deze berekening.", true); - PropertyDescriptor factorOfSafetyProperty = dynamicProperties[factorOfSafetyPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(factorOfSafetyProperty, - resultCategoryName, - "Veiligheidsfactor [-]", - "De veiligheidsfactor voor deze berekening.", - true); - if (overtoppingOutput.HasWaveHeight) { PropertyDescriptor waveHeightProperty = dynamicProperties[waveHeightIndex]; @@ -320,25 +290,11 @@ var properties = new OvertoppingOutputProperties(overtoppingOutput, failureMechanism, assessmentSection); // Assert - int propertiesCount = overtoppingOutput.HasWaveHeight ? 11 : 10; + int propertiesCount = overtoppingOutput.HasWaveHeight ? 8 : 7; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(propertiesCount, dynamicProperties.Count); - PropertyDescriptor requiredProbabilityProperty = dynamicProperties[requiredProbabilityPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(requiredProbabilityProperty, - resultCategoryName, - "Faalkanseis [1/jaar]", - "De maximaal toegestane faalkanseis voor het toetsspoor.", - true); - - PropertyDescriptor requiredReliabilityProperty = dynamicProperties[requiredReliabilityPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(requiredReliabilityProperty, - resultCategoryName, - "Betrouwbaarheidsindex faalkanseis [-]", - "De betrouwbaarheidsindex van de faalkanseis voor het toetsspoor.", - true); - PropertyDescriptor probabilityProperty = dynamicProperties[probabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(probabilityProperty, resultCategoryName, @@ -353,13 +309,6 @@ "De betrouwbaarheidsindex van de faalkans voor deze berekening.", true); - PropertyDescriptor factorOfSafetyProperty = dynamicProperties[factorOfSafetyPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(factorOfSafetyProperty, - resultCategoryName, - "Veiligheidsfactor [-]", - "De veiligheidsfactor voor deze berekening.", - true); - if (overtoppingOutput.HasWaveHeight) { PropertyDescriptor waveHeightProperty = dynamicProperties[waveHeightIndex];