Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructuresFailureMechanismProperties.cs =================================================================== diff -u -re27a2a4b649ecc232679d527acd5bb4c78e0219d -r2a6cca43069ddb1420e1a3123d013f3a9dc532be --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructuresFailureMechanismProperties.cs (.../HeightStructuresFailureMechanismProperties.cs) (revision e27a2a4b649ecc232679d527acd5bb4c78e0219d) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructuresFailureMechanismProperties.cs (.../HeightStructuresFailureMechanismProperties.cs) (revision 2a6cca43069ddb1420e1a3123d013f3a9dc532be) @@ -38,12 +38,13 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int contributionPropertyIndex = 3; - private const int isRelevantPropertyIndex = 4; - private const int gravitationalAccelerationPropertyIndex = 5; - private const int nPropertyIndex = 6; - private const int modelFactorOvertoppingFlowPropertyIndex = 7; - private const int modelFactorStorageVolumePropertyIndex = 8; + private const int groupPropertyIndex = 3; + private const int contributionPropertyIndex = 4; + private const int isRelevantPropertyIndex = 5; + private const int gravitationalAccelerationPropertyIndex = 6; + private const int nPropertyIndex = 7; + private const int modelFactorOvertoppingFlowPropertyIndex = 8; + private const int modelFactorStorageVolumePropertyIndex = 9; /// /// Creates a new instance of . @@ -124,6 +125,18 @@ } } + [PropertyOrder(groupPropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_Group_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_Group_Description))] + public int Group + { + get + { + return data.Group; + } + } + [DynamicVisible] [PropertyOrder(contributionPropertyIndex)] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailureMechanismPropertiesTest.cs =================================================================== diff -u -re27a2a4b649ecc232679d527acd5bb4c78e0219d -r2a6cca43069ddb1420e1a3123d013f3a9dc532be --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailureMechanismPropertiesTest.cs (.../HeightStructuresFailureMechanismPropertiesTest.cs) (revision e27a2a4b649ecc232679d527acd5bb4c78e0219d) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailureMechanismPropertiesTest.cs (.../HeightStructuresFailureMechanismPropertiesTest.cs) (revision 2a6cca43069ddb1420e1a3123d013f3a9dc532be) @@ -38,12 +38,13 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int contributionPropertyIndex = 2; - private const int isRelevantPropertyIndex = 3; - private const int gravitationalAccelerationPropertyIndex = 4; - private const int nPropertyIndex = 5; - private const int modelFactorOvertoppingFlowPropertyIndex = 6; - private const int modelFactorStorageVolumePropertyIndex = 7; + private const int groupPropertyIndex = 2; + private const int contributionPropertyIndex = 3; + private const int isRelevantPropertyIndex = 4; + private const int gravitationalAccelerationPropertyIndex = 5; + private const int nPropertyIndex = 6; + private const int modelFactorOvertoppingFlowPropertyIndex = 7; + private const int modelFactorStorageVolumePropertyIndex = 8; [Test] public void Constructor_DataNull_ThrowArgumentNullException() @@ -75,6 +76,7 @@ Assert.AreSame(failureMechanism, properties.Data); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); + Assert.AreEqual(failureMechanism.Group, properties.Group); Assert.AreEqual(failureMechanism.Contribution, properties.Contribution); Assert.AreEqual(isRelevant, properties.IsRelevant); @@ -104,7 +106,7 @@ const string modelSettingsCategory = "Modelinstellingen"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(8, dynamicProperties.Count); + Assert.AreEqual(9, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, @@ -120,6 +122,13 @@ "Het label van het toetsspoor.", true); + PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, + generalCategory, + "Groep", + "De groep waar het toetsspoor toe behoort.", + true); + PropertyDescriptor contributionProperty = dynamicProperties[contributionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(contributionProperty, generalCategory, @@ -178,7 +187,7 @@ const string generalCategory = "Algemeen"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(3, dynamicProperties.Count); + Assert.AreEqual(4, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, @@ -194,6 +203,13 @@ "Het label van het toetsspoor.", true); + PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, + generalCategory, + "Groep", + "De groep waar het toetsspoor toe behoort.", + true); + PropertyDescriptor isRelevantProperty = dynamicProperties[isRelevantPropertyIndex - 1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(isRelevantProperty, generalCategory, @@ -268,6 +284,7 @@ // Call & Assert Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Name))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Code))); + Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Group))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.IsRelevant))); Assert.AreEqual(isRelevant, properties.DynamicVisibleValidationMethod(nameof(properties.Contribution)));