Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/HydraulicBoundaryLocationsProperties.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/HydraulicBoundaryLocationsProperties.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/HydraulicBoundaryLocationsProperties.cs (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -0,0 +1,74 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base; +using Core.Common.Gui.PropertyBag; +using Ringtoets.Common.Data.Hydraulics; + +namespace Ringtoets.Common.Forms.PropertyClasses +{ + /// + /// ViewModel of an enumeration of for properties panel. + /// + public abstract class HydraulicBoundaryLocationsProperties : ObjectProperties> + { + private readonly RecursiveObserver, HydraulicBoundaryLocation> hydraulicBoundaryLocationObserver; + + /// + /// Creates a new instance of . + /// + /// The list of hydraulic boundary locations to set as data. + /// Thrown when is null. + protected HydraulicBoundaryLocationsProperties(ObservableList hydraulicBoundaryLocations) + { + if (hydraulicBoundaryLocations == null) + { + throw new ArgumentNullException(nameof(hydraulicBoundaryLocations)); + } + + hydraulicBoundaryLocationObserver = new RecursiveObserver, HydraulicBoundaryLocation>(OnRefreshRequired, list => list); + + Data = hydraulicBoundaryLocations; + } + + public override object Data + { + get + { + return base.Data; + } + set + { + base.Data = value; + + hydraulicBoundaryLocationObserver.Observable = value as ObservableList; + } + } + + public override void Dispose() + { + hydraulicBoundaryLocationObserver.Dispose(); + + base.Dispose(); + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -rfcad48d7beb394e1ac15cfe4289a7381e05aa883 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision fcad48d7beb394e1ac15cfe4289a7381e05aa883) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -58,6 +58,7 @@ Resources.resx + Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/HydraulicBoundaryLocationsPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/HydraulicBoundaryLocationsPropertiesTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/HydraulicBoundaryLocationsPropertiesTest.cs (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -0,0 +1,157 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base; +using NUnit.Framework; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Forms.PropertyClasses; + +namespace Ringtoets.Common.Forms.Test.PropertyClasses +{ + [TestFixture] + public class HydraulicBoundaryLocationsPropertiesTest + { + [Test] + public void Constructor_HydraulicBoundaryLocations_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => new TestHydraulicBoundaryLocationsProperties(null); + + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("hydraulicBoundaryLocations", paramName); + } + + [Test] + public void GivenPropertyControlWithData_WhenSingleLocationUpdated_RefreshRequiredEventRaised() + { + // Given + HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(1.5); + var hydraulicBoundaryLocations = new ObservableList + { + location + }; + + var properties = new TestHydraulicBoundaryLocationsProperties(hydraulicBoundaryLocations); + + var refreshRequiredRaised = 0; + properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; + + // When + location.NotifyObservers(); + + // Then + Assert.AreEqual(1, refreshRequiredRaised); + } + + [Test] + public void GivenDisposedPropertyControlWithData_WhenSingleLocationUpdated_RefreshRequiredEventNotRaised() + { + // Given + HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(1.5); + var hydraulicBoundaryLocations = new ObservableList + { + location + }; + + var properties = new TestHydraulicBoundaryLocationsProperties(hydraulicBoundaryLocations); + + var refreshRequiredRaised = 0; + properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; + + properties.Dispose(); + + // When + location.NotifyObservers(); + + // Then + Assert.AreEqual(0, refreshRequiredRaised); + } + + [Test] + public void GivenPropertyControlWithNewData_WhenSingleLocationUpdatedInPreviouslySetData_RefreshRequiredEventNotRaised() + { + // Given + HydraulicBoundaryLocation location1 = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(1.5); + HydraulicBoundaryLocation location2 = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(1.5); + var hydraulicBoundaryLocations1 = new ObservableList + { + location1 + }; + var hydraulicBoundaryLocations2 = new ObservableList + { + location2 + }; + + var properties = new TestHydraulicBoundaryLocationsProperties(hydraulicBoundaryLocations1) + { + Data = hydraulicBoundaryLocations2 + }; + + var refreshRequiredRaised = 0; + properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; + + // When + location1.NotifyObservers(); + + // Then + Assert.AreEqual(0, refreshRequiredRaised); + } + + [Test] + public void GivenPropertyControlWithNewData_WhenSingleLocationUpdatedInNewlySetData_RefreshRequiredEventRaised() + { + // Given + HydraulicBoundaryLocation location1 = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(1.5); + HydraulicBoundaryLocation location2 = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(1.5); + var hydraulicBoundaryLocations1 = new ObservableList + { + location1 + }; + var hydraulicBoundaryLocations2 = new ObservableList + { + location2 + }; + + var properties = new TestHydraulicBoundaryLocationsProperties(hydraulicBoundaryLocations1) + { + Data = hydraulicBoundaryLocations2 + }; + + var refreshRequiredRaised = 0; + properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; + + // When + location2.NotifyObservers(); + + // Then + Assert.AreEqual(1, refreshRequiredRaised); + } + + private class TestHydraulicBoundaryLocationsProperties : HydraulicBoundaryLocationsProperties + { + public TestHydraulicBoundaryLocationsProperties(ObservableList hydraulicBoundaryLocations) + : base(hydraulicBoundaryLocations) {} + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -rfcad48d7beb394e1ac15cfe4289a7381e05aa883 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision fcad48d7beb394e1ac15cfe4289a7381e05aa883) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -75,6 +75,7 @@ + Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties.cs =================================================================== diff -u -r0f28eb71a18af127ad376776ebd2cd597a0aa5c5 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties.cs) (revision 0f28eb71a18af127ad376776ebd2cd597a0aa5c5) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties.cs) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -24,52 +24,27 @@ using System.Linq; using Core.Common.Base; using Core.Common.Gui.Converters; -using Core.Common.Gui.PropertyBag; using Core.Common.Util.Attributes; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Forms.Properties; +using Ringtoets.Common.Forms.PropertyClasses; namespace Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses { /// /// ViewModel of an enumeration of with /// for properties panel. /// - public class GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties : ObjectProperties> + public class GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties : HydraulicBoundaryLocationsProperties { - private readonly RecursiveObserver, HydraulicBoundaryLocation> hydraulicBoundaryLocationObserver; - /// /// Creates a new instance of . /// /// The locations to show the properties for. /// Thrown when is null. public GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties(ObservableList locations) - { - if (locations == null) - { - throw new ArgumentNullException(nameof(locations)); - } + : base(locations) {} - hydraulicBoundaryLocationObserver = new RecursiveObserver, HydraulicBoundaryLocation>(OnRefreshRequired, list => list); - - Data = locations; - } - - public override object Data - { - get - { - return base.Data; - } - set - { - base.Data = value; - - hydraulicBoundaryLocationObserver.Observable = value as ObservableList; - } - } - [TypeConverter(typeof(ExpandableArrayConverter))] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_General))] [ResourcesDisplayName(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Locations_DisplayName))] @@ -81,12 +56,5 @@ return data.Select(loc => new GrassCoverErosionOutwardsDesignWaterLevelLocationProperties(loc)).ToArray(); } } - - public override void Dispose() - { - hydraulicBoundaryLocationObserver.Dispose(); - - base.Dispose(); - } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationsProperties.cs =================================================================== diff -u -r0f28eb71a18af127ad376776ebd2cd597a0aa5c5 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationsProperties.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsProperties.cs) (revision 0f28eb71a18af127ad376776ebd2cd597a0aa5c5) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationsProperties.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsProperties.cs) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -24,52 +24,27 @@ using System.Linq; using Core.Common.Base; using Core.Common.Gui.Converters; -using Core.Common.Gui.PropertyBag; using Core.Common.Util.Attributes; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Forms.Properties; +using Ringtoets.Common.Forms.PropertyClasses; namespace Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses { /// /// ViewModel of an enumeration of with /// for properties panel. /// - public class GrassCoverErosionOutwardsWaveHeightLocationsProperties : ObjectProperties> + public class GrassCoverErosionOutwardsWaveHeightLocationsProperties : HydraulicBoundaryLocationsProperties { - private readonly RecursiveObserver, HydraulicBoundaryLocation> hydraulicBoundaryLocationObserver; - /// /// Creates a new instance of . /// /// The locations to show the properties for. /// Thrown when is null. public GrassCoverErosionOutwardsWaveHeightLocationsProperties(ObservableList locations) - { - if (locations == null) - { - throw new ArgumentNullException(nameof(locations)); - } + : base(locations) {} - hydraulicBoundaryLocationObserver = new RecursiveObserver, HydraulicBoundaryLocation>(OnRefreshRequired, list => list); - - Data = locations; - } - - public override object Data - { - get - { - return base.Data; - } - set - { - base.Data = value; - - hydraulicBoundaryLocationObserver.Observable = value as ObservableList; - } - } - [TypeConverter(typeof(ExpandableArrayConverter))] [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_General))] [ResourcesDisplayName(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Locations_DisplayName))] @@ -81,12 +56,5 @@ return data.Select(loc => new GrassCoverErosionOutwardsWaveHeightLocationProperties(loc)).ToArray(); } } - - public override void Dispose() - { - hydraulicBoundaryLocationObserver.Dispose(); - - base.Dispose(); - } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsPropertiesTest.cs =================================================================== diff -u -r0f28eb71a18af127ad376776ebd2cd597a0aa5c5 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsPropertiesTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsPropertiesTest.cs) (revision 0f28eb71a18af127ad376776ebd2cd597a0aa5c5) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsPropertiesTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsPropertiesTest.cs) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.ComponentModel; using Core.Common.Base; using Core.Common.Gui.Converters; @@ -28,6 +27,7 @@ using NUnit.Framework; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Forms.PropertyClasses; using Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses; namespace Ringtoets.GrassCoverErosionOutwards.Forms.Test.PropertyClasses @@ -36,17 +36,6 @@ public class GrassCoverErosionOutwardsDesignWaterLevelLocationsPropertiesTest { [Test] - public void Constructor_WithoutLocations_ExpectedValues() - { - // Call - TestDelegate test = () => new GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties(null); - - // Assert - string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("locations", paramName); - } - - [Test] public void Constructor_WithLocations_ExpectedValues() { // Setup @@ -57,7 +46,7 @@ hydraulicBoundaryLocations); // Assert - Assert.IsInstanceOf>>(properties); + Assert.IsInstanceOf(properties); Assert.AreSame(hydraulicBoundaryLocations, properties.Data); var dynamicPropertyBag = new DynamicPropertyBag(properties); @@ -103,50 +92,5 @@ Assert.AreEqual(location.DesignWaterLevel, locationProperties.DesignWaterLevel, location.DesignWaterLevel.GetAccuracy()); Assert.AreEqual("Ja", locationProperties.Convergence); } - - [Test] - public void GivenPropertyControlWithData_WhenSingleLocationUpdated_RefreshRequiredEventRaised() - { - // Given - HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(1.5); - var hydraulicBoundaryLocations = new ObservableList - { - location - }; - - var properties = new GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties(hydraulicBoundaryLocations); - - var refreshRequiredRaised = 0; - properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; - - // When - location.NotifyObservers(); - - // Then - Assert.AreEqual(1, refreshRequiredRaised); - } - - [Test] - public void GivenPropertyControlWithData_WhenSingleLocationUpdatedAfterDispose_RefreshRequiredEventNotRaised() - { - // Given - HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(1.5); - var hydraulicBoundaryLocations = new ObservableList - { - location - }; - - var properties = new GrassCoverErosionOutwardsDesignWaterLevelLocationsProperties(hydraulicBoundaryLocations); - - var refreshRequiredRaised = 0; - properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; - - // When - properties.Dispose(); - location.NotifyObservers(); - - // Then - Assert.AreEqual(0, refreshRequiredRaised); - } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationsPropertiesTest.cs =================================================================== diff -u -r0f28eb71a18af127ad376776ebd2cd597a0aa5c5 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationsPropertiesTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsPropertiesTest.cs) (revision 0f28eb71a18af127ad376776ebd2cd597a0aa5c5) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationsPropertiesTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsPropertiesTest.cs) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.ComponentModel; using System.Linq; using Core.Common.Base; @@ -29,6 +28,7 @@ using NUnit.Framework; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Forms.PropertyClasses; using Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses; namespace Ringtoets.GrassCoverErosionOutwards.Forms.Test.PropertyClasses @@ -37,17 +37,6 @@ public class GrassCoverErosionOutwardsWaveHeightLocationsPropertiesTest { [Test] - public void Constructor_WithoutLocations_ExpectedValues() - { - // Call - TestDelegate test = () => new GrassCoverErosionOutwardsWaveHeightLocationsProperties(null); - - // Assert - string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("locations", paramName); - } - - [Test] public void Constructor_WithLocations_ExpectedValues() { // Setup @@ -58,7 +47,7 @@ hydraulicBoundaryLocations); // Assert - Assert.IsInstanceOf>>(properties); + Assert.IsInstanceOf(properties); Assert.AreSame(hydraulicBoundaryLocations, properties.Data); var dynamicPropertyBag = new DynamicPropertyBag(properties); const string expectedLocationsDisplayName = "Locaties"; @@ -103,50 +92,5 @@ Assert.AreEqual(location.WaveHeight, locationProperties.WaveHeight, location.WaveHeight.GetAccuracy()); Assert.AreEqual("Ja", locationProperties.Convergence); } - - [Test] - public void GivenPropertyControlWithData_WhenSingleLocationUpdated_RefreshRequiredEventRaised() - { - // Given - HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(1.5); - var hydraulicBoundaryLocations = new ObservableList - { - location - }; - - var properties = new GrassCoverErosionOutwardsWaveHeightLocationsProperties(hydraulicBoundaryLocations); - - var refreshRequiredRaised = 0; - properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; - - // When - location.NotifyObservers(); - - // Then - Assert.AreEqual(1, refreshRequiredRaised); - } - - [Test] - public void GivenPropertyControlWithData_WhenSingleLocationUpdatedAfterDispose_RefreshRequiredEventNotRaised() - { - // Given - HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(1.5); - var hydraulicBoundaryLocations = new ObservableList - { - location - }; - - var properties = new GrassCoverErosionOutwardsWaveHeightLocationsProperties(hydraulicBoundaryLocations); - - var refreshRequiredRaised = 0; - properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; - - // When - properties.Dispose(); - location.NotifyObservers(); - - // Then - Assert.AreEqual(0, refreshRequiredRaised); - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationsProperties.cs =================================================================== diff -u -r6aaca4f5533d3d96d8131982e20dab80e7516b47 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationsProperties.cs (.../DesignWaterLevelLocationsProperties.cs) (revision 6aaca4f5533d3d96d8131982e20dab80e7516b47) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationsProperties.cs (.../DesignWaterLevelLocationsProperties.cs) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -26,6 +26,7 @@ using Core.Common.Gui.Converters; using Core.Common.Util.Attributes; using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Forms.PropertyClasses; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Integration.Forms.PropertyClasses Fisheye: Tag cedf973769c057c935ffce89259027f2ea13c4df refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationsProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationsProperties.cs =================================================================== diff -u -r6aaca4f5533d3d96d8131982e20dab80e7516b47 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationsProperties.cs (.../WaveHeightLocationsProperties.cs) (revision 6aaca4f5533d3d96d8131982e20dab80e7516b47) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationsProperties.cs (.../WaveHeightLocationsProperties.cs) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -26,6 +26,7 @@ using Core.Common.Gui.Converters; using Core.Common.Util.Attributes; using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Forms.PropertyClasses; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Integration.Forms.PropertyClasses Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -r6aaca4f5533d3d96d8131982e20dab80e7516b47 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 6aaca4f5533d3d96d8131982e20dab80e7516b47) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -39,7 +39,6 @@ - Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsPropertiesTest.cs =================================================================== diff -u -r0eeecc2eb34d8cdb2563aa632b491ba6b2f39f39 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsPropertiesTest.cs (.../DesignWaterLevelLocationsPropertiesTest.cs) (revision 0eeecc2eb34d8cdb2563aa632b491ba6b2f39f39) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsPropertiesTest.cs (.../DesignWaterLevelLocationsPropertiesTest.cs) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -19,12 +19,10 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.ComponentModel; using System.Linq; using Core.Common.Base; using Core.Common.Gui.Converters; -using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Hydraulics; @@ -39,17 +37,6 @@ private const int requiredLocationsPropertyIndex = 0; [Test] - public void Constructor_WithoutDatabase_ExpectedValues() - { - // Call - TestDelegate test = () => new DesignWaterLevelLocationsProperties(null); - - // Assert - string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("hydraulicBoundaryLocations", paramName); - } - - [Test] public void Constructor_WithHydraulicBoundaryLocations_ExpectedValues() { // Setup @@ -59,7 +46,7 @@ var properties = new DesignWaterLevelLocationsProperties(hydraulicBoundaryLocations); // Assert - Assert.IsInstanceOf>>(properties); + Assert.IsInstanceOf(properties); Assert.AreSame(hydraulicBoundaryLocations, properties.Data); } @@ -110,50 +97,5 @@ "Locaties uit de hydraulische randvoorwaardendatabase.", true); } - - [Test] - public void GivenPropertyControlWithData_WhenSingleLocationUpdated_RefreshRequiredEventRaised() - { - // Given - HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(1.5); - var hydraulicBoundaryLocations = new ObservableList - { - location - }; - - var properties = new DesignWaterLevelLocationsProperties(hydraulicBoundaryLocations); - - var refreshRequiredRaised = 0; - properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; - - // When - location.NotifyObservers(); - - // Then - Assert.AreEqual(1, refreshRequiredRaised); - } - - [Test] - public void GivenPropertyControlWithData_WhenSingleLocationUpdatedAfterDispose_RefreshRequiredEventNotRaised() - { - // Given - HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(1.5); - var hydraulicBoundaryLocations = new ObservableList - { - location - }; - - var properties = new DesignWaterLevelLocationsProperties(hydraulicBoundaryLocations); - - var refreshRequiredRaised = 0; - properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; - - // When - properties.Dispose(); - location.NotifyObservers(); - - // Then - Assert.AreEqual(0, refreshRequiredRaised); - } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsPropertiesTest.cs =================================================================== diff -u -r7fd0c8f65992f3f67a267ad95dff455e93f19236 -rcedf973769c057c935ffce89259027f2ea13c4df --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsPropertiesTest.cs (.../WaveHeightLocationsPropertiesTest.cs) (revision 7fd0c8f65992f3f67a267ad95dff455e93f19236) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsPropertiesTest.cs (.../WaveHeightLocationsPropertiesTest.cs) (revision cedf973769c057c935ffce89259027f2ea13c4df) @@ -19,12 +19,10 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.ComponentModel; using System.Linq; using Core.Common.Base; using Core.Common.Gui.Converters; -using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Hydraulics; @@ -39,17 +37,6 @@ private const int requiredLocationsPropertyIndex = 0; [Test] - public void Constructor_WithoutDatabase_ExpectedValues() - { - // Call - TestDelegate test = () => new WaveHeightLocationsProperties(null); - - // Assert - string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("hydraulicBoundaryLocations", paramName); - } - - [Test] public void Constructor_WithDatabase_ExpectedValues() { // Setup @@ -59,7 +46,7 @@ var properties = new WaveHeightLocationsProperties(hydraulicBoundaryDatabase); // Assert - Assert.IsInstanceOf>>(properties); + Assert.IsInstanceOf(properties); Assert.AreSame(hydraulicBoundaryDatabase, properties.Data); } @@ -110,50 +97,5 @@ "Locaties uit de hydraulische randvoorwaardendatabase.", true); } - - [Test] - public void GivenPropertyControlWithData_WhenSingleLocationUpdated_RefreshRequiredEventRaised() - { - // Given - HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(1.5); - var hydraulicBoundaryLocations = new ObservableList - { - location - }; - - var properties = new WaveHeightLocationsProperties(hydraulicBoundaryLocations); - - var refreshRequiredRaised = 0; - properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; - - // When - location.NotifyObservers(); - - // Then - Assert.AreEqual(1, refreshRequiredRaised); - } - - [Test] - public void GivenPropertyControlWithData_WhenSingleLocationUpdatedAfterDispose_RefreshRequiredEventNotRaised() - { - // Given - HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(1.5); - var hydraulicBoundaryLocations = new ObservableList - { - location - }; - - var properties = new WaveHeightLocationsProperties(hydraulicBoundaryLocations); - - var refreshRequiredRaised = 0; - properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; - - // When - properties.Dispose(); - location.NotifyObservers(); - - // Then - Assert.AreEqual(0, refreshRequiredRaised); - } } } \ No newline at end of file