Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneErosionFailureMechanismProperties.cs =================================================================== diff -u -r44e9772bc7d234fe16a3e00fc23c155f7ee81d20 -rc46d2a5e7ce09b3233794d8782a137090b865ca2 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneErosionFailureMechanismProperties.cs (.../DuneErosionFailureMechanismProperties.cs) (revision 44e9772bc7d234fe16a3e00fc23c155f7ee81d20) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneErosionFailureMechanismProperties.cs (.../DuneErosionFailureMechanismProperties.cs) (revision c46d2a5e7ce09b3233794d8782a137090b865ca2) @@ -39,9 +39,10 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int contributionPropertyIndex = 3; - private const int isRelevantPropertyIndex = 4; - private const int nPropertyIndex = 5; + private const int groupPropertyIndex = 3; + private const int contributionPropertyIndex = 4; + private const int isRelevantPropertyIndex = 5; + private const int nPropertyIndex = 6; private readonly IFailureMechanismPropertyChangeHandler propertyChangeHandler; /// @@ -141,6 +142,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/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneErosionFailureMechanismPropertiesTest.cs =================================================================== diff -u -r44e9772bc7d234fe16a3e00fc23c155f7ee81d20 -rc46d2a5e7ce09b3233794d8782a137090b865ca2 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneErosionFailureMechanismPropertiesTest.cs (.../DuneErosionFailureMechanismPropertiesTest.cs) (revision 44e9772bc7d234fe16a3e00fc23c155f7ee81d20) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneErosionFailureMechanismPropertiesTest.cs (.../DuneErosionFailureMechanismPropertiesTest.cs) (revision c46d2a5e7ce09b3233794d8782a137090b865ca2) @@ -40,9 +40,10 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int contributionPropertyIndex = 2; - private const int isRelevantPropertyIndex = 3; - private const int nPropertyIndex = 4; + private const int groupPropertyIndex = 2; + private const int contributionPropertyIndex = 3; + private const int isRelevantPropertyIndex = 4; + private const int nPropertyIndex = 5; [Test] [TestCase(true)] @@ -123,7 +124,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(5, dynamicProperties.Count); + Assert.AreEqual(6, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectParameterCategory = "Lengte-effect parameters"; @@ -142,6 +143,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, @@ -182,7 +190,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(3, dynamicProperties.Count); + Assert.AreEqual(4, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -200,6 +208,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, @@ -294,6 +309,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)));