Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructureProperties.cs =================================================================== diff -u -rf88343c0590cb04c7135ce141872940e59325927 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructureProperties.cs (.../ClosingStructureProperties.cs) (revision f88343c0590cb04c7135ce141872940e59325927) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructureProperties.cs (.../ClosingStructureProperties.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -39,24 +39,37 @@ /// public class ClosingStructureProperties : ObjectProperties { - private const int namePropertyIndex = 1; - private const int locationPropertyIndex = 2; - private const int structureNormalOrientationPropertyIndex = 3; - private const int inflowModelTypePropertyIndex = 4; - private const int widthFlowAperturesPropertyIndex = 5; - private const int areaFlowAperturesPropertyIndex = 6; - private const int identicalAperturesPropertyIndex = 7; - private const int flowWidthAtBottomProtectionPropertyIndex = 8; - private const int storageStructureAreaPropertyIndex = 9; - private const int allowedLevelIncreaseStoragePropertyIndex = 10; - private const int levelCrestStructureNotClosingPropertyIndex = 11; - private const int thresholdHeightOpenWeirPropertyIndex = 12; - private const int insideWaterLevelPropertyIndex = 13; - private const int criticalOvertoppingDischargePropertyIndex = 14; - private const int probabilityOrFrequencyOpenStructureBeforeFloodingPropertyIndex = 15; - private const int failureProbabilityOpenStructurePropertyIndex = 16; - private const int failureProbabilityReparationPropertyIndex = 17; + private const int idPropertyIndex = 1; + private const int namePropertyIndex = 2; + private const int locationPropertyIndex = 3; + private const int structureNormalOrientationPropertyIndex = 4; + private const int inflowModelTypePropertyIndex = 5; + private const int widthFlowAperturesPropertyIndex = 6; + private const int areaFlowAperturesPropertyIndex = 7; + private const int identicalAperturesPropertyIndex = 8; + private const int flowWidthAtBottomProtectionPropertyIndex = 9; + private const int storageStructureAreaPropertyIndex = 10; + private const int allowedLevelIncreaseStoragePropertyIndex = 11; + private const int levelCrestStructureNotClosingPropertyIndex = 12; + private const int thresholdHeightOpenWeirPropertyIndex = 13; + private const int insideWaterLevelPropertyIndex = 14; + private const int criticalOvertoppingDischargePropertyIndex = 15; + private const int probabilityOrFrequencyOpenStructureBeforeFloodingPropertyIndex = 16; + private const int failureProbabilityOpenStructurePropertyIndex = 17; + private const int failureProbabilityReparationPropertyIndex = 18; + [PropertyOrder(idPropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Id_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Structure_Id_Description))] + public string Id + { + get + { + return data.Id; + } + } + [PropertyOrder(namePropertyIndex)] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Structure_Name_DisplayName))] Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructurePropertiesTest.cs =================================================================== diff -u -rf88343c0590cb04c7135ce141872940e59325927 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructurePropertiesTest.cs (.../ClosingStructurePropertiesTest.cs) (revision f88343c0590cb04c7135ce141872940e59325927) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PropertyClasses/ClosingStructurePropertiesTest.cs (.../ClosingStructurePropertiesTest.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -34,23 +34,24 @@ [TestFixture] public class ClosingStructurePropertiesTest { - private const int namePropertyIndex = 0; - private const int locationPropertyIndex = 1; - private const int structureNormalOrientationPropertyIndex = 2; - private const int inflowModelTypePropertyIndex = 3; - private const int widthFlowAperturesPropertyIndex = 4; - private const int areaFlowAperturesPropertyIndex = 5; - private const int identicalAperturesPropertyIndex = 6; - private const int flowWidthAtBottomProtectionPropertyIndex = 7; - private const int storageStructureAreaPropertyIndex = 8; - private const int allowedLevelIncreaseStoragePropertyIndex = 9; - private const int levelCrestStructureNotClosingPropertyIndex = 10; - private const int thresholdHeightOpenWeirPropertyIndex = 11; - private const int insideWaterLevelPropertyIndex = 12; - private const int criticalOvertoppingDischargePropertyIndex = 13; - private const int probabilityOrFrequencyOpenStructureBeforeFloodingPropertyIndex = 14; - private const int failureProbabilityOpenStructurePropertyIndex = 15; - private const int failureProbabilityReparationPropertyIndex = 16; + private const int idPropertyIndex = 0; + private const int namePropertyIndex = 1; + private const int locationPropertyIndex = 2; + private const int structureNormalOrientationPropertyIndex = 3; + private const int inflowModelTypePropertyIndex = 4; + private const int widthFlowAperturesPropertyIndex = 5; + private const int areaFlowAperturesPropertyIndex = 6; + private const int identicalAperturesPropertyIndex = 7; + private const int flowWidthAtBottomProtectionPropertyIndex = 8; + private const int storageStructureAreaPropertyIndex = 9; + private const int allowedLevelIncreaseStoragePropertyIndex = 10; + private const int levelCrestStructureNotClosingPropertyIndex = 11; + private const int thresholdHeightOpenWeirPropertyIndex = 12; + private const int insideWaterLevelPropertyIndex = 13; + private const int criticalOvertoppingDischargePropertyIndex = 14; + private const int probabilityOrFrequencyOpenStructureBeforeFloodingPropertyIndex = 15; + private const int failureProbabilityOpenStructurePropertyIndex = 16; + private const int failureProbabilityReparationPropertyIndex = 17; [Test] public void Constructor_ExpectedValues() @@ -74,6 +75,7 @@ properties.Data = structure; // Assert + Assert.AreEqual(structure.Id, properties.Id); Assert.AreEqual(structure.Name, properties.Name); Assert.AreEqual(Math.Round(structure.Location.X), properties.Location.X); Assert.AreEqual(Math.Round(structure.Location.Y), properties.Location.Y); @@ -146,12 +148,19 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(17, dynamicProperties.Count); + Assert.AreEqual(18, dynamicProperties.Count); const string schematizationCategory = "Schematisatie"; const string hydraulicDataCategory = "Hydraulische gegevens"; const string generalCategory = "Algemeen"; + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, + generalCategory, + "ID", + "ID van het kunstwerk.", + true); + PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -1200,6 +1200,15 @@ } /// + /// Looks up a localized string similar to ID van het voorlandprofiel.. + /// + public static string ForeshoreProfile_Id_Description { + get { + return ResourceManager.GetString("ForeshoreProfile_Id_Description", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Naam van het voorlandprofiel.. /// public static string ForeshoreProfile_Name_Description { @@ -1438,6 +1447,15 @@ } /// + /// Looks up a localized string similar to ID. + /// + public static string Id_DisplayName { + get { + return ResourceManager.GetString("Id_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap InputFolderIcon { @@ -2069,6 +2087,15 @@ } /// + /// Looks up a localized string similar to ID van het kunstwerk.. + /// + public static string Structure_Id_Description { + get { + return ResourceManager.GetString("Structure_Id_Description", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Instroommodel van het kunstwerk.. /// public static string Structure_InflowModelType_Description { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -r2fbb7b54b29f25f69c4c53cdb40f3704dccf5620 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 2fbb7b54b29f25f69c4c53cdb40f3704dccf5620) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -932,4 +932,13 @@ Er zijn geen berekeningen om bij te werken. + + ID van het voorlandprofiel. + + + ID + + + ID van het kunstwerk. + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ForeshoreProfileProperties.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ForeshoreProfileProperties.cs (.../ForeshoreProfileProperties.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ForeshoreProfileProperties.cs (.../ForeshoreProfileProperties.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -35,12 +35,25 @@ /// public class ForeshoreProfileProperties : ObjectProperties { - private const int namePropertyIndex = 1; - private const int worldReferencePointPropertyIndex = 2; - private const int orientationPropertyIndex = 3; - private const int breakWaterPropertyIndex = 4; - private const int foreshorePropertyIndex = 5; + private const int idPropertyIndex = 1; + private const int namePropertyIndex = 2; + private const int worldReferencePointPropertyIndex = 3; + private const int orientationPropertyIndex = 4; + private const int breakWaterPropertyIndex = 5; + private const int foreshorePropertyIndex = 6; + [PropertyOrder(idPropertyIndex)] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_General))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.Id_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.ForeshoreProfile_Id_Description))] + public string Id + { + get + { + return data.Id; + } + } + [PropertyOrder(namePropertyIndex)] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_General))] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Profile_Name_DisplayName))] Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ForeshoreProfilePropertiesTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ForeshoreProfilePropertiesTest.cs (.../ForeshoreProfilePropertiesTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ForeshoreProfilePropertiesTest.cs (.../ForeshoreProfilePropertiesTest.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -33,11 +33,12 @@ [TestFixture] public class ForeshoreProfilePropertiesTest { - private const int namePropertyIndex = 0; - private const int worldReferencePointPropertyIndex = 1; - private const int orientationPropertyIndex = 2; - private const int breakWaterPropertyIndex = 3; - private const int foreshoreGeometryPropertyIndex = 4; + private const int idPropertyIndex = 0; + private const int namePropertyIndex = 1; + private const int worldReferencePointPropertyIndex = 2; + private const int orientationPropertyIndex = 3; + private const int breakWaterPropertyIndex = 4; + private const int foreshoreGeometryPropertyIndex = 5; [Test] public void Constructor_ExpectedValues() @@ -54,11 +55,12 @@ public void Data_SetNewForeshoreProfileInstance_ReturnCorrectPropertyValues() { // Setup + const string id = "VP"; const string name = "Voorlandprofiel"; var foreshoreProfile = new ForeshoreProfile(new Point2D(12.34, 56.78), new Point2D[0], null, new ForeshoreProfile.ConstructionProperties { - Id = "id", + Id = id, Name = name }); @@ -70,6 +72,7 @@ // Assert Assert.AreEqual(new Point2D(12, 57), properties.WorldReferencePoint); + Assert.AreEqual(id, properties.Id); Assert.AreEqual(name, properties.Name); Assert.AreEqual(2, properties.Orientation.NumberOfDecimalPlaces); Assert.AreEqual(0.0, properties.Orientation.Value); @@ -91,14 +94,21 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(5, dynamicProperties.Count); + Assert.AreEqual(6, dynamicProperties.Count); + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, + "Algemeen", + "ID", + "ID van het voorlandprofiel.", + true); + PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; - Assert.IsNotNull(nameProperty); - Assert.IsTrue(nameProperty.IsReadOnly); - Assert.AreEqual("Algemeen", nameProperty.Category); - Assert.AreEqual("Naam", nameProperty.DisplayName); - Assert.AreEqual("Naam van het voorlandprofiel.", nameProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + "Algemeen", + "Naam", + "Naam van het voorlandprofiel.", + true); PropertyDescriptor worldReferencePointProperty = dynamicProperties[worldReferencePointPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(worldReferencePointProperty, Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -raeb6e1a439617630e7613b9ed5af152c345fa2c6 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision aeb6e1a439617630e7613b9ed5af152c345fa2c6) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -226,6 +226,15 @@ } /// + /// Looks up a localized string similar to ID van het dijkprofiel.. + /// + public static string DikeProfile_Id_Description { + get { + return ResourceManager.GetString("DikeProfile_Id_Description", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Naam van het dijkprofiel.. /// public static string DikeProfile_Name_Description { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx =================================================================== diff -u -r0a9f50b4c382d49930b77076c658edf370c7a24e -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 0a9f50b4c382d49930b77076c658edf370c7a24e) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -237,6 +237,9 @@ Is convergentie bereikt in de overslagdebiet berekening? + + ID van het dijkprofiel. + De locatie van het bestand waaruit de dijkprofielen zijn geïmporteerd. Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/DikeProfileProperties.cs =================================================================== diff -u -raeb6e1a439617630e7613b9ed5af152c345fa2c6 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/DikeProfileProperties.cs (.../DikeProfileProperties.cs) (revision aeb6e1a439617630e7613b9ed5af152c345fa2c6) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/DikeProfileProperties.cs (.../DikeProfileProperties.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -37,14 +37,27 @@ /// public class DikeProfileProperties : ObjectProperties { - private const int namePropertyIndex = 1; - private const int worldReferencePointPropertyIndex = 2; - private const int orientationPropertyIndex = 3; - private const int breakWaterPropertyIndex = 4; - private const int foreshorePropertyIndex = 5; - private const int dikeGeometryPropertyIndex = 6; - private const int dikeHeightPropertyIndex = 7; + private const int idPropertyIndex = 1; + private const int namePropertyIndex = 2; + private const int worldReferencePointPropertyIndex = 3; + private const int orientationPropertyIndex = 4; + private const int breakWaterPropertyIndex = 5; + private const int foreshorePropertyIndex = 6; + private const int dikeGeometryPropertyIndex = 7; + private const int dikeHeightPropertyIndex = 8; + [PropertyOrder(idPropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Id_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.DikeProfile_Id_Description))] + public string Id + { + get + { + return data.Id; + } + } + [PropertyOrder(namePropertyIndex)] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Profile_Name_DisplayName))] Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/DikeProfilePropertiesTest.cs =================================================================== diff -u -raeb6e1a439617630e7613b9ed5af152c345fa2c6 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/DikeProfilePropertiesTest.cs (.../DikeProfilePropertiesTest.cs) (revision aeb6e1a439617630e7613b9ed5af152c345fa2c6) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/DikeProfilePropertiesTest.cs (.../DikeProfilePropertiesTest.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -20,6 +20,7 @@ // All rights reserved. using System.ComponentModel; +using System.Linq; using Core.Common.Base.Geometry; using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; @@ -33,13 +34,14 @@ [TestFixture] public class DikeProfilePropertiesTest { - private const int namePropertyIndex = 0; - private const int worldReferencePointPropertyIndex = 1; - private const int orientationPropertyIndex = 2; - private const int breakWaterPropertyIndex = 3; - private const int foreshorePropertyIndex = 4; - private const int dikeGeometryPropertyIndex = 5; - private const int dikeHeightPropertyIndex = 6; + private const int idPropertyIndex = 0; + private const int namePropertyIndex = 1; + private const int worldReferencePointPropertyIndex = 2; + private const int orientationPropertyIndex = 3; + private const int breakWaterPropertyIndex = 4; + private const int foreshorePropertyIndex = 5; + private const int dikeGeometryPropertyIndex = 6; + private const int dikeHeightPropertyIndex = 7; [Test] public void Constructor_ExpectedValues() @@ -56,8 +58,18 @@ public void Data_SetNewDikeProfileInstance_ReturnCorrectPropertyValues() { // Setup + const string id = "DP"; const string name = "Dijkprofiel"; - DikeProfile dikeProfile = new TestDikeProfile(name, new Point2D(12.34, 56.78)); + var dikeProfile = new DikeProfile( + new Point2D(12.34, 56.78), + Enumerable.Empty(), + Enumerable.Empty(), + new BreakWater(BreakWaterType.Caisson, 2), + new DikeProfile.ConstructionProperties + { + Id = id, + Name = name + }); // Call var properties = new DikeProfileProperties @@ -67,6 +79,7 @@ // Assert Assert.AreEqual(new Point2D(12, 57), properties.WorldReferencePoint); + Assert.AreEqual(id, properties.Id); Assert.AreEqual(name, properties.Name); Assert.AreEqual(2, properties.Orientation.NumberOfDecimalPlaces); Assert.AreEqual(0.0, properties.Orientation.Value); @@ -91,14 +104,21 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(7, dynamicProperties.Count); + Assert.AreEqual(8, dynamicProperties.Count); + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, + "Algemeen", + "ID", + "ID van het dijkprofiel.", + true); + PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; - Assert.IsNotNull(nameProperty); - Assert.IsTrue(nameProperty.IsReadOnly); - Assert.AreEqual("Algemeen", nameProperty.Category); - Assert.AreEqual("Naam", nameProperty.DisplayName); - Assert.AreEqual("Naam van het dijkprofiel.", nameProperty.Description); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + "Algemeen", + "Naam", + "Naam van het dijkprofiel.", + true); PropertyDescriptor worldReferencePointProperty = dynamicProperties[worldReferencePointPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(worldReferencePointProperty, Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructureProperties.cs =================================================================== diff -u -r4bf59bb3506b840b284efe0c0f4431b7876e0e5b -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructureProperties.cs (.../HeightStructureProperties.cs) (revision 4bf59bb3506b840b284efe0c0f4431b7876e0e5b) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructureProperties.cs (.../HeightStructureProperties.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -37,17 +37,30 @@ /// public class HeightStructureProperties : ObjectProperties { - private const int namePropertyIndex = 1; - private const int locationPropertyIndex = 2; - private const int structureNormalOrientationPropertyIndex = 3; - private const int flowWidthAtBottomProtectionPropertyIndex = 4; - private const int widthFlowAperturesPropertyIndex = 5; - private const int storageStructureAreaPropertyIndex = 6; - private const int allowedLevelIncreaseStoragePropertyIndex = 7; - private const int levelCrestStructurePropertyIndex = 8; - private const int criticalOvertoppingDischargePropertyIndex = 9; - private const int failureProbabilityStructureWithErosionPropertyIndex = 10; + private const int idPropertyIndex = 1; + private const int namePropertyIndex = 2; + private const int locationPropertyIndex = 3; + private const int structureNormalOrientationPropertyIndex = 4; + private const int flowWidthAtBottomProtectionPropertyIndex = 5; + private const int widthFlowAperturesPropertyIndex = 6; + private const int storageStructureAreaPropertyIndex = 7; + private const int allowedLevelIncreaseStoragePropertyIndex = 8; + private const int levelCrestStructurePropertyIndex = 9; + private const int criticalOvertoppingDischargePropertyIndex = 10; + private const int failureProbabilityStructureWithErosionPropertyIndex = 11; + [PropertyOrder(idPropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Id_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Structure_Id_Description))] + public string Id + { + get + { + return data.Id; + } + } + [PropertyOrder(namePropertyIndex)] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Structure_Name_DisplayName))] Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructurePropertiesTest.cs =================================================================== diff -u -r4bf59bb3506b840b284efe0c0f4431b7876e0e5b -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructurePropertiesTest.cs (.../HeightStructurePropertiesTest.cs) (revision 4bf59bb3506b840b284efe0c0f4431b7876e0e5b) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructurePropertiesTest.cs (.../HeightStructurePropertiesTest.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -33,16 +33,17 @@ [TestFixture] public class HeightStructurePropertiesTest { - private const int namePropertyIndex = 0; - private const int locationPropertyIndex = 1; - private const int structureNormalOrientationPropertyIndex = 2; - private const int flowWidthAtBottomProtectionPropertyIndex = 3; - private const int widthFlowAperturesPropertyIndex = 4; - private const int storageStructureAreaPropertyIndex = 5; - private const int allowedLevelIncreaseStoragePropertyIndex = 6; - private const int levelCrestStructurePropertyIndex = 7; - private const int criticalOvertoppingDischargePropertyIndex = 8; - private const int failureProbabilityStructureWithErosionPropertyIndex = 9; + private const int idPropertyIndex = 0; + private const int namePropertyIndex = 1; + private const int locationPropertyIndex = 2; + private const int structureNormalOrientationPropertyIndex = 3; + private const int flowWidthAtBottomProtectionPropertyIndex = 4; + private const int widthFlowAperturesPropertyIndex = 5; + private const int storageStructureAreaPropertyIndex = 6; + private const int allowedLevelIncreaseStoragePropertyIndex = 7; + private const int levelCrestStructurePropertyIndex = 8; + private const int criticalOvertoppingDischargePropertyIndex = 9; + private const int failureProbabilityStructureWithErosionPropertyIndex = 10; [Test] public void Constructor_ExpectedValues() @@ -66,6 +67,7 @@ properties.Data = structure; // Assert + Assert.AreEqual(structure.Id, properties.Id); Assert.AreEqual(structure.Name, properties.Name); Assert.AreEqual(structure.Location, properties.Location); Assert.AreEqual(structure.StructureNormalOrientation, properties.StructureNormalOrientation); @@ -117,11 +119,17 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(10, dynamicProperties.Count); + Assert.AreEqual(11, dynamicProperties.Count); const string schematizationCategory = "Schematisatie"; const string generalCategory = "Algemeen"; + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; + Assert.IsTrue(idProperty.IsReadOnly); + Assert.AreEqual(generalCategory, idProperty.Category); + Assert.AreEqual("ID", idProperty.DisplayName); + Assert.AreEqual("ID van het kunstwerk.", idProperty.Description); + PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; Assert.IsTrue(nameProperty.IsReadOnly); Assert.AreEqual(generalCategory, nameProperty.Category); Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructureProperties.cs =================================================================== diff -u -rff948d4633181ead2677ab35467a93b4118c6751 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructureProperties.cs (.../StabilityPointStructureProperties.cs) (revision ff948d4633181ead2677ab35467a93b4118c6751) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructureProperties.cs (.../StabilityPointStructureProperties.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -39,37 +39,50 @@ /// public class StabilityPointStructureProperties : ObjectProperties { - private const int namePropertyIndex = 1; - private const int locationPropertyIndex = 2; - private const int insideWaterLevelPropertyIndex = 3; - private const int insideWaterLevelFailureConstructionPropertyIndex = 4; - private const int structureNormalOrientationPropertyIndex = 5; - private const int stabilityPointStructureInflowModelTypePropertyIndex = 6; - private const int widthFlowAperturesPropertyIndex = 7; - private const int areaFlowAperturesPropertyIndex = 8; - private const int flowWidthAtBottomProtectionPropertyIndex = 9; - private const int storageStructureAreaPropertyIndex = 10; - private const int allowedLevelIncreaseStoragePropertyIndex = 11; - private const int levelCrestStructurePropertyIndex = 12; - private const int thresholdHeightOpenWeirPropertyIndex = 13; - private const int criticalOvertoppingDischargePropertyIndex = 14; - private const int flowVelocityStructureClosablePropertyIndex = 15; - private const int constructiveStrengthLinearLoadModelPropertyIndex = 16; - private const int constructiveStrengthQuadraticLoadModelPropertyIndex = 17; - private const int bankWidthPropertyIndex = 18; - private const int evaluationLevelPropertyIndex = 19; - private const int verticalDistancePropertyIndex = 20; - private const int failureProbabilityRepairClosurePropertyIndex = 21; - private const int failureCollisionEnergyPropertyIndex = 22; - private const int shipMassPropertyIndex = 23; - private const int shipVelocityPropertyIndex = 24; - private const int levellingCountPropertyIndex = 25; - private const int probabilityCollisionSecondaryStructurePropertyIndex = 26; - private const int stabilityLinearLoadModelPropertyIndex = 27; - private const int stabilityQuadraticLoadModelPropertyIndex = 28; + private const int idPropertyIndex = 1; + private const int namePropertyIndex = 2; + private const int locationPropertyIndex = 3; + private const int insideWaterLevelPropertyIndex = 4; + private const int insideWaterLevelFailureConstructionPropertyIndex = 5; + private const int structureNormalOrientationPropertyIndex = 6; + private const int stabilityPointStructureInflowModelTypePropertyIndex = 7; + private const int widthFlowAperturesPropertyIndex = 8; + private const int areaFlowAperturesPropertyIndex = 9; + private const int flowWidthAtBottomProtectionPropertyIndex = 10; + private const int storageStructureAreaPropertyIndex = 11; + private const int allowedLevelIncreaseStoragePropertyIndex = 12; + private const int levelCrestStructurePropertyIndex = 13; + private const int thresholdHeightOpenWeirPropertyIndex = 14; + private const int criticalOvertoppingDischargePropertyIndex = 15; + private const int flowVelocityStructureClosablePropertyIndex = 16; + private const int constructiveStrengthLinearLoadModelPropertyIndex = 17; + private const int constructiveStrengthQuadraticLoadModelPropertyIndex = 18; + private const int bankWidthPropertyIndex = 19; + private const int evaluationLevelPropertyIndex = 20; + private const int verticalDistancePropertyIndex = 21; + private const int failureProbabilityRepairClosurePropertyIndex = 22; + private const int failureCollisionEnergyPropertyIndex = 23; + private const int shipMassPropertyIndex = 24; + private const int shipVelocityPropertyIndex = 25; + private const int levellingCountPropertyIndex = 26; + private const int probabilityCollisionSecondaryStructurePropertyIndex = 27; + private const int stabilityLinearLoadModelPropertyIndex = 28; + private const int stabilityQuadraticLoadModelPropertyIndex = 29; #region General + [PropertyOrder(idPropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Id_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Structure_Id_Description))] + public string Id + { + get + { + return data.Id; + } + } + [PropertyOrder(namePropertyIndex)] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Structure_Name_DisplayName))] Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructurePropertiesTest.cs =================================================================== diff -u -rff948d4633181ead2677ab35467a93b4118c6751 -r6b770a7da0ed7cf13bab8220573a4d5ce9494809 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructurePropertiesTest.cs (.../StabilityPointStructurePropertiesTest.cs) (revision ff948d4633181ead2677ab35467a93b4118c6751) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructurePropertiesTest.cs (.../StabilityPointStructurePropertiesTest.cs) (revision 6b770a7da0ed7cf13bab8220573a4d5ce9494809) @@ -35,36 +35,37 @@ [TestFixture] public class StabilityPointStructurePropertiesTest { - private const int namePropertyIndex = 0; - private const int locationPropertyIndex = 1; + private const int idPropertyIndex = 0; + private const int namePropertyIndex = 1; + private const int locationPropertyIndex = 2; - private const int insideWaterLevelPropertyIndex = 2; - private const int insideWaterLevelFailureConstructionPropertyIndex = 3; + private const int insideWaterLevelPropertyIndex = 3; + private const int insideWaterLevelFailureConstructionPropertyIndex = 4; - private const int structureNormalOrientationPropertyIndex = 4; - private const int stabilityPointStructureInflowModelTypePropertyIndex = 5; - private const int widthFlowAperturesPropertyIndex = 6; - private const int areaFlowAperturesPropertyIndex = 7; - private const int flowWidthAtBottomProtectionPropertyIndex = 8; - private const int storageStructureAreaPropertyIndex = 9; - private const int allowedLevelIncreaseStoragePropertyIndex = 10; - private const int levelCrestStructurePropertyIndex = 11; - private const int thresholdHeightOpenWeirPropertyIndex = 12; - private const int criticalOvertoppingDischargePropertyIndex = 13; - private const int flowVelocityStructureClosablePropertyIndex = 14; - private const int constructiveStrengthLinearLoadModelPropertyIndex = 15; - private const int constructiveStrengthQuadraticLoadModelPropertyIndex = 16; - private const int bankWidthPropertyIndex = 17; - private const int evaluationLevelPropertyIndex = 18; - private const int verticalDistancePropertyIndex = 19; - private const int failureProbabilityRepairClosurePropertyIndex = 20; - private const int failureCollisionEnergyPropertyIndex = 21; - private const int shipMassPropertyIndex = 22; - private const int shipVelocityPropertyIndex = 23; - private const int levellingCountPropertyIndex = 24; - private const int probabilityCollisionSecondaryStructurePropertyIndex = 25; - private const int stabilityLinearLoadModelPropertyIndex = 26; - private const int stabilityQuadraticLoadModelPropertyIndex = 27; + private const int structureNormalOrientationPropertyIndex = 5; + private const int stabilityPointStructureInflowModelTypePropertyIndex = 6; + private const int widthFlowAperturesPropertyIndex = 7; + private const int areaFlowAperturesPropertyIndex = 8; + private const int flowWidthAtBottomProtectionPropertyIndex = 9; + private const int storageStructureAreaPropertyIndex = 10; + private const int allowedLevelIncreaseStoragePropertyIndex = 11; + private const int levelCrestStructurePropertyIndex = 12; + private const int thresholdHeightOpenWeirPropertyIndex = 13; + private const int criticalOvertoppingDischargePropertyIndex = 14; + private const int flowVelocityStructureClosablePropertyIndex = 15; + private const int constructiveStrengthLinearLoadModelPropertyIndex = 16; + private const int constructiveStrengthQuadraticLoadModelPropertyIndex = 17; + private const int bankWidthPropertyIndex = 18; + private const int evaluationLevelPropertyIndex = 19; + private const int verticalDistancePropertyIndex = 20; + private const int failureProbabilityRepairClosurePropertyIndex = 21; + private const int failureCollisionEnergyPropertyIndex = 22; + private const int shipMassPropertyIndex = 23; + private const int shipVelocityPropertyIndex = 24; + private const int levellingCountPropertyIndex = 25; + private const int probabilityCollisionSecondaryStructurePropertyIndex = 26; + private const int stabilityLinearLoadModelPropertyIndex = 27; + private const int stabilityQuadraticLoadModelPropertyIndex = 28; [Test] public void Constructor_ExpectedValues() @@ -88,6 +89,7 @@ properties.Data = structure; // Assert + Assert.AreEqual(structure.Id, properties.Id); Assert.AreEqual(structure.Name, properties.Name); var expectedLocation = new Point2D(new RoundedDouble(0, structure.Location.X), new RoundedDouble(0, structure.Location.Y)); @@ -215,12 +217,18 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(28, dynamicProperties.Count); + Assert.AreEqual(29, dynamicProperties.Count); const string schematizationCategory = "Schematisatie"; const string hydraulicDataCategory = "Hydraulische gegevens"; const string generalCategory = "Algemeen"; + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; + Assert.IsTrue(idProperty.IsReadOnly); + Assert.AreEqual(generalCategory, idProperty.Category); + Assert.AreEqual("ID", idProperty.DisplayName); + Assert.AreEqual("ID van het kunstwerk.", idProperty.Description); + PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; Assert.IsTrue(nameProperty.IsReadOnly); Assert.AreEqual(generalCategory, nameProperty.Category);