Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsOutputProperties.cs =================================================================== diff -u -r1ba3eebbfe2ac3df531f67700f8f787302d8582c -r7562693478876abe4b0d6ca27741fd452b831d12 --- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsOutputProperties.cs (.../GrassCoverErosionInwardsOutputProperties.cs) (revision 1ba3eebbfe2ac3df531f67700f8f787302d8582c) +++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsOutputProperties.cs (.../GrassCoverErosionInwardsOutputProperties.cs) (revision 7562693478876abe4b0d6ca27741fd452b831d12) @@ -88,30 +88,6 @@ [PropertyOrder(1)] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 3)] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_RequiredProbability_Displayname))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_RequiredProbability_Description))] - public string RequiredProbability - { - get - { - return ProbabilityFormattingHelper.Format(derivedOvertoppingOutput.RequiredProbability); - } - } - - [PropertyOrder(2)] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 3)] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_RequiredReliability_Displayname))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_RequiredReliability_Description))] - public RoundedDouble RequiredReliability - { - get - { - return derivedOvertoppingOutput.RequiredReliability; - } - } - - [PropertyOrder(3)] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_Probability_Displayname))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_Probability_Description))] public string Probability @@ -122,7 +98,7 @@ } } - [PropertyOrder(4)] + [PropertyOrder(2)] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_Reliability_Displayname))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_Reliability_Description))] @@ -134,19 +110,7 @@ } } - [PropertyOrder(5)] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 3)] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_FactorOfSafety_Displayname))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.ProbabilityAssessmentOutput_FactorOfSafety_Description))] - public RoundedDouble FactorOfSafety - { - get - { - return derivedOvertoppingOutput.FactorOfSafety; - } - } - - [PropertyOrder(6)] + [PropertyOrder(3)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 3)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.GrassCoverErosionInwardsOutput_WaveHeight_Displayname))] @@ -159,7 +123,7 @@ } } - [PropertyOrder(7)] + [PropertyOrder(4)] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_OvertoppingOutput), 1, 3)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.GrassCoverErosionInwardsOutput_IsOvertoppingDominant_Displayname))] [ResourcesDescription(typeof(Resources), nameof(Resources.GrassCoverErosionInwardsOutput_IsOvertoppingDominant_Description))] @@ -175,7 +139,7 @@ #region Dike height - [PropertyOrder(8)] + [PropertyOrder(5)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.DikeHeight_DisplayName), 2, 3)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.GrassCoverErosionInwardsOutput_DikeHeight_DisplayName))] @@ -189,7 +153,7 @@ } } - [PropertyOrder(9)] + [PropertyOrder(6)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.DikeHeight_DisplayName), 2, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.CalculationOutput_TargetProbability_DisplayName))] @@ -204,7 +168,7 @@ } } - [PropertyOrder(10)] + [PropertyOrder(7)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.DikeHeight_DisplayName), 2, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.CalculationOutput_TargetReliability_DisplayName))] @@ -219,7 +183,7 @@ } } - [PropertyOrder(11)] + [PropertyOrder(8)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.DikeHeight_DisplayName), 2, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.CalculationOutput_CalculatedProbability_DisplayName))] @@ -234,7 +198,7 @@ } } - [PropertyOrder(12)] + [PropertyOrder(9)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.DikeHeight_DisplayName), 2, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.CalculationOutput_CalculatedReliability_DisplayName))] @@ -249,7 +213,7 @@ } } - [PropertyOrder(13)] + [PropertyOrder(10)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.DikeHeight_DisplayName), 2, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.CalculationOutput_Convergence_DisplayName))] @@ -267,7 +231,7 @@ #region Overtopping rate - [PropertyOrder(14)] + [PropertyOrder(11)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.GrassCoverErosionInwardsOutput_OvertoppingRate_DisplayName))] @@ -282,7 +246,7 @@ } } - [PropertyOrder(15)] + [PropertyOrder(12)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.CalculationOutput_TargetProbability_DisplayName))] @@ -297,7 +261,7 @@ } } - [PropertyOrder(16)] + [PropertyOrder(13)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.CalculationOutput_TargetReliability_DisplayName))] @@ -312,7 +276,7 @@ } } - [PropertyOrder(17)] + [PropertyOrder(14)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.CalculationOutput_CalculatedProbability_DisplayName))] @@ -327,7 +291,7 @@ } } - [PropertyOrder(18)] + [PropertyOrder(15)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.CalculationOutput_CalculatedReliability_DisplayName))] @@ -342,7 +306,7 @@ } } - [PropertyOrder(19)] + [PropertyOrder(16)] [DynamicVisible] [ResourcesCategory(typeof(Resources), nameof(Resources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.CalculationOutput_Convergence_DisplayName))] Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsOutputPropertiesTest.cs =================================================================== diff -u -r1ba3eebbfe2ac3df531f67700f8f787302d8582c -r7562693478876abe4b0d6ca27741fd452b831d12 --- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsOutputPropertiesTest.cs (.../GrassCoverErosionInwardsOutputPropertiesTest.cs) (revision 1ba3eebbfe2ac3df531f67700f8f787302d8582c) +++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsOutputPropertiesTest.cs (.../GrassCoverErosionInwardsOutputPropertiesTest.cs) (revision 7562693478876abe4b0d6ca27741fd452b831d12) @@ -41,16 +41,13 @@ [TestFixture] public class GrassCoverErosionInwardsOutputPropertiesTest { - 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 probabilityPropertyIndex = 0; + private const int reliabilityPropertyIndex = 1; + private const int waveHeightIndex = 2; + private const int isDominantIndex = 3; - private const int firstHydraulicLoadsOutputIndex = 7; - private const int secondHydraulicLoadsOutputIndex = 13; + private const int firstHydraulicLoadsOutputIndex = 4; + private const int secondHydraulicLoadsOutputIndex = 10; [Test] public void Constructor_ExpectedValues() @@ -82,10 +79,10 @@ mocks.ReplayAll(); // Call - TestDelegate test = () => new GrassCoverErosionInwardsOutputProperties(null, new GrassCoverErosionInwardsFailureMechanism(), assessmentSection); + void Call() => new GrassCoverErosionInwardsOutputProperties(null, new GrassCoverErosionInwardsFailureMechanism(), assessmentSection); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("grassCoverErosionInwardsOutput", exception.ParamName); mocks.VerifyAll(); } @@ -99,10 +96,10 @@ mocks.ReplayAll(); // Call - TestDelegate test = () => new GrassCoverErosionInwardsOutputProperties(new TestGrassCoverErosionInwardsOutput(), null, assessmentSection); + void Call() => new GrassCoverErosionInwardsOutputProperties(new TestGrassCoverErosionInwardsOutput(), null, assessmentSection); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); mocks.VerifyAll(); } @@ -111,12 +108,10 @@ public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new GrassCoverErosionInwardsOutputProperties(new TestGrassCoverErosionInwardsOutput(), - new GrassCoverErosionInwardsFailureMechanism(), - null); + void Call() => new GrassCoverErosionInwardsOutputProperties(new TestGrassCoverErosionInwardsOutput(), new GrassCoverErosionInwardsFailureMechanism(), null); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("assessmentSection", exception.ParamName); } @@ -175,11 +170,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); @@ -248,7 +239,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(19, dynamicProperties.Count); + Assert.AreEqual(16, dynamicProperties.Count); AssertResultOutputProperties(dynamicProperties); AssertDikeHeightOutputProperties(dynamicProperties, firstHydraulicLoadsOutputIndex); @@ -296,7 +287,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(13, dynamicProperties.Count); + Assert.AreEqual(10, dynamicProperties.Count); AssertResultOutputProperties(dynamicProperties); @@ -336,7 +327,7 @@ var properties = new GrassCoverErosionInwardsOutputProperties(output, failureMechanism, assessmentSection); // Assert - int propertiesCount = double.IsNaN(waveHeight) ? 6 : 7; + int propertiesCount = double.IsNaN(waveHeight) ? 3 : 4; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(propertiesCount, dynamicProperties.Count); @@ -348,20 +339,7 @@ private static void AssertResultOutputProperties(PropertyDescriptorCollection dynamicProperties, bool waveHeightCalculated = true) { const string resultCategory = "\t\tSterkte berekening"; - PropertyDescriptor requiredProbabilityProperty = dynamicProperties[requiredProbabilityPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(requiredProbabilityProperty, - resultCategory, - "Faalkanseis [1/jaar]", - "De maximaal toegestane faalkanseis voor het toetsspoor.", - true); - PropertyDescriptor requiredReliabilityProperty = dynamicProperties[requiredReliabilityPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(requiredReliabilityProperty, - resultCategory, - "Betrouwbaarheidsindex faalkanseis [-]", - "De betrouwbaarheidsindex van de faalkanseis voor het toetsspoor.", - true); - PropertyDescriptor probabilityProperty = dynamicProperties[probabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(probabilityProperty, resultCategory, @@ -376,13 +354,6 @@ "De betrouwbaarheidsindex van de faalkans voor deze berekening.", true); - PropertyDescriptor factorOfSafetyProperty = dynamicProperties[factorOfSafetyPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(factorOfSafetyProperty, - resultCategory, - "Veiligheidsfactor [-]", - "De veiligheidsfactor voor deze berekening.", - true); - if (waveHeightCalculated) { PropertyDescriptor waveHeightProperty = dynamicProperties[waveHeightIndex];