Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/BackgroundWmtsMapDataProperties.cs =================================================================== diff -u -rb41f4c465f094e91312ffd90174e765417b28ba9 -re48b0cdb41772b2675500d96ad19ae59bc142aaf --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/BackgroundWmtsMapDataProperties.cs (.../BackgroundWmtsMapDataProperties.cs) (revision b41f4c465f094e91312ffd90174e765417b28ba9) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/BackgroundWmtsMapDataProperties.cs (.../BackgroundWmtsMapDataProperties.cs) (revision e48b0cdb41772b2675500d96ad19ae59bc142aaf) @@ -71,7 +71,6 @@ } } - [DynamicReadOnly] [ResourcesCategory(typeof(RingtoetsCommonForms), nameof(RingtoetsCommonForms.Categories_General))] [ResourcesDisplayName(typeof(Resources), nameof(Resources.BackgroundMapDataContextProperties_Transparency_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundMapDataContextProperties_Transparency_Description))] @@ -88,7 +87,6 @@ } } - [DynamicReadOnly] [ResourcesCategory(typeof(RingtoetsCommonForms), nameof(RingtoetsCommonForms.Categories_General))] [ResourcesDisplayName(typeof(Resources), nameof(Resources.BackgroundMapDataContextProperties_IsVisible_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundMapDataContextProperties_IsVisible_Description))] @@ -104,20 +102,5 @@ data.NotifyObservers(); } } - - [DynamicReadOnlyValidationMethod] - public bool DynamicReadOnlyValidationMethod(string propertyName) - { - if (propertyName == nameof(Transparency)) - { - return !data.IsConfigured; - } - if (propertyName == nameof(IsVisible)) - { - return !data.IsConfigured; - } - - return false; - } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/BackgroundWmtsMapDataPropertiesTest.cs =================================================================== diff -u -rb41f4c465f094e91312ffd90174e765417b28ba9 -re48b0cdb41772b2675500d96ad19ae59bc142aaf --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/BackgroundWmtsMapDataPropertiesTest.cs (.../BackgroundWmtsMapDataPropertiesTest.cs) (revision b41f4c465f094e91312ffd90174e765417b28ba9) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/BackgroundWmtsMapDataPropertiesTest.cs (.../BackgroundWmtsMapDataPropertiesTest.cs) (revision e48b0cdb41772b2675500d96ad19ae59bc142aaf) @@ -157,80 +157,13 @@ PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(transparencyPropertyIndex, "Algemeen", "Transparantie", - "Transparantie waarmee de achtergrond kaartlaag wordt weergegeven.", - true); + "Transparantie waarmee de achtergrond kaartlaag wordt weergegeven."); PropertyDescriptor visibilityProperty = dynamicProperties[requiredVisibilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(visibilityProperty, "Algemeen", "Weergeven", - "Geeft aan of de geselecteerde achtergrond kaartlaag in alle kaarten van dit traject wordt weergegeven.", - true); + "Geeft aan of de geselecteerde achtergrond kaartlaag in alle kaarten van dit traject wordt weergegeven."); } - - [Test] - [TestCase(true)] - [TestCase(false)] - public void GetProperties_UseConfiguredMapData_ReturnsExpectedAttributeValues(bool isMapConfigured) - { - // Setup - WmtsMapData mapData = isMapConfigured ? - WmtsMapData.CreateDefaultPdokMapData() : - WmtsMapData.CreateUnconnectedMapData(); - - // Call - var properties = new BackgroundWmtsMapDataProperties(mapData); - - // Assert - PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(4, dynamicProperties.Count); - - PropertyDescriptor transparencyPropertyIndex = dynamicProperties[requiredTransparencyPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(transparencyPropertyIndex, - "Algemeen", - "Transparantie", - "Transparantie waarmee de achtergrond kaartlaag wordt weergegeven.", - !isMapConfigured); - - PropertyDescriptor visibilityProperty = dynamicProperties[requiredVisibilityPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(visibilityProperty, - "Algemeen", - "Weergeven", - "Geeft aan of de geselecteerde achtergrond kaartlaag in alle kaarten van dit traject wordt weergegeven.", - !isMapConfigured); - } - - [Test] - [TestCase(nameof(BackgroundWmtsMapDataProperties.Transparency), true)] - [TestCase(nameof(BackgroundWmtsMapDataProperties.IsVisible), true)] - public void DynamicReadOnlyValidationMethod_VariousPropertyNames_ReturnExpectedValue(string propertyName, bool isConfigured) - { - // Setup - WmtsMapData mapData = isConfigured ? - WmtsMapData.CreateDefaultPdokMapData() : - WmtsMapData.CreateUnconnectedMapData(); - - var properties = new BackgroundWmtsMapDataProperties(mapData); - - // Call - bool result = properties.DynamicReadOnlyValidationMethod(propertyName); - - // Assert - Assert.AreEqual(!isConfigured, result); - } - - [Test] - public void DynamicReadOnlyValidationMethod_OtherPropertyNames_ReturnsTrue() - { - // Setup - var mapData = WmtsMapData.CreateUnconnectedMapData(); - var properties = new BackgroundWmtsMapDataProperties(mapData); - - // Call - bool result = properties.DynamicReadOnlyValidationMethod(""); - - // Assert - Assert.IsFalse(result); - } } } \ No newline at end of file