Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailurePathProperties.cs =================================================================== diff -u -r07004132cc975de2f10731d0da2deb01ca862763 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailurePathProperties.cs (.../ClosingStructuresFailurePathProperties.cs) (revision 07004132cc975de2f10731d0da2deb01ca862763) +++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailurePathProperties.cs (.../ClosingStructuresFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -36,13 +36,12 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; + private const int inAssemblyPropertyIndex = 3; - private const int cPropertyIndex = 5; - private const int n2APropertyIndex = 6; - private const int nPropertyIndex = 7; - private const int applyLengthEffectInSectionPropertyIndex = 8; + private const int cPropertyIndex = 4; + private const int n2APropertyIndex = 5; + private const int nPropertyIndex = 6; + private const int applyLengthEffectInSectionPropertyIndex = 7; /// /// Creates a new instance of . @@ -55,34 +54,8 @@ CodePropertyIndex = codePropertyIndex }) {} - [DynamicVisibleValidationMethod] - public bool DynamicVisibleValidationMethod(string propertyName) - { - return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); - } - - private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) - { - return nameof(C).Equals(propertyName) - || nameof(N2A).Equals(propertyName) - || nameof(N).Equals(propertyName) - || nameof(ApplyLengthEffectInSection).Equals(propertyName); - } - #region General - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - [PropertyOrder(inAssemblyPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] @@ -97,6 +70,20 @@ #endregion + [DynamicVisibleValidationMethod] + public bool DynamicVisibleValidationMethod(string propertyName) + { + return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); + } + + private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) + { + return nameof(C).Equals(propertyName) + || nameof(N2A).Equals(propertyName) + || nameof(N).Equals(propertyName) + || nameof(ApplyLengthEffectInSection).Equals(propertyName); + } + #region Length effect parameters [DynamicVisible] Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailurePathPropertiesTest.cs =================================================================== diff -u -r07004132cc975de2f10731d0da2deb01ca862763 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailurePathPropertiesTest.cs (.../ClosingStructuresFailurePathPropertiesTest.cs) (revision 07004132cc975de2f10731d0da2deb01ca862763) +++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructuresFailurePathPropertiesTest.cs (.../ClosingStructuresFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -36,12 +36,11 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int inAssemblyPropertyIndex = 3; - private const int cPropertyIndex = 4; - private const int n2APropertyIndex = 5; - private const int nPropertyIndex = 6; - private const int applyLengthEffectInSectionPropertyIndex = 7; + private const int inAssemblyPropertyIndex = 2; + private const int cPropertyIndex = 3; + private const int n2APropertyIndex = 4; + private const int nPropertyIndex = 5; + private const int applyLengthEffectInSectionPropertyIndex = 6; [Test] public void Constructor_ExpectedValues() @@ -61,7 +60,6 @@ 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.InAssembly, properties.InAssembly); GeneralClosingStructuresInput generalInput = failureMechanism.GeneralInput; @@ -84,7 +82,7 @@ const string lengthEffectCategory = "Lengte-effect"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(8, dynamicProperties.Count); + Assert.AreEqual(7, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, @@ -100,13 +98,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -156,7 +147,7 @@ const string generalCategory = "Algemeen"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, @@ -172,13 +163,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -255,7 +239,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.C))); Index: Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rfbbfd3cafa217c67f9d9b9b7756570c3d59a8993 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fbbfd3cafa217c67f9d9b9b7756570c3d59a8993) +++ Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -1980,15 +1980,6 @@ } /// - /// Looks up a localized string similar to De groep waar het toetsspoor toe behoort.. - /// - public static string FailurePath_Group_Description { - get { - return ResourceManager.GetString("FailurePath_Group_Description", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Groep. /// public static string FailurePath_Group_DisplayName { Index: Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.resx =================================================================== diff -u -rfbbfd3cafa217c67f9d9b9b7756570c3d59a8993 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision fbbfd3cafa217c67f9d9b9b7756570c3d59a8993) +++ Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -465,9 +465,6 @@ Label - - De groep waar het toetsspoor toe behoort. - Groep Index: Riskeer/DuneErosion/src/Riskeer.DuneErosion.Forms/PropertyClasses/DuneErosionFailurePathProperties.cs =================================================================== diff -u -r1334722a762b11470b23b046603be36736febf73 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/DuneErosion/src/Riskeer.DuneErosion.Forms/PropertyClasses/DuneErosionFailurePathProperties.cs (.../DuneErosionFailurePathProperties.cs) (revision 1334722a762b11470b23b046603be36736febf73) +++ Riskeer/DuneErosion/src/Riskeer.DuneErosion.Forms/PropertyClasses/DuneErosionFailurePathProperties.cs (.../DuneErosionFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -35,11 +35,10 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int contributionPropertyIndex = 4; - private const int inAssemblyPropertyIndex = 5; - private const int nPropertyIndex = 6; - private const int applyLengthEffectInSectionPropertyIndex = 7; + private const int contributionPropertyIndex = 3; + private const int inAssemblyPropertyIndex = 4; + private const int nPropertyIndex = 5; + private const int applyLengthEffectInSectionPropertyIndex = 6; /// /// Creates a new instance of . @@ -103,18 +102,6 @@ #region General - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - [PropertyOrder(inAssemblyPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] Index: Riskeer/DuneErosion/test/Riskeer.DuneErosion.Forms.Test/PropertyClasses/DuneErosionFailurePathPropertiesTest.cs =================================================================== diff -u -re89bf9e2c30f874399f4a36d5ac5774cc5bd23c0 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/DuneErosion/test/Riskeer.DuneErosion.Forms.Test/PropertyClasses/DuneErosionFailurePathPropertiesTest.cs (.../DuneErosionFailurePathPropertiesTest.cs) (revision e89bf9e2c30f874399f4a36d5ac5774cc5bd23c0) +++ Riskeer/DuneErosion/test/Riskeer.DuneErosion.Forms.Test/PropertyClasses/DuneErosionFailurePathPropertiesTest.cs (.../DuneErosionFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -38,11 +38,10 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int contributionPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int nPropertyIndex = 5; - private const int applyLengthEffectInSectionPropertyIndex = 6; + private const int contributionPropertyIndex = 2; + private const int inAssemblyPropertyIndex = 3; + private const int nPropertyIndex = 4; + private const int applyLengthEffectInSectionPropertyIndex = 5; [Test] public void Constructor_ExpectedValues() @@ -62,7 +61,6 @@ 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(failureMechanism.InAssembly, properties.InAssembly); @@ -82,7 +80,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(7, dynamicProperties.Count); + Assert.AreEqual(6, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -101,13 +99,6 @@ "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, @@ -150,7 +141,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -168,13 +159,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex - 1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -251,7 +235,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.Contribution))); Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailurePathProperties.cs =================================================================== diff -u -rafeaf478e3ad4d4342bf96f999e228f53909cad5 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailurePathProperties.cs (.../GrassCoverErosionInwardsFailurePathProperties.cs) (revision afeaf478e3ad4d4342bf96f999e228f53909cad5) +++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailurePathProperties.cs (.../GrassCoverErosionInwardsFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -38,10 +38,10 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int nPropertyIndex = 5; - private const int applyLengthEffectInSectionPropertyIndex = 6; + private const int inAssemblyPropertyIndex = 3; + private const int nPropertyIndex = 4; + private const int applyLengthEffectInSectionPropertyIndex = 5; + private readonly IFailureMechanismPropertyChangeHandler propertyChangeHandler; /// @@ -67,6 +67,22 @@ propertyChangeHandler = handler; } + #region General + + [PropertyOrder(inAssemblyPropertyIndex)] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_Description))] + public bool InAssembly + { + get + { + return data.InAssembly; + } + } + + #endregion + [DynamicVisibleValidationMethod] public bool DynamicVisibleValidationMethod(string propertyName) { @@ -130,33 +146,5 @@ } #endregion - - #region General - - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - - [PropertyOrder(inAssemblyPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_Description))] - public bool InAssembly - { - get - { - return data.InAssembly; - } - } - - #endregion } } \ No newline at end of file Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailurePathPropertiesTest.cs =================================================================== diff -u -rafeaf478e3ad4d4342bf96f999e228f53909cad5 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailurePathPropertiesTest.cs (.../GrassCoverErosionInwardsFailurePathPropertiesTest.cs) (revision afeaf478e3ad4d4342bf96f999e228f53909cad5) +++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailurePathPropertiesTest.cs (.../GrassCoverErosionInwardsFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -40,10 +40,9 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int inAssemblyPropertyIndex = 3; - private const int nPropertyIndex = 4; - private const int applyLengthEffectInSectionPropertyIndex = 5; + private const int inAssemblyPropertyIndex = 2; + private const int nPropertyIndex = 3; + private const int applyLengthEffectInSectionPropertyIndex = 4; [Test] public void Constructor_ChangeHandlerNull_ThrowsArgumentNullException() @@ -81,7 +80,6 @@ Assert.IsInstanceOf(properties); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); - Assert.AreEqual(failureMechanism.Group, properties.Group); Assert.AreEqual(failureMechanism.InAssembly, properties.InAssembly); GeneralGrassCoverErosionInwardsInput generalInput = failureMechanism.GeneralInput; @@ -112,7 +110,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(6, dynamicProperties.Count); + Assert.AreEqual(5, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -131,13 +129,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -178,7 +169,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -196,13 +187,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -327,7 +311,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.N))); Index: Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsFailurePathProperties.cs =================================================================== diff -u -r26f427a7724ebe6e50c0d83fd87156df30f17e9c -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsFailurePathProperties.cs (.../GrassCoverErosionOutwardsFailurePathProperties.cs) (revision 26f427a7724ebe6e50c0d83fd87156df30f17e9c) +++ Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsFailurePathProperties.cs (.../GrassCoverErosionOutwardsFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -35,11 +35,10 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int contributionPropertyIndex = 4; - private const int inAssemblyPropertyIndex = 5; - private const int nPropertyIndex = 6; - private const int applyLengthEffectInSectionPropertyIndex = 7; + private const int contributionPropertyIndex = 3; + private const int inAssemblyPropertyIndex = 4; + private const int nPropertyIndex = 5; + private const int applyLengthEffectInSectionPropertyIndex = 6; /// /// Creates a new instance of . @@ -113,18 +112,6 @@ #region General - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - [DynamicVisible] [PropertyOrder(contributionPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsFailurePathPropertiesTest.cs =================================================================== diff -u -r7f75801aa93da365268f2ac28952d141931a83df -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsFailurePathPropertiesTest.cs (.../GrassCoverErosionOutwardsFailurePathPropertiesTest.cs) (revision 7f75801aa93da365268f2ac28952d141931a83df) +++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsFailurePathPropertiesTest.cs (.../GrassCoverErosionOutwardsFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -38,11 +38,10 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int contributionPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int nPropertyIndex = 5; - private const int applyLengthEffectInSectionPropertyIndex = 6; + private const int contributionPropertyIndex = 2; + private const int inAssemblyPropertyIndex = 3; + private const int nPropertyIndex = 4; + private const int applyLengthEffectInSectionPropertyIndex = 5; [Test] public void Constructor_ExpectedValues() @@ -65,7 +64,6 @@ Assert.IsInstanceOf(properties); 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(failureMechanism.InAssembly, properties.InAssembly); @@ -88,7 +86,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(7, dynamicProperties.Count); + Assert.AreEqual(6, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -107,13 +105,6 @@ "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, @@ -155,7 +146,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -173,13 +164,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex - 1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -279,7 +263,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.Contribution))); Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PropertyClasses/HeightStructuresFailurePathProperties.cs =================================================================== diff -u -r07004132cc975de2f10731d0da2deb01ca862763 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PropertyClasses/HeightStructuresFailurePathProperties.cs (.../HeightStructuresFailurePathProperties.cs) (revision 07004132cc975de2f10731d0da2deb01ca862763) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PropertyClasses/HeightStructuresFailurePathProperties.cs (.../HeightStructuresFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -35,10 +35,9 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int nPropertyIndex = 5; - private const int applyLengthEffectInSectionPropertyIndex = 6; + private const int inAssemblyPropertyIndex = 3; + private const int nPropertyIndex = 4; + private const int applyLengthEffectInSectionPropertyIndex = 5; /// /// Creates a new instance of . @@ -51,6 +50,22 @@ CodePropertyIndex = codePropertyIndex }) {} + #region General + + [PropertyOrder(inAssemblyPropertyIndex)] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_Description))] + public bool InAssembly + { + get + { + return data.InAssembly; + } + } + + #endregion + [DynamicVisibleValidationMethod] public bool DynamicVisibleValidationMethod(string propertyName) { @@ -97,33 +112,5 @@ } #endregion - - #region General - - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - - [PropertyOrder(inAssemblyPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_Description))] - public bool InAssembly - { - get - { - return data.InAssembly; - } - } - - #endregion } } \ No newline at end of file Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailurePathPropertiesTest.cs =================================================================== diff -u -r07004132cc975de2f10731d0da2deb01ca862763 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailurePathPropertiesTest.cs (.../HeightStructuresFailurePathPropertiesTest.cs) (revision 07004132cc975de2f10731d0da2deb01ca862763) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailurePathPropertiesTest.cs (.../HeightStructuresFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -37,10 +37,9 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int inAssemblyPropertyIndex = 3; - private const int nPropertyIndex = 4; - private const int applyLengthEffectInSectionPropertyIndex = 5; + private const int inAssemblyPropertyIndex = 2; + private const int nPropertyIndex = 3; + private const int applyLengthEffectInSectionPropertyIndex = 4; [Test] public void Constructor_ExpectedValues() @@ -59,7 +58,6 @@ Assert.IsInstanceOf(properties); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); - Assert.AreEqual(failureMechanism.Group, properties.Group); Assert.AreEqual(failureMechanism.InAssembly, properties.InAssembly); GeneralHeightStructuresInput generalInput = failureMechanism.GeneralInput; @@ -81,7 +79,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(6, dynamicProperties.Count); + Assert.AreEqual(5, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -100,13 +98,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -142,7 +133,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -160,13 +151,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -243,7 +227,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.N))); Index: Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/StandAlone/PipingStructureFailurePathProperties.cs =================================================================== diff -u -rc1abb917d71d2f88c24ecdaa5a74d7ccbdd392f4 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/StandAlone/PipingStructureFailurePathProperties.cs (.../PipingStructureFailurePathProperties.cs) (revision c1abb917d71d2f88c24ecdaa5a74d7ccbdd392f4) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/StandAlone/PipingStructureFailurePathProperties.cs (.../PipingStructureFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -36,11 +36,10 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int contributionPropertyIndex = 4; - private const int inAssemblyPropertyIndex = 5; - private const int nPropertyIndex = 6; - private const int applyLengthEffectInSectionPropertyIndex = 7; + private const int contributionPropertyIndex = 3; + private const int inAssemblyPropertyIndex = 4; + private const int nPropertyIndex = 5; + private const int applyLengthEffectInSectionPropertyIndex = 6; /// /// Creates a new instance of . @@ -131,18 +130,6 @@ } } - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - [DynamicVisible] [PropertyOrder(contributionPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] Index: Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/StandAlone/StandAloneFailurePathProperties.cs =================================================================== diff -u -r92b6e61c5482fa1885b0933bd6ce5fbfaf1f94b8 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/StandAlone/StandAloneFailurePathProperties.cs (.../StandAloneFailurePathProperties.cs) (revision 92b6e61c5482fa1885b0933bd6ce5fbfaf1f94b8) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/StandAlone/StandAloneFailurePathProperties.cs (.../StandAloneFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -36,10 +36,9 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int nPropertyIndex = 5; - private const int applyLengthEffectInSectionPropertyIndex = 6; + private const int inAssemblyPropertyIndex = 3; + private const int nPropertyIndex = 4; + private const int applyLengthEffectInSectionPropertyIndex = 5; /// /// Creates a new instance of . @@ -134,18 +133,6 @@ } } - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - [PropertyOrder(inAssemblyPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/StandAlone/PipingStructureFailurePathPropertiesTest.cs =================================================================== diff -u -re89bf9e2c30f874399f4a36d5ac5774cc5bd23c0 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/StandAlone/PipingStructureFailurePathPropertiesTest.cs (.../PipingStructureFailurePathPropertiesTest.cs) (revision e89bf9e2c30f874399f4a36d5ac5774cc5bd23c0) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/StandAlone/PipingStructureFailurePathPropertiesTest.cs (.../PipingStructureFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -39,11 +39,10 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int contributionPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int nPropertyIndex = 5; - private const int applyLengthEffectInSectionPropertyIndex = 6; + private const int contributionPropertyIndex = 2; + private const int inAssemblyPropertyIndex = 3; + private const int nPropertyIndex = 4; + private const int applyLengthEffectInSectionPropertyIndex = 5; [Test] public void Constructor_DataIsNull_ThrowArgumentNullException() @@ -73,7 +72,6 @@ Assert.IsInstanceOf>(properties); 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(failureMechanism.InAssembly, properties.InAssembly); @@ -99,7 +97,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(7, dynamicProperties.Count); + Assert.AreEqual(6, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -118,13 +116,6 @@ "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, @@ -167,7 +158,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -185,13 +176,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex - 1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -265,7 +249,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.Contribution))); Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/StandAlone/StandAloneFailurePathPropertiesTest.cs =================================================================== diff -u -re6278529a34ee44680957ccb9ecc5e18aff6c0b3 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/StandAlone/StandAloneFailurePathPropertiesTest.cs (.../StandAloneFailurePathPropertiesTest.cs) (revision e6278529a34ee44680957ccb9ecc5e18aff6c0b3) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/StandAlone/StandAloneFailurePathPropertiesTest.cs (.../StandAloneFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -40,10 +40,9 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int inAssemblyPropertyIndex = 3; - private const int nPropertyIndex = 4; - private const int applyLengthEffectInSectionPropertyIndex = 5; + private const int inAssemblyPropertyIndex = 2; + private const int nPropertyIndex = 3; + private const int applyLengthEffectInSectionPropertyIndex = 4; [Test] public void Constructor_FailureMechanismNull_ThrowsArgumentNullException() @@ -92,7 +91,6 @@ 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.InAssembly, properties.InAssembly); Assert.AreEqual(failureMechanism.GeneralInput.N, properties.N); Assert.AreEqual(failureMechanism.GeneralInput.ApplyLengthEffectInSection, properties.ApplyLengthEffectInSection); @@ -117,7 +115,7 @@ const string lengthEffectCategory = "Lengte-effect"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(6, dynamicProperties.Count); + Assert.AreEqual(5, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, @@ -133,13 +131,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -174,7 +165,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -192,13 +183,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -292,7 +276,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.N))); Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsFailurePathProperties.cs =================================================================== diff -u -r4c91c05c89c8488a0f4025b55c691d5fadfb37fc -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsFailurePathProperties.cs (.../MacroStabilityInwardsFailurePathProperties.cs) (revision 4c91c05c89c8488a0f4025b55c691d5fadfb37fc) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsFailurePathProperties.cs (.../MacroStabilityInwardsFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -37,13 +37,12 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int aPropertyIndex = 5; - private const int bPropertyIndex = 6; - private const int sectionLengthPropertyIndex = 7; - private const int nPropertyIndex = 8; - private const int applyLengthEffectInSectionPropertyIndex = 9; + private const int inAssemblyPropertyIndex = 3; + private const int aPropertyIndex = 4; + private const int bPropertyIndex = 5; + private const int sectionLengthPropertyIndex = 6; + private const int nPropertyIndex = 7; + private const int applyLengthEffectInSectionPropertyIndex = 8; private readonly IAssessmentSection assessmentSection; @@ -69,35 +68,8 @@ this.assessmentSection = assessmentSection; } - [DynamicVisibleValidationMethod] - public bool DynamicVisibleValidationMethod(string propertyName) - { - return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); - } - - private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) - { - return nameof(A).Equals(propertyName) - || nameof(B).Equals(propertyName) - || nameof(SectionLength).Equals(propertyName) - || nameof(N).Equals(propertyName) - || nameof(ApplyLengthEffectInSection).Equals(propertyName); - } - #region General - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - [PropertyOrder(inAssemblyPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] @@ -112,6 +84,21 @@ #endregion + [DynamicVisibleValidationMethod] + public bool DynamicVisibleValidationMethod(string propertyName) + { + return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); + } + + private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) + { + return nameof(A).Equals(propertyName) + || nameof(B).Equals(propertyName) + || nameof(SectionLength).Equals(propertyName) + || nameof(N).Equals(propertyName) + || nameof(ApplyLengthEffectInSection).Equals(propertyName); + } + #region Length effect parameters [DynamicVisible] Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsFailurePathPropertiesTest.cs =================================================================== diff -u -r4c91c05c89c8488a0f4025b55c691d5fadfb37fc -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsFailurePathPropertiesTest.cs (.../MacroStabilityInwardsFailurePathPropertiesTest.cs) (revision 4c91c05c89c8488a0f4025b55c691d5fadfb37fc) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsFailurePathPropertiesTest.cs (.../MacroStabilityInwardsFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -38,13 +38,12 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int inAssemblyPropertyIndex = 3; - private const int aPropertyIndex = 4; - private const int bPropertyIndex = 5; - private const int sectionLengthPropertyIndex = 6; - private const int nPropertyIndex = 7; - private const int applyLengthEffectInSectionPropertyIndex = 8; + private const int inAssemblyPropertyIndex = 2; + private const int aPropertyIndex = 3; + private const int bPropertyIndex = 4; + private const int sectionLengthPropertyIndex = 5; + private const int nPropertyIndex = 6; + private const int applyLengthEffectInSectionPropertyIndex = 7; [Test] public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() @@ -79,7 +78,6 @@ Assert.IsInstanceOf(properties); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); - Assert.AreEqual(failureMechanism.Group, properties.Group); Assert.AreEqual(failureMechanism.InAssembly, properties.InAssembly); MacroStabilityInwardsProbabilityAssessmentInput probabilityAssessmentInput = failureMechanism.MacroStabilityInwardsProbabilityAssessmentInput; @@ -116,7 +114,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(9, dynamicProperties.Count); + Assert.AreEqual(8, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -135,13 +133,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -204,7 +195,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -222,13 +213,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -317,7 +301,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.A))); Index: Riskeer/Piping/src/Riskeer.Piping.Forms/PropertyClasses/PipingFailurePathProperties.cs =================================================================== diff -u -r9f624c0314f3be915413fbda9443bc95113f15c0 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/Piping/src/Riskeer.Piping.Forms/PropertyClasses/PipingFailurePathProperties.cs (.../PipingFailurePathProperties.cs) (revision 9f624c0314f3be915413fbda9443bc95113f15c0) +++ Riskeer/Piping/src/Riskeer.Piping.Forms/PropertyClasses/PipingFailurePathProperties.cs (.../PipingFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -37,13 +37,12 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int aPropertyIndex = 5; - private const int bPropertyIndex = 6; - private const int sectionLengthPropertyIndex = 7; - private const int nPropertyIndex = 8; - private const int applyLengthEffectInSectionPropertyIndex = 9; + private const int inAssemblyPropertyIndex = 3; + private const int aPropertyIndex = 4; + private const int bPropertyIndex = 5; + private const int sectionLengthPropertyIndex = 6; + private const int nPropertyIndex = 7; + private const int applyLengthEffectInSectionPropertyIndex = 8; private readonly IAssessmentSection assessmentSection; @@ -69,35 +68,8 @@ this.assessmentSection = assessmentSection; } - [DynamicVisibleValidationMethod] - public bool DynamicVisibleValidationMethod(string propertyName) - { - return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); - } - - private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) - { - return nameof(A).Equals(propertyName) - || nameof(B).Equals(propertyName) - || nameof(SectionLength).Equals(propertyName) - || nameof(ApplyLengthEffectInSection).Equals(propertyName) - || nameof(N).Equals(propertyName); - } - #region General - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - [PropertyOrder(inAssemblyPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] @@ -112,6 +84,21 @@ #endregion + [DynamicVisibleValidationMethod] + public bool DynamicVisibleValidationMethod(string propertyName) + { + return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); + } + + private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) + { + return nameof(A).Equals(propertyName) + || nameof(B).Equals(propertyName) + || nameof(SectionLength).Equals(propertyName) + || nameof(ApplyLengthEffectInSection).Equals(propertyName) + || nameof(N).Equals(propertyName); + } + #region Length effect parameters [DynamicVisible] Index: Riskeer/Piping/test/Riskeer.Piping.Forms.Test/PropertyClasses/PipingFailurePathPropertiesTest.cs =================================================================== diff -u -r9f624c0314f3be915413fbda9443bc95113f15c0 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/Piping/test/Riskeer.Piping.Forms.Test/PropertyClasses/PipingFailurePathPropertiesTest.cs (.../PipingFailurePathPropertiesTest.cs) (revision 9f624c0314f3be915413fbda9443bc95113f15c0) +++ Riskeer/Piping/test/Riskeer.Piping.Forms.Test/PropertyClasses/PipingFailurePathPropertiesTest.cs (.../PipingFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -39,13 +39,12 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int inAssemblyPropertyIndex = 3; - private const int aPropertyIndex = 4; - private const int bPropertyIndex = 5; - private const int sectionLengthPropertyIndex = 6; - private const int nPropertyIndex = 7; - private const int applyLengthEffectInSectionPropertyIndex = 8; + private const int inAssemblyPropertyIndex = 2; + private const int aPropertyIndex = 3; + private const int bPropertyIndex = 4; + private const int sectionLengthPropertyIndex = 5; + private const int nPropertyIndex = 6; + private const int applyLengthEffectInSectionPropertyIndex = 7; [Test] public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() @@ -80,7 +79,6 @@ Assert.IsInstanceOf(properties); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); - Assert.AreEqual(failureMechanism.Group, properties.Group); Assert.AreEqual(failureMechanism.InAssembly, properties.InAssembly); PipingProbabilityAssessmentInput probabilityAssessmentInput = failureMechanism.PipingProbabilityAssessmentInput; @@ -114,7 +112,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(9, dynamicProperties.Count); + Assert.AreEqual(8, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -133,13 +131,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -202,7 +193,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -220,13 +211,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -315,7 +299,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.A))); Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailurePathProperties.cs =================================================================== diff -u -r07004132cc975de2f10731d0da2deb01ca862763 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailurePathProperties.cs (.../StabilityPointStructuresFailurePathProperties.cs) (revision 07004132cc975de2f10731d0da2deb01ca862763) +++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailurePathProperties.cs (.../StabilityPointStructuresFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -35,10 +35,9 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int nPropertyIndex = 5; - private const int applyLengthEffectInSectionPropertyIndex = 6; + private const int inAssemblyPropertyIndex = 3; + private const int nPropertyIndex = 4; + private const int applyLengthEffectInSectionPropertyIndex = 5; /// /// Creates a new instance of . @@ -51,6 +50,22 @@ CodePropertyIndex = codePropertyIndex }) {} + #region General + + [PropertyOrder(inAssemblyPropertyIndex)] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_Description))] + public bool InAssembly + { + get + { + return data.InAssembly; + } + } + + #endregion + [DynamicVisibleValidationMethod] public bool DynamicVisibleValidationMethod(string propertyName) { @@ -97,33 +112,5 @@ } #endregion - - #region General - - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - - [PropertyOrder(inAssemblyPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_Description))] - public bool InAssembly - { - get - { - return data.InAssembly; - } - } - - #endregion } } \ No newline at end of file Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailurePathPropertiesTest.cs =================================================================== diff -u -r07004132cc975de2f10731d0da2deb01ca862763 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailurePathPropertiesTest.cs (.../StabilityPointStructuresFailurePathPropertiesTest.cs) (revision 07004132cc975de2f10731d0da2deb01ca862763) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailurePathPropertiesTest.cs (.../StabilityPointStructuresFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -37,10 +37,9 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int inAssemblyPropertyIndex = 3; - private const int nPropertyIndex = 4; - private const int applyLengthEffectInSectionPropertyIndex = 5; + private const int inAssemblyPropertyIndex = 2; + private const int nPropertyIndex = 3; + private const int applyLengthEffectInSectionPropertyIndex = 4; [Test] public void Constructor_ExpectedValues() @@ -59,7 +58,6 @@ Assert.IsInstanceOf(properties); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); - Assert.AreEqual(failureMechanism.Group, properties.Group); Assert.AreEqual(failureMechanism.InAssembly, properties.InAssembly); GeneralStabilityPointStructuresInput generalInput = failureMechanism.GeneralInput; @@ -81,7 +79,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(6, dynamicProperties.Count); + Assert.AreEqual(5, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -100,13 +98,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -142,7 +133,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -160,13 +151,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -243,7 +227,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.N))); Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailurePathProperties.cs =================================================================== diff -u -r6fbe4da4405d8ea38cee5f82bc698ea84367f947 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailurePathProperties.cs (.../StabilityStoneCoverFailurePathProperties.cs) (revision 6fbe4da4405d8ea38cee5f82bc698ea84367f947) +++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailurePathProperties.cs (.../StabilityStoneCoverFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -35,10 +35,9 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int nPropertyIndex = 5; - private const int applyLengthEffectInSectionPropertyIndex = 6; + private const int inAssemblyPropertyIndex = 3; + private const int nPropertyIndex = 4; + private const int applyLengthEffectInSectionPropertyIndex = 5; /// /// Creates a new instance of . @@ -51,6 +50,22 @@ CodePropertyIndex = codePropertyIndex }) {} + #region General + + [PropertyOrder(inAssemblyPropertyIndex)] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_Description))] + public bool InAssembly + { + get + { + return data.InAssembly; + } + } + + #endregion + [DynamicVisibleValidationMethod] public bool DynamicVisibleValidationMethod(string propertyName) { @@ -102,33 +117,5 @@ } #endregion - - #region General - - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - - [PropertyOrder(inAssemblyPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_Description))] - public bool InAssembly - { - get - { - return data.InAssembly; - } - } - - #endregion } } \ No newline at end of file Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailurePathPropertiesTest.cs =================================================================== diff -u -r26960f5a3baf82f99e8eadfe0019cf678a311328 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailurePathPropertiesTest.cs (.../StabilityStoneCoverFailurePathPropertiesTest.cs) (revision 26960f5a3baf82f99e8eadfe0019cf678a311328) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailurePathPropertiesTest.cs (.../StabilityStoneCoverFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -37,10 +37,9 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int inAssemblyPropertyIndex = 3; - private const int nPropertyIndex = 4; - private const int applyLengthEffectInSectionPropertyIndex = 5; + private const int inAssemblyPropertyIndex = 2; + private const int nPropertyIndex = 3; + private const int applyLengthEffectInSectionPropertyIndex = 4; [Test] public void Constructor_ExpectedValues() @@ -59,7 +58,6 @@ Assert.IsInstanceOf(properties); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); - Assert.AreEqual(failureMechanism.Group, properties.Group); Assert.AreEqual(failureMechanism.InAssembly, properties.InAssembly); GeneralStabilityStoneCoverWaveConditionsInput generalInput = failureMechanism.GeneralInput; @@ -81,7 +79,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(6, dynamicProperties.Count); + Assert.AreEqual(5, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -100,13 +98,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -141,7 +132,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -159,13 +150,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -265,7 +249,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.N))); Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PropertyClasses/WaveImpactAsphaltCoverFailurePathProperties.cs =================================================================== diff -u -r8ab9452c5272fd38e5d46f11c0386becd1312ed2 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PropertyClasses/WaveImpactAsphaltCoverFailurePathProperties.cs (.../WaveImpactAsphaltCoverFailurePathProperties.cs) (revision 8ab9452c5272fd38e5d46f11c0386becd1312ed2) +++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PropertyClasses/WaveImpactAsphaltCoverFailurePathProperties.cs (.../WaveImpactAsphaltCoverFailurePathProperties.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -38,12 +38,12 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int inAssemblyPropertyIndex = 4; - private const int sectionLengthPropertyIndex = 5; - private const int deltaLPropertyIndex = 7; - private const int nPropertyIndex = 7; - private const int applyLengthEffectInSectionPropertyIndex = 8; + private const int inAssemblyPropertyIndex = 3; + private const int sectionLengthPropertyIndex = 4; + private const int deltaLPropertyIndex = 5; + private const int nPropertyIndex = 6; + private const int applyLengthEffectInSectionPropertyIndex = 7; + private readonly IAssessmentSection assessmentSection; /// @@ -67,34 +67,8 @@ this.assessmentSection = assessmentSection; } - [DynamicVisibleValidationMethod] - public bool DynamicVisibleValidationMethod(string propertyName) - { - return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); - } - - private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) - { - return nameof(DeltaL).Equals(propertyName) - || nameof(SectionLength).Equals(propertyName) - || nameof(N).Equals(propertyName) - || nameof(ApplyLengthEffectInSection).Equals(propertyName); - } - #region General - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - [PropertyOrder(inAssemblyPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] @@ -109,6 +83,20 @@ #endregion + [DynamicVisibleValidationMethod] + public bool DynamicVisibleValidationMethod(string propertyName) + { + return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); + } + + private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) + { + return nameof(DeltaL).Equals(propertyName) + || nameof(SectionLength).Equals(propertyName) + || nameof(N).Equals(propertyName) + || nameof(ApplyLengthEffectInSection).Equals(propertyName); + } + #region Length effect parameters [DynamicVisible] Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PropertyClasses/WaveImpactAsphaltCoverFailurePathPropertiesTest.cs =================================================================== diff -u -r8ab9452c5272fd38e5d46f11c0386becd1312ed2 -r299be933b87eea233f728ae92b0ec1bcb38087c4 --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PropertyClasses/WaveImpactAsphaltCoverFailurePathPropertiesTest.cs (.../WaveImpactAsphaltCoverFailurePathPropertiesTest.cs) (revision 8ab9452c5272fd38e5d46f11c0386becd1312ed2) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PropertyClasses/WaveImpactAsphaltCoverFailurePathPropertiesTest.cs (.../WaveImpactAsphaltCoverFailurePathPropertiesTest.cs) (revision 299be933b87eea233f728ae92b0ec1bcb38087c4) @@ -39,12 +39,11 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int inAssemblyPropertyIndex = 3; - private const int sectionLengthPropertyIndex = 4; - private const int deltaLPropertyIndex = 5; - private const int nPropertyIndex = 6; - private const int applyLengthEffectInSectionPropertyIndex = 7; + private const int inAssemblyPropertyIndex = 2; + private const int sectionLengthPropertyIndex = 3; + private const int deltaLPropertyIndex = 4; + private const int nPropertyIndex = 5; + private const int applyLengthEffectInSectionPropertyIndex = 6; [Test] public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() @@ -84,7 +83,6 @@ 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.InAssembly, properties.InAssembly); Assert.AreEqual(2, properties.SectionLength.NumberOfDecimalPlaces); @@ -120,7 +118,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(8, dynamicProperties.Count); + Assert.AreEqual(7, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -139,13 +137,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -201,7 +192,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); + Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -219,13 +210,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, @@ -339,7 +323,6 @@ // 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.InAssembly))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.DeltaL)));