Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PropertyClasses/HeightStructureProperties.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r9ee2919e72df0efa6252fc4323b76155a259d682 --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PropertyClasses/HeightStructureProperties.cs (.../HeightStructureProperties.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PropertyClasses/HeightStructureProperties.cs (.../HeightStructureProperties.cs) (revision 9ee2919e72df0efa6252fc4323b76155a259d682) @@ -40,15 +40,18 @@ private const int idPropertyIndex = 1; private const int namePropertyIndex = 2; private const int locationPropertyIndex = 3; + private const int structureNormalOrientationPropertyIndex = 4; - private const int flowWidthAtBottomProtectionPropertyIndex = 5; + private const int levelCrestStructurePropertyIndex = 5; private const int widthFlowAperturesPropertyIndex = 6; - private const int storageStructureAreaPropertyIndex = 7; - private const int allowedLevelIncreaseStoragePropertyIndex = 8; - private const int levelCrestStructurePropertyIndex = 9; - private const int criticalOvertoppingDischargePropertyIndex = 10; - private const int failureProbabilityStructureWithErosionPropertyIndex = 11; + private const int criticalOvertoppingDischargePropertyIndex = 7; + private const int flowWidthAtBottomProtectionPropertyIndex = 8; + private const int failureProbabilityStructureWithErosionPropertyIndex = 9; + + private const int storageStructureAreaPropertyIndex = 10; + private const int allowedLevelIncreaseStoragePropertyIndex = 11; + [PropertyOrder(idPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Id_DisplayName))] @@ -98,16 +101,16 @@ } } - [PropertyOrder(flowWidthAtBottomProtectionPropertyIndex)] + [PropertyOrder(levelCrestStructurePropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_FlowWidthAtBottomProtection_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_FlowWidthAtBottomProtection_Description))] - public LogNormalDistributionProperties FlowWidthAtBottomProtection + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_LevelCrestStructure_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_LevelCrestStructure_Description))] + public NormalDistributionProperties LevelCrestStructure { get { - return new LogNormalDistributionProperties(data.FlowWidthAtBottomProtection); + return new NormalDistributionProperties(data.LevelCrestStructure); } } @@ -124,67 +127,67 @@ } } - [PropertyOrder(storageStructureAreaPropertyIndex)] + [PropertyOrder(criticalOvertoppingDischargePropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_StorageStructureArea_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_StorageStructureArea_Description))] - public VariationCoefficientLogNormalDistributionProperties StorageStructureArea + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_CriticalOvertoppingDischarge_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_CriticalOvertoppingDischarge_Description))] + public VariationCoefficientLogNormalDistributionProperties CriticalOvertoppingDischarge { get { - return new VariationCoefficientLogNormalDistributionProperties(data.StorageStructureArea); + return new VariationCoefficientLogNormalDistributionProperties(data.CriticalOvertoppingDischarge); } } - [PropertyOrder(allowedLevelIncreaseStoragePropertyIndex)] + [PropertyOrder(flowWidthAtBottomProtectionPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_AllowedLevelIncreaseStorage_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_AllowedLevelIncreaseStorage_Description))] - public LogNormalDistributionProperties AllowedLevelIncreaseStorage + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_FlowWidthAtBottomProtection_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_FlowWidthAtBottomProtection_Description))] + public LogNormalDistributionProperties FlowWidthAtBottomProtection { get { - return new LogNormalDistributionProperties(data.AllowedLevelIncreaseStorage); + return new LogNormalDistributionProperties(data.FlowWidthAtBottomProtection); } } - [PropertyOrder(levelCrestStructurePropertyIndex)] + [PropertyOrder(storageStructureAreaPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_LevelCrestStructure_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_LevelCrestStructure_Description))] - public NormalDistributionProperties LevelCrestStructure + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_StorageStructureArea_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_StorageStructureArea_Description))] + public VariationCoefficientLogNormalDistributionProperties StorageStructureArea { get { - return new NormalDistributionProperties(data.LevelCrestStructure); + return new VariationCoefficientLogNormalDistributionProperties(data.StorageStructureArea); } } - [PropertyOrder(criticalOvertoppingDischargePropertyIndex)] - [TypeConverter(typeof(ExpandableObjectConverter))] + [PropertyOrder(failureProbabilityStructureWithErosionPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_CriticalOvertoppingDischarge_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_CriticalOvertoppingDischarge_Description))] - public VariationCoefficientLogNormalDistributionProperties CriticalOvertoppingDischarge + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_FailureProbabilityStructureWithErosion_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_FailureProbabilityStructureWithErosion_Description))] + public string FailureProbabilityStructureWithErosion { get { - return new VariationCoefficientLogNormalDistributionProperties(data.CriticalOvertoppingDischarge); + return ProbabilityFormattingHelper.Format(data.FailureProbabilityStructureWithErosion); } } - [PropertyOrder(failureProbabilityStructureWithErosionPropertyIndex)] + [PropertyOrder(allowedLevelIncreaseStoragePropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_FailureProbabilityStructureWithErosion_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_FailureProbabilityStructureWithErosion_Description))] - public string FailureProbabilityStructureWithErosion + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_AllowedLevelIncreaseStorage_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_AllowedLevelIncreaseStorage_Description))] + public LogNormalDistributionProperties AllowedLevelIncreaseStorage { get { - return ProbabilityFormattingHelper.Format(data.FailureProbabilityStructureWithErosion); + return new LogNormalDistributionProperties(data.AllowedLevelIncreaseStorage); } } } Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PropertyClasses/HeightStructurePropertiesTest.cs =================================================================== diff -u -r8cb53ca5d3528eb63d72dff288e162993c1adc04 -r9ee2919e72df0efa6252fc4323b76155a259d682 --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PropertyClasses/HeightStructurePropertiesTest.cs (.../HeightStructurePropertiesTest.cs) (revision 8cb53ca5d3528eb63d72dff288e162993c1adc04) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PropertyClasses/HeightStructurePropertiesTest.cs (.../HeightStructurePropertiesTest.cs) (revision 9ee2919e72df0efa6252fc4323b76155a259d682) @@ -37,13 +37,13 @@ private const int namePropertyIndex = 1; private const int locationPropertyIndex = 2; private const int structureNormalOrientationPropertyIndex = 3; - private const int flowWidthAtBottomProtectionPropertyIndex = 4; + private const int levelCrestStructurePropertyIndex = 4; private const int widthFlowAperturesPropertyIndex = 5; - private const int storageStructureAreaPropertyIndex = 6; - private const int allowedLevelIncreaseStoragePropertyIndex = 7; - private const int levelCrestStructurePropertyIndex = 8; - private const int criticalOvertoppingDischargePropertyIndex = 9; - private const int failureProbabilityStructureWithErosionPropertyIndex = 10; + private const int criticalOvertoppingDischargePropertyIndex = 6; + private const int flowWidthAtBottomProtectionPropertyIndex = 7; + private const int failureProbabilityStructureWithErosionPropertyIndex = 8; + private const int storageStructureAreaPropertyIndex = 9; + private const int allowedLevelIncreaseStoragePropertyIndex = 10; [Test] public void Constructor_ExpectedValues() @@ -125,70 +125,87 @@ const string generalCategory = "Algemeen"; PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; - Assert.IsTrue(idProperty.IsReadOnly); - Assert.AreEqual(generalCategory, idProperty.Category); - Assert.AreEqual("ID", idProperty.DisplayName); - Assert.AreEqual("ID van het kunstwerk.", idProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, + generalCategory, + "ID", + "ID van het kunstwerk.", + true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; - Assert.IsTrue(nameProperty.IsReadOnly); - Assert.AreEqual(generalCategory, nameProperty.Category); - Assert.AreEqual("Naam", nameProperty.DisplayName); - Assert.AreEqual("De naam van het kunstwerk.", nameProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + generalCategory, + "Naam", + "De naam van het kunstwerk.", + true); PropertyDescriptor locationProperty = dynamicProperties[locationPropertyIndex]; - Assert.IsTrue(locationProperty.IsReadOnly); - Assert.AreEqual(generalCategory, locationProperty.Category); - Assert.AreEqual("Locatie (RD) [m]", locationProperty.DisplayName); - Assert.AreEqual("De coördinaten van de locatie van het kunstwerk in het Rijksdriehoeksstelsel.", locationProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(locationProperty, + generalCategory, + "Locatie (RD) [m]", + "De coördinaten van de locatie van het kunstwerk in het Rijksdriehoeksstelsel.", + true); PropertyDescriptor structureNormalOrientationProperty = dynamicProperties[structureNormalOrientationPropertyIndex]; - Assert.IsTrue(structureNormalOrientationProperty.IsReadOnly); - Assert.AreEqual(schematizationCategory, structureNormalOrientationProperty.Category); - Assert.AreEqual("Oriëntatie [°]", structureNormalOrientationProperty.DisplayName); - Assert.AreEqual("Oriëntatie van de normaal van het kunstwerk ten opzichte van het noorden.", structureNormalOrientationProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(structureNormalOrientationProperty, + schematizationCategory, + "Oriëntatie [°]", + "Oriëntatie van de normaal van het kunstwerk ten opzichte van het noorden.", + true); - PropertyDescriptor flowWidthAtBottomProtectionProperty = dynamicProperties[flowWidthAtBottomProtectionPropertyIndex]; - Assert.IsInstanceOf(flowWidthAtBottomProtectionProperty.Converter); - Assert.AreEqual(schematizationCategory, flowWidthAtBottomProtectionProperty.Category); - Assert.AreEqual("Stroomvoerende breedte bodembescherming [m]", flowWidthAtBottomProtectionProperty.DisplayName); - Assert.AreEqual("Stroomvoerende breedte bodembescherming.", flowWidthAtBottomProtectionProperty.Description); + PropertyDescriptor levelCrestStructureProperty = dynamicProperties[levelCrestStructurePropertyIndex]; + Assert.IsInstanceOf(levelCrestStructureProperty.Converter); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(levelCrestStructureProperty, + schematizationCategory, + "Kerende hoogte [m+NAP]", + "Kerende hoogte van het kunstwerk.", + true); PropertyDescriptor widthFlowAperturesProperty = dynamicProperties[widthFlowAperturesPropertyIndex]; Assert.IsInstanceOf(widthFlowAperturesProperty.Converter); - Assert.AreEqual(schematizationCategory, widthFlowAperturesProperty.Category); - Assert.AreEqual("Breedte van doorstroomopening [m]", widthFlowAperturesProperty.DisplayName); - Assert.AreEqual("Breedte van de doorstroomopening.", widthFlowAperturesProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(widthFlowAperturesProperty, + schematizationCategory, + "Breedte van doorstroomopening [m]", + "Breedte van de doorstroomopening.", + true); + PropertyDescriptor criticalOvertoppingDischargeProperty = dynamicProperties[criticalOvertoppingDischargePropertyIndex]; + Assert.IsInstanceOf(criticalOvertoppingDischargeProperty.Converter); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(criticalOvertoppingDischargeProperty, + schematizationCategory, + "Kritiek instromend debiet [m³/s/m]", + "Kritiek instromend debiet directe invoer per strekkende meter.", + true); + + PropertyDescriptor flowWidthAtBottomProtectionProperty = dynamicProperties[flowWidthAtBottomProtectionPropertyIndex]; + Assert.IsInstanceOf(flowWidthAtBottomProtectionProperty.Converter); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(flowWidthAtBottomProtectionProperty, + schematizationCategory, + "Stroomvoerende breedte bodembescherming [m]", + "Stroomvoerende breedte bodembescherming.", + true); + + PropertyDescriptor failureProbabilityStructureWithErosionProperty = dynamicProperties[failureProbabilityStructureWithErosionPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(failureProbabilityStructureWithErosionProperty, + schematizationCategory, + "Faalkans gegeven erosie bodem [-]", + "Faalkans kunstwerk gegeven erosie bodem.", + true); + PropertyDescriptor storageStructureAreaProperty = dynamicProperties[storageStructureAreaPropertyIndex]; Assert.IsInstanceOf(storageStructureAreaProperty.Converter); - Assert.AreEqual(schematizationCategory, storageStructureAreaProperty.Category); - Assert.AreEqual("Kombergend oppervlak [m²]", storageStructureAreaProperty.DisplayName); - Assert.AreEqual("Kombergend oppervlak.", storageStructureAreaProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(storageStructureAreaProperty, + schematizationCategory, + "Kombergend oppervlak [m²]", + "Kombergend oppervlak.", + true); PropertyDescriptor allowedLevelIncreaseStorageProperty = dynamicProperties[allowedLevelIncreaseStoragePropertyIndex]; Assert.IsInstanceOf(allowedLevelIncreaseStorageProperty.Converter); - Assert.AreEqual(schematizationCategory, allowedLevelIncreaseStorageProperty.Category); - Assert.AreEqual("Toegestane peilverhoging komberging [m]", allowedLevelIncreaseStorageProperty.DisplayName); - Assert.AreEqual("Toegestane peilverhoging komberging.", allowedLevelIncreaseStorageProperty.Description); - - PropertyDescriptor levelCrestStructureProperty = dynamicProperties[levelCrestStructurePropertyIndex]; - Assert.IsInstanceOf(levelCrestStructureProperty.Converter); - Assert.AreEqual(schematizationCategory, levelCrestStructureProperty.Category); - Assert.AreEqual("Kerende hoogte [m+NAP]", levelCrestStructureProperty.DisplayName); - Assert.AreEqual("Kerende hoogte van het kunstwerk.", levelCrestStructureProperty.Description); - - PropertyDescriptor criticalOvertoppingDischargeProperty = dynamicProperties[criticalOvertoppingDischargePropertyIndex]; - Assert.IsInstanceOf(criticalOvertoppingDischargeProperty.Converter); - Assert.AreEqual(schematizationCategory, criticalOvertoppingDischargeProperty.Category); - Assert.AreEqual("Kritiek instromend debiet [m³/s/m]", criticalOvertoppingDischargeProperty.DisplayName); - Assert.AreEqual("Kritiek instromend debiet directe invoer per strekkende meter.", criticalOvertoppingDischargeProperty.Description); - - PropertyDescriptor failureProbabilityStructureWithErosionProperty = dynamicProperties[failureProbabilityStructureWithErosionPropertyIndex]; - Assert.IsTrue(failureProbabilityStructureWithErosionProperty.IsReadOnly); - Assert.AreEqual(schematizationCategory, failureProbabilityStructureWithErosionProperty.Category); - Assert.AreEqual("Faalkans gegeven erosie bodem [-]", failureProbabilityStructureWithErosionProperty.DisplayName); - Assert.AreEqual("Faalkans kunstwerk gegeven erosie bodem.", failureProbabilityStructureWithErosionProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(allowedLevelIncreaseStorageProperty, + schematizationCategory, + "Toegestane peilverhoging komberging [m]", + "Toegestane peilverhoging komberging.", + true); } } } \ No newline at end of file