Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs =================================================================== diff -u -r63fbdd5525927fbf9d63925eef9da8e17a0d7b44 -r5f0c498962317723017cf965a142e7cf4e67a915 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs (.../HydraulicBoundaryDatabasePropertiesTest.cs) (revision 63fbdd5525927fbf9d63925eef9da8e17a0d7b44) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs (.../HydraulicBoundaryDatabasePropertiesTest.cs) (revision 5f0c498962317723017cf965a142e7cf4e67a915) @@ -19,7 +19,9 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.ComponentModel; using System.Linq; +using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; using NUnit.Framework; using Rhino.Mocks; @@ -77,5 +79,45 @@ Assert.AreEqual(expectedLocationProperties.Location, hydraulicBoundaryLocationProperties.Location); Assert.AreEqual(expectedLocationProperties.DesignWaterLevel, hydraulicBoundaryLocationProperties.DesignWaterLevel); } + + [Test] + public void PropertyAttributes_ReturnExpectedValues() + { + // Setup + var hydraulicBoundaryLocationProperties = new HydraulicBoundaryDatabaseProperties(); + + var dynamicPropertyBag = new DynamicPropertyBag(hydraulicBoundaryLocationProperties); + const string expectedFilePathDisplayName = "Hydraulische randvoorwaarden database"; + const string expectedFilePathDescription = "Locatie van het hydraulische randvoorwaarden database bestand."; + const string expectedFilePathCategory = "Algemeen"; + + const string expectedLocationsDisplayName = "Locaties"; + const string expectedLocationsDescription = "Locaties uit de hydraulische randvoorwaarden database."; + const string expectedLocationsCategory = "Algemeen"; + + // Call + TypeConverter classTypeConverter = TypeDescriptor.GetConverter(hydraulicBoundaryLocationProperties, true); + PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(); + PropertyDescriptor filePathProperty = dynamicProperties.Find("FilePath", false); + PropertyDescriptor locationsProperty = dynamicProperties.Find("Locations", false); + + // Assert + Assert.IsInstanceOf(classTypeConverter); + + Assert.IsNotNull(filePathProperty); + Assert.IsTrue(filePathProperty.IsReadOnly); + Assert.IsTrue(filePathProperty.IsBrowsable); + Assert.AreEqual(expectedFilePathDisplayName, filePathProperty.DisplayName); + Assert.AreEqual(expectedFilePathDescription, filePathProperty.Description); + Assert.AreEqual(expectedFilePathCategory, filePathProperty.Category); + + Assert.IsNotNull(locationsProperty); + Assert.IsInstanceOf(locationsProperty.Converter); + Assert.IsTrue(locationsProperty.IsReadOnly); + Assert.IsTrue(locationsProperty.IsBrowsable); + Assert.AreEqual(expectedLocationsDisplayName, locationsProperty.DisplayName); + Assert.AreEqual(expectedLocationsDescription, locationsProperty.Description); + Assert.AreEqual(expectedLocationsCategory, filePathProperty.Category); + } } } \ No newline at end of file