Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationRow.cs =================================================================== diff -u -r7f4eb38b0c9023e8a66cbce632cd10a16ef9e4bb -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationRow.cs (.../HydraulicBoundaryLocationRow.cs) (revision 7f4eb38b0c9023e8a66cbce632cd10a16ef9e4bb) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationRow.cs (.../HydraulicBoundaryLocationRow.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -64,6 +64,7 @@ set { calculation.InputParameters.ShouldIllustrationPointsBeCalculated = value; + CalculatableObject.NotifyObservers(); } } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationRowTest.cs =================================================================== diff -u -r1ab0201beb5f403186b715a0ed4e30bcf7f78f9a -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationRowTest.cs (.../HydraulicBoundaryLocationRowTest.cs) (revision 1ab0201beb5f403186b715a0ed4e30bcf7f78f9a) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationRowTest.cs (.../HydraulicBoundaryLocationRowTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -20,9 +20,11 @@ // All rights reserved. using System; +using Core.Common.Base; using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; @@ -80,15 +82,23 @@ [Values(true, false)] bool setIllustrationPoints) { // Setup + var mockRepository = new MockRepository(); + var observer = mockRepository.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mockRepository.ReplayAll(); + var calculation = new HydraulicBoundaryLocationCalculation(); var row = new HydraulicBoundaryLocationRow(new TestHydraulicBoundaryLocation(), calculation); + row.CalculatableObject.Attach(observer); // Call row.IncludeIllustrationPoints = setIllustrationPoints; // Assert Assert.AreEqual(setIllustrationPoints, row.IncludeIllustrationPoints); Assert.AreEqual(setIllustrationPoints, calculation.InputParameters.ShouldIllustrationPointsBeCalculated); + + mockRepository.VerifyAll(); } [Test] Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsHydraulicBoundaryLocationContext.cs =================================================================== diff -u -rfcd32c8e949b4581cc20adcaa7cf7639fcb69d20 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsHydraulicBoundaryLocationContext.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationContext.cs) (revision fcd32c8e949b4581cc20adcaa7cf7639fcb69d20) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsHydraulicBoundaryLocationContext.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationContext.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -32,40 +32,40 @@ /// specific . /// public abstract class GrassCoverErosionOutwardsHydraulicBoundaryLocationContext - : ObservableWrappedObjectContextBase> + : ObservableWrappedObjectContextBase { /// /// Creates a new instance of . /// - /// The which the + /// The which the /// belongs to. - /// The - /// which the belongs to. + /// The + /// containing all the hydraulic boundary locations. /// Thrown when any input parameter is null. - protected GrassCoverErosionOutwardsHydraulicBoundaryLocationContext(ObservableList wrappedList, - HydraulicBoundaryLocation hydraulicBoundaryLocation) - : base(wrappedList) + protected GrassCoverErosionOutwardsHydraulicBoundaryLocationContext(ObservableList hydraulicBoundaryLocations, + HydraulicBoundaryLocation wrappedData) + : base(wrappedData) { - if (hydraulicBoundaryLocation == null) + if (hydraulicBoundaryLocations == null) { - throw new ArgumentNullException(nameof(hydraulicBoundaryLocation)); + throw new ArgumentNullException(nameof(hydraulicBoundaryLocations)); } - HydraulicBoundaryLocation = hydraulicBoundaryLocation; + HydraulicBoundaryLocations = hydraulicBoundaryLocations; } /// - /// Gets the . + /// Gets the containing all hydraulic boundary locations. /// - public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; } + public ObservableList HydraulicBoundaryLocations { get; } - public override bool Equals(WrappedObjectContextBase> other) + public override bool Equals(WrappedObjectContextBase other) { - return base.Equals(other) && ReferenceEquals(((GrassCoverErosionOutwardsHydraulicBoundaryLocationContext) other).HydraulicBoundaryLocation, HydraulicBoundaryLocation); + return base.Equals(other) && ReferenceEquals(((GrassCoverErosionOutwardsHydraulicBoundaryLocationContext) other).HydraulicBoundaryLocations, HydraulicBoundaryLocations); } public override int GetHashCode() { - return base.GetHashCode() ^ HydraulicBoundaryLocation.GetHashCode(); + return base.GetHashCode() ^ WrappedData.GetHashCode(); } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs =================================================================== diff -u -r889e8e4ee8267b316e00e8f8a1035c60afb200a0 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs) (revision 889e8e4ee8267b316e00e8f8a1035c60afb200a0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -49,10 +49,10 @@ IdIndex = 1, NameIndex = 2, LocationIndex = 3, - GoverningWindDirectionIndex = 10, - StochastsIndex = 11, - DurationsIndex = 12, - IllustrationPointsIndex = 13 + GoverningWindDirectionIndex = 11, + StochastsIndex = 12, + DurationsIndex = 13, + IllustrationPointsIndex = 14 }) { } [PropertyOrder(4)] @@ -64,7 +64,7 @@ { get { - return data.HydraulicBoundaryLocation.DesignWaterLevel; + return data.WrappedData.DesignWaterLevel; } } @@ -77,7 +77,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.DesignWaterLevelCalculation.Output; return output?.TargetProbability ?? double.NaN; } } @@ -91,7 +91,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.DesignWaterLevelCalculation.Output; return output?.TargetReliability ?? RoundedDouble.NaN; } } @@ -105,7 +105,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.DesignWaterLevelCalculation.Output; return output?.CalculatedProbability ?? double.NaN; } } @@ -119,7 +119,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.DesignWaterLevelCalculation.Output; return output?.CalculatedReliability ?? RoundedDouble.NaN; } } @@ -132,16 +132,33 @@ { get { - return new EnumDisplayWrapper(data.HydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence).DisplayName; + return new EnumDisplayWrapper(data.WrappedData.DesignWaterLevelCalculationConvergence).DisplayName; } } + [PropertyOrder(10)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_IllustrationPoints))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_Description))] + public bool ShouldIllustrationPointsBeCalculated + { + get + { + return data.WrappedData.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated; + } + set + { + data.WrappedData.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated = value; + data.HydraulicBoundaryLocations.NotifyObservers(); + } + } + protected override GeneralResult GetGeneralResult() { - if (data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.HasOutput - && data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output.HasGeneralResult) + if (data.WrappedData.DesignWaterLevelCalculation.HasOutput + && data.WrappedData.DesignWaterLevelCalculation.Output.HasGeneralResult) { - return data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output.GeneralResult; + return data.WrappedData.DesignWaterLevelCalculation.Output.GeneralResult; } return null; } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsHydraulicBoundaryLocationContextProperties.cs =================================================================== diff -u -r5a4e3ce4a8088c1fbb043a029f8081abb4cf1021 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsHydraulicBoundaryLocationContextProperties.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationContextProperties.cs) (revision 5a4e3ce4a8088c1fbb043a029f8081abb4cf1021) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsHydraulicBoundaryLocationContextProperties.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationContextProperties.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -80,7 +80,7 @@ { get { - return data.HydraulicBoundaryLocation.Id; + return data.WrappedData.Id; } } @@ -92,7 +92,7 @@ { get { - return data.HydraulicBoundaryLocation.Name; + return data.WrappedData.Name; } } @@ -104,7 +104,7 @@ { get { - return data.HydraulicBoundaryLocation.Location; + return data.WrappedData.Location; } } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationContextProperties.cs =================================================================== diff -u -r889e8e4ee8267b316e00e8f8a1035c60afb200a0 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationContextProperties.cs (.../GrassCoverErosionOutwardsWaveHeightLocationContextProperties.cs) (revision 889e8e4ee8267b316e00e8f8a1035c60afb200a0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationContextProperties.cs (.../GrassCoverErosionOutwardsWaveHeightLocationContextProperties.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -21,7 +21,6 @@ using System.ComponentModel; using Core.Common.Base.Data; -using Core.Common.Base.Geometry; using Core.Common.Gui.Attributes; using Core.Common.Utils; using Core.Common.Utils.Attributes; @@ -49,11 +48,11 @@ IdIndex = 1, NameIndex = 2, LocationIndex = 3, - GoverningWindDirectionIndex = 10, - StochastsIndex = 11, - DurationsIndex = 12, - IllustrationPointsIndex = 13 - }) { } + GoverningWindDirectionIndex = 11, + StochastsIndex = 12, + DurationsIndex = 13, + IllustrationPointsIndex = 14 + }) {} [PropertyOrder(4)] [TypeConverter(typeof(NoValueRoundedDoubleConverter))] @@ -64,7 +63,7 @@ { get { - return data.HydraulicBoundaryLocation.WaveHeight; + return data.WrappedData.WaveHeight; } } @@ -77,7 +76,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.WaveHeightCalculation.Output; return output?.TargetProbability ?? double.NaN; } } @@ -91,7 +90,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.WaveHeightCalculation.Output; return output?.TargetReliability ?? RoundedDouble.NaN; } } @@ -105,7 +104,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.WaveHeightCalculation.Output; return output?.CalculatedProbability ?? double.NaN; } } @@ -119,7 +118,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.WaveHeightCalculation.Output; return output?.CalculatedReliability ?? RoundedDouble.NaN; } } @@ -132,16 +131,33 @@ { get { - return new EnumDisplayWrapper(data.HydraulicBoundaryLocation.WaveHeightCalculationConvergence).DisplayName; + return new EnumDisplayWrapper(data.WrappedData.WaveHeightCalculationConvergence).DisplayName; } } + [PropertyOrder(10)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_IllustrationPoints))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_Description))] + public bool ShouldIllustrationPointsBeCalculated + { + get + { + return data.WrappedData.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated; + } + set + { + data.WrappedData.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated = value; + data.HydraulicBoundaryLocations.NotifyObservers(); + } + } + protected override GeneralResult GetGeneralResult() { - if (data.HydraulicBoundaryLocation.WaveHeightCalculation.HasOutput - && data.HydraulicBoundaryLocation.WaveHeightCalculation.Output.HasGeneralResult) + if (data.WrappedData.WaveHeightCalculation.HasOutput + && data.WrappedData.WaveHeightCalculation.Output.HasGeneralResult) { - return data.HydraulicBoundaryLocation.WaveHeightCalculation.Output.GeneralResult; + return data.WrappedData.WaveHeightCalculation.Output.GeneralResult; } return null; } Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsDesignWaterLevelLocationContextTest.cs =================================================================== diff -u -rfcd32c8e949b4581cc20adcaa7cf7639fcb69d20 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsDesignWaterLevelLocationContextTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationContextTest.cs) (revision fcd32c8e949b4581cc20adcaa7cf7639fcb69d20) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsDesignWaterLevelLocationContextTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationContextTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -44,7 +44,8 @@ // Assert Assert.IsInstanceOf(presentationObject); - Assert.AreSame(locations, presentationObject.WrappedData); + Assert.AreSame(locations, presentationObject.HydraulicBoundaryLocations); + Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData); } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsHydraulicBoundaryLocationContextTest.cs =================================================================== diff -u -rfcd32c8e949b4581cc20adcaa7cf7639fcb69d20 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsHydraulicBoundaryLocationContextTest.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationContextTest.cs) (revision fcd32c8e949b4581cc20adcaa7cf7639fcb69d20) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsHydraulicBoundaryLocationContextTest.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationContextTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -42,10 +42,24 @@ // Assert string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("hydraulicBoundaryLocation", paramName); + Assert.AreEqual("wrappedData", paramName); } [Test] + public void Constructor_NullHydraulicBoundaryDatabase_ThrowsArgumentNullException() + { + // Setup + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2.0, 3.0); + + // Call + TestDelegate test = () => new TestGrassCoverErosionOutwardsLocationContext(null, hydraulicBoundaryLocation); + + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("hydraulicBoundaryLocations", paramName); + } + + [Test] public void Constructor_ValidParameters_ExpectedValues() { // Setup @@ -59,9 +73,9 @@ var presentationObject = new TestGrassCoverErosionOutwardsLocationContext(locations, hydraulicBoundaryLocation); // Assert - Assert.IsInstanceOf>>(presentationObject); - Assert.AreSame(locations, presentationObject.WrappedData); - Assert.AreSame(hydraulicBoundaryLocation, presentationObject.HydraulicBoundaryLocation); + Assert.IsInstanceOf>(presentationObject); + Assert.AreSame(locations, presentationObject.HydraulicBoundaryLocations); + Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData); } [Test] Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsWaveHeightLocationContextTest.cs =================================================================== diff -u -rfcd32c8e949b4581cc20adcaa7cf7639fcb69d20 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsWaveHeightLocationContextTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationContextTest.cs) (revision fcd32c8e949b4581cc20adcaa7cf7639fcb69d20) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsWaveHeightLocationContextTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationContextTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -44,7 +44,8 @@ // Assert Assert.IsInstanceOf(presentationObject); - Assert.AreSame(locations, presentationObject.WrappedData); + Assert.AreSame(locations, presentationObject.HydraulicBoundaryLocations); + Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData); } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextPropertiesTest.cs =================================================================== diff -u -rb28a844780b613e1901fa82328ba3917f485c729 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextPropertiesTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationContextPropertiesTest.cs) (revision b28a844780b613e1901fa82328ba3917f485c729) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextPropertiesTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationContextPropertiesTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -27,6 +27,7 @@ using Core.Common.TestUtil; using Core.Common.Utils; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Data.TestUtil; @@ -49,6 +50,7 @@ private const int calculatedProbabilityPropertyIndex = 6; private const int calculatedReliabilityPropertyIndex = 7; private const int convergencePropertyIndex = 8; + private const int shouldCalculateIllustrationPointsIndex = 9; [Test] public void Constructor_ExpectedValues() @@ -96,6 +98,7 @@ TestHelper.AssertTypeConverter( nameof(GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.CalculatedReliability)); Assert.IsEmpty(properties.Convergence); + Assert.AreEqual(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated, properties.ShouldIllustrationPointsBeCalculated); } [Test] @@ -127,9 +130,10 @@ }; const string governingWindDirection = "EAST"; GeneralResult generalResult = - withIllustrationPoints ? new GeneralResult(new WindDirection(governingWindDirection, 2), - stochasts, - illustrationPoints) + withIllustrationPoints + ? new GeneralResult(new WindDirection(governingWindDirection, 2), + stochasts, + illustrationPoints) : null; var hydraulicBoundaryLocationOutput = new HydraulicBoundaryLocationOutput(designWaterLevel, @@ -205,70 +209,113 @@ Assert.IsInstanceOf(classTypeConverter); PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(9, dynamicProperties.Count); + Assert.AreEqual(10, dynamicProperties.Count); + const string generalCategory = "Algemeen"; + const string resultCategory = "Resultaat"; + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, - "Algemeen", + generalCategory, "ID", "ID van de hydraulische randvoorwaardenlocatie in de database.", true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, - "Algemeen", + generalCategory, "Naam", "Naam van de hydraulische randvoorwaardenlocatie.", true); PropertyDescriptor coordinatesProperty = dynamicProperties[coordinatesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(coordinatesProperty, - "Algemeen", + generalCategory, "Coördinaten [m]", "Coördinaten van de hydraulische randvoorwaardenlocatie.", true); PropertyDescriptor designWaterLevelProperty = dynamicProperties[designWaterLevelPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(designWaterLevelProperty, - "Resultaat", + resultCategory, "Waterstand bij doorsnede-eis [m+NAP]", "Berekende waterstand bij doorsnede-eis.", true); PropertyDescriptor targetProbabilityProperty = dynamicProperties[targetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbabilityProperty, - "Resultaat", + resultCategory, "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor targetReliabilityProperty = dynamicProperties[targetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliabilityProperty, - "Resultaat", + resultCategory, "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor calculatedProbabilityProperty = dynamicProperties[calculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbabilityProperty, - "Resultaat", + resultCategory, "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculatedReliabilityProperty = dynamicProperties[calculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliabilityProperty, - "Resultaat", + resultCategory, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor convergenceProperty = dynamicProperties[convergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(convergenceProperty, - "Resultaat", + resultCategory, "Convergentie", "Is convergentie bereikt in de berekening van de waterstand bij doorsnede-eis?", true); + + PropertyDescriptor calculateIllustrationPointsProperty = dynamicProperties[shouldCalculateIllustrationPointsIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculateIllustrationPointsProperty, + "Illustratiepunten", + "Illustratiepunten inlezen", + "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); } + + [Test] + public void ShouldIllustrationPointsBeCalculated_SetNewValue_NotifyObservers() + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + HydraulicBoundaryLocation hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + + var locations = new ObservableList + { + hydraulicBoundaryLocation + }; + + locations.Attach(observer); + + var properties = new GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties + { + Data = new GrassCoverErosionOutwardsDesignWaterLevelLocationContext(locations, hydraulicBoundaryLocation) + }; + + // Precondition + Assert.IsFalse(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated); + + // Call + properties.ShouldIllustrationPointsBeCalculated = true; + + // Assert + Assert.IsTrue(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated); + mocks.VerifyAll(); + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationContextPropertiesTest.cs =================================================================== diff -u -rd25204b5728226909d03e56e21a954d4980c45c7 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationContextPropertiesTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationContextPropertiesTest.cs) (revision d25204b5728226909d03e56e21a954d4980c45c7) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationContextPropertiesTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationContextPropertiesTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -27,6 +27,7 @@ using Core.Common.TestUtil; using Core.Common.Utils; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Data.TestUtil; @@ -49,6 +50,7 @@ private const int calculatedProbabilityPropertyIndex = 6; private const int calculatedReliabilityPropertyIndex = 7; private const int convergencePropertyIndex = 8; + private const int shouldCalculateIllustrationPointsIndex = 9; [Test] public void Constructor_ExpectedValues() @@ -96,6 +98,7 @@ TestHelper.AssertTypeConverter( nameof(GrassCoverErosionOutwardsWaveHeightLocationContextProperties.CalculatedReliability)); Assert.IsEmpty(properties.Convergence); + Assert.AreEqual(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated, properties.ShouldIllustrationPointsBeCalculated); } [Test] @@ -117,7 +120,6 @@ double waveHeight = random.NextDouble(); var convergence = random.NextEnumValue(); - var illustrationPoints = new[] { new TopLevelSubMechanismIllustrationPoint(new WindDirection("WEST", 4), "sluit", new TestSubMechanismIllustrationPoint()) @@ -128,9 +130,10 @@ }; const string governingWindDirection = "EAST"; GeneralResult generalResult = - withIllustrationPoints ? new GeneralResult(new WindDirection(governingWindDirection, 2), - stochasts, - illustrationPoints) + withIllustrationPoints + ? new GeneralResult(new WindDirection(governingWindDirection, 2), + stochasts, + illustrationPoints) : null; var hydraulicBoundaryLocationOutput = new HydraulicBoundaryLocationOutput(waveHeight, @@ -204,71 +207,113 @@ TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true); PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(9, dynamicProperties.Count); + Assert.AreEqual(10, dynamicProperties.Count); Assert.IsInstanceOf(classTypeConverter); + const string generalCategory = "Algemeen"; + const string resultCategory = "Resultaat"; + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, - "Algemeen", + generalCategory, "ID", "ID van de hydraulische randvoorwaardenlocatie in de database.", true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, - "Algemeen", + generalCategory, "Naam", "Naam van de hydraulische randvoorwaardenlocatie.", true); PropertyDescriptor coordinatesProperty = dynamicProperties[coordinatesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(coordinatesProperty, - "Algemeen", + generalCategory, "Coördinaten [m]", "Coördinaten van de hydraulische randvoorwaardenlocatie.", true); PropertyDescriptor waveHeightProperty = dynamicProperties[waveHeightPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveHeightProperty, - "Resultaat", + resultCategory, "Golfhoogte bij doorsnede-eis [m]", "Berekende golfhoogte bij doorsnede-eis.", true); PropertyDescriptor targetProbabilityProperty = dynamicProperties[targetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbabilityProperty, - "Resultaat", + resultCategory, "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor targetReliabilityProperty = dynamicProperties[targetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliabilityProperty, - "Resultaat", + resultCategory, "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor calculatedProbabilityProperty = dynamicProperties[calculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbabilityProperty, - "Resultaat", + resultCategory, "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculatedReliabilityProperty = dynamicProperties[calculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliabilityProperty, - "Resultaat", + resultCategory, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor convergenceProperty = dynamicProperties[convergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(convergenceProperty, - "Resultaat", + resultCategory, "Convergentie", "Is convergentie bereikt in de berekening van de golfhoogte bij doorsnede-eis?", true); + + PropertyDescriptor calculateIllustrationPointsProperty = dynamicProperties[shouldCalculateIllustrationPointsIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculateIllustrationPointsProperty, + "Illustratiepunten", + "Illustratiepunten inlezen", + "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); } + + [Test] + public void ShouldIllustrationPointsBeCalculated_SetNewValue_NotifyObservers() + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + HydraulicBoundaryLocation hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + var locations = new ObservableList + { + hydraulicBoundaryLocation + }; + + locations.Attach(observer); + + var properties = new GrassCoverErosionOutwardsWaveHeightLocationContextProperties + { + Data = new GrassCoverErosionOutwardsWaveHeightLocationContext(locations, hydraulicBoundaryLocation) + }; + + // Precondition + Assert.IsFalse(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated); + + // Call + properties.ShouldIllustrationPointsBeCalculated = true; + + // Assert + Assert.IsTrue(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated); + mocks.VerifyAll(); + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/HydraulicBoundaryLocationContext.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/HydraulicBoundaryLocationContext.cs (.../HydraulicBoundaryLocationContext.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/HydraulicBoundaryLocationContext.cs (.../HydraulicBoundaryLocationContext.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -28,39 +28,39 @@ /// /// Presentation object for all data required to configure an instance of . /// - public abstract class HydraulicBoundaryLocationContext : ObservableWrappedObjectContextBase + public abstract class HydraulicBoundaryLocationContext : ObservableWrappedObjectContextBase { /// /// Creates a new instance of . /// - /// The which the - /// belongs to. - /// The + /// The /// which the belongs to. + /// The + /// which the belongs to. /// Thrown when any input parameter is null. - protected HydraulicBoundaryLocationContext(HydraulicBoundaryDatabase wrappedData, - HydraulicBoundaryLocation hydraulicBoundaryLocation) : base(wrappedData) + protected HydraulicBoundaryLocationContext(HydraulicBoundaryDatabase hydraulicBoundaryDatabase, + HydraulicBoundaryLocation wrappedData) : base(wrappedData) { - if (hydraulicBoundaryLocation == null) + if (hydraulicBoundaryDatabase == null) { - throw new ArgumentNullException(nameof(hydraulicBoundaryLocation)); + throw new ArgumentNullException(nameof(hydraulicBoundaryDatabase)); } - HydraulicBoundaryLocation = hydraulicBoundaryLocation; + HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; } /// - /// Gets the . + /// Gets the . /// - public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; } + public HydraulicBoundaryDatabase HydraulicBoundaryDatabase { get; } - public override bool Equals(WrappedObjectContextBase other) + public override bool Equals(WrappedObjectContextBase other) { - return base.Equals(other) && ReferenceEquals(((HydraulicBoundaryLocationContext) other).HydraulicBoundaryLocation, HydraulicBoundaryLocation); + return base.Equals(other) && ReferenceEquals(((HydraulicBoundaryLocationContext) other).HydraulicBoundaryDatabase, HydraulicBoundaryDatabase); } public override int GetHashCode() { - return base.GetHashCode() ^ HydraulicBoundaryLocation.GetHashCode(); + return base.GetHashCode() ^ WrappedData.GetHashCode(); } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationContextProperties.cs =================================================================== diff -u -r889e8e4ee8267b316e00e8f8a1035c60afb200a0 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationContextProperties.cs (.../DesignWaterLevelLocationContextProperties.cs) (revision 889e8e4ee8267b316e00e8f8a1035c60afb200a0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationContextProperties.cs (.../DesignWaterLevelLocationContextProperties.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -46,10 +46,10 @@ IdIndex = 1, NameIndex = 2, LocationIndex = 3, - GoverningWindDirectionIndex = 10, - StochastsIndex = 11, - DurationsIndex = 12, - IllustrationPointsIndex = 13 + GoverningWindDirectionIndex = 11, + StochastsIndex = 12, + DurationsIndex = 13, + IllustrationPointsIndex = 14 }) {} [PropertyOrder(4)] @@ -61,7 +61,7 @@ { get { - return data.HydraulicBoundaryLocation.DesignWaterLevel; + return data.WrappedData.DesignWaterLevel; } } @@ -74,7 +74,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.DesignWaterLevelCalculation.Output; return output?.TargetProbability ?? double.NaN; } } @@ -88,7 +88,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.DesignWaterLevelCalculation.Output; return output?.TargetReliability ?? RoundedDouble.NaN; } } @@ -102,7 +102,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.DesignWaterLevelCalculation.Output; return output?.CalculatedProbability ?? double.NaN; } } @@ -116,7 +116,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.DesignWaterLevelCalculation.Output; return output?.CalculatedReliability ?? RoundedDouble.NaN; } } @@ -129,16 +129,33 @@ { get { - return new EnumDisplayWrapper(data.HydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence).DisplayName; + return new EnumDisplayWrapper(data.WrappedData.DesignWaterLevelCalculationConvergence).DisplayName; } } + [PropertyOrder(10)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_IllustrationPoints))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_Description))] + public bool ShouldIllustrationPointsBeCalculated + { + get + { + return data.WrappedData.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated; + } + set + { + data.WrappedData.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated = value; + data.HydraulicBoundaryDatabase.NotifyObservers(); + } + } + protected override GeneralResult GetGeneralResult() { - if (data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.HasOutput - && data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output.HasGeneralResult) + if (data.WrappedData.DesignWaterLevelCalculation.HasOutput + && data.WrappedData.DesignWaterLevelCalculation.Output.HasGeneralResult) { - return data.HydraulicBoundaryLocation.DesignWaterLevelCalculation.Output.GeneralResult; + return data.WrappedData.DesignWaterLevelCalculation.Output.GeneralResult; } return null; } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs =================================================================== diff -u -r2eab6260ad63e806b10647d64792294139dc2157 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs (.../HydraulicBoundaryLocationProperties.cs) (revision 2eab6260ad63e806b10647d64792294139dc2157) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs (.../HydraulicBoundaryLocationProperties.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -79,7 +79,7 @@ { get { - return data.HydraulicBoundaryLocation.Id; + return data.WrappedData.Id; } } @@ -91,7 +91,7 @@ { get { - return data.HydraulicBoundaryLocation.Name; + return data.WrappedData.Name; } } @@ -103,7 +103,7 @@ { get { - return data.HydraulicBoundaryLocation.Location; + return data.WrappedData.Location; } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationContextProperties.cs =================================================================== diff -u -r889e8e4ee8267b316e00e8f8a1035c60afb200a0 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationContextProperties.cs (.../WaveHeightLocationContextProperties.cs) (revision 889e8e4ee8267b316e00e8f8a1035c60afb200a0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationContextProperties.cs (.../WaveHeightLocationContextProperties.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -21,7 +21,6 @@ using System.ComponentModel; using Core.Common.Base.Data; -using Core.Common.Base.Geometry; using Core.Common.Gui.Attributes; using Core.Common.Utils; using Core.Common.Utils.Attributes; @@ -47,11 +46,11 @@ IdIndex = 1, NameIndex = 2, LocationIndex = 3, - GoverningWindDirectionIndex = 10, - StochastsIndex = 11, - DurationsIndex = 12, - IllustrationPointsIndex = 13 - }) { } + GoverningWindDirectionIndex = 11, + StochastsIndex = 12, + DurationsIndex = 13, + IllustrationPointsIndex = 14 + }) {} [PropertyOrder(4)] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] @@ -62,7 +61,7 @@ { get { - return data.HydraulicBoundaryLocation.WaveHeight; + return data.WrappedData.WaveHeight; } } @@ -75,7 +74,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.WaveHeightCalculation.Output; return output?.TargetProbability ?? double.NaN; } } @@ -89,7 +88,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.WaveHeightCalculation.Output; return output?.TargetReliability ?? RoundedDouble.NaN; } } @@ -103,7 +102,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.WaveHeightCalculation.Output; return output?.CalculatedProbability ?? double.NaN; } } @@ -117,7 +116,7 @@ { get { - HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightCalculation.Output; + HydraulicBoundaryLocationOutput output = data.WrappedData.WaveHeightCalculation.Output; return output?.CalculatedReliability ?? RoundedDouble.NaN; } } @@ -130,16 +129,33 @@ { get { - return new EnumDisplayWrapper(data.HydraulicBoundaryLocation.WaveHeightCalculationConvergence).DisplayName; + return new EnumDisplayWrapper(data.WrappedData.WaveHeightCalculationConvergence).DisplayName; } } + [PropertyOrder(10)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_IllustrationPoints))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_Description))] + public bool ShouldIllustrationPointsBeCalculated + { + get + { + return data.WrappedData.WaveHeightCalculation.InputParameters.ShouldIllustrationPointsBeCalculated; + } + set + { + data.WrappedData.WaveHeightCalculation.InputParameters.ShouldIllustrationPointsBeCalculated = value; + data.HydraulicBoundaryDatabase.NotifyObservers(); + } + } + protected override GeneralResult GetGeneralResult() { - if (data.HydraulicBoundaryLocation.WaveHeightCalculation.HasOutput - && data.HydraulicBoundaryLocation.WaveHeightCalculation.Output.HasGeneralResult) + if (data.WrappedData.WaveHeightCalculation.HasOutput + && data.WrappedData.WaveHeightCalculation.Output.HasGeneralResult) { - return data.HydraulicBoundaryLocation.WaveHeightCalculation.Output.GeneralResult; + return data.WrappedData.WaveHeightCalculation.Output.GeneralResult; } return null; } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs (.../DesignWaterLevelLocationContextTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs (.../DesignWaterLevelLocationContextTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -40,7 +40,7 @@ // Assert string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("hydraulicBoundaryLocation", paramName); + Assert.AreEqual("wrappedData", paramName); } [Test] @@ -54,7 +54,7 @@ // Assert string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("wrappedData", paramName); + Assert.AreEqual("hydraulicBoundaryDatabase", paramName); } [Test] @@ -70,8 +70,8 @@ // Assert Assert.IsInstanceOf(presentationObject); - Assert.AreSame(hydraulicBoundaryDatabase, presentationObject.WrappedData); - Assert.AreSame(hydraulicBoundaryLocation, presentationObject.HydraulicBoundaryLocation); + Assert.AreSame(hydraulicBoundaryDatabase, presentationObject.HydraulicBoundaryDatabase); + Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryLocationContextTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryLocationContextTest.cs (.../HydraulicBoundaryLocationContextTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryLocationContextTest.cs (.../HydraulicBoundaryLocationContextTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -41,7 +41,7 @@ // Assert string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("hydraulicBoundaryLocation", paramName); + Assert.AreEqual("wrappedData", paramName); } [Test] @@ -55,7 +55,7 @@ // Assert string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("wrappedData", paramName); + Assert.AreEqual("hydraulicBoundaryDatabase", paramName); } [Test] @@ -69,9 +69,9 @@ var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryDatabase, hydraulicBoundaryLocation); // Assert - Assert.IsInstanceOf>(context); - Assert.AreSame(hydraulicBoundaryDatabase, context.WrappedData); - Assert.AreSame(hydraulicBoundaryLocation, context.HydraulicBoundaryLocation); + Assert.IsInstanceOf>(context); + Assert.AreSame(hydraulicBoundaryDatabase, context.HydraulicBoundaryDatabase); + Assert.AreSame(hydraulicBoundaryLocation, context.WrappedData); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs (.../WaveHeightLocationContextTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs (.../WaveHeightLocationContextTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -40,7 +40,7 @@ // Assert string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("hydraulicBoundaryLocation", paramName); + Assert.AreEqual("wrappedData", paramName); } [Test] @@ -54,7 +54,7 @@ // Assert string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("wrappedData", paramName); + Assert.AreEqual("hydraulicBoundaryDatabase", paramName); } [Test] @@ -70,8 +70,8 @@ // Assert Assert.IsInstanceOf(presentationObject); - Assert.AreSame(hydraulicBoundaryDatabase, presentationObject.WrappedData); - Assert.AreSame(hydraulicBoundaryLocation, presentationObject.HydraulicBoundaryLocation); + Assert.AreSame(hydraulicBoundaryDatabase, presentationObject.HydraulicBoundaryDatabase); + Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationContextPropertiesTest.cs =================================================================== diff -u -rd25204b5728226909d03e56e21a954d4980c45c7 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationContextPropertiesTest.cs (.../DesignWaterLevelLocationContextPropertiesTest.cs) (revision d25204b5728226909d03e56e21a954d4980c45c7) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationContextPropertiesTest.cs (.../DesignWaterLevelLocationContextPropertiesTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -22,10 +22,12 @@ using System; using System.ComponentModel; using System.Linq; +using Core.Common.Base; using Core.Common.Base.Geometry; using Core.Common.TestUtil; using Core.Common.Utils; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Data.TestUtil; @@ -48,6 +50,7 @@ private const int calculatedProbabilityPropertyIndex = 6; private const int calculatedReliabilityPropertyIndex = 7; private const int convergencePropertyIndex = 8; + private const int shouldCalculateIllustrationPointsIndex = 9; [Test] public void Constructor_ExpectedValues() @@ -99,6 +102,7 @@ TestHelper.AssertTypeConverter( nameof(DesignWaterLevelLocationContextProperties.CalculatedReliability)); Assert.IsEmpty(properties.Convergence); + Assert.AreEqual(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated, properties.ShouldIllustrationPointsBeCalculated); } [Test] @@ -120,7 +124,6 @@ double designWaterLevel = random.NextDouble(); var convergence = random.NextEnumValue(); - var illustrationPoints = new[] { new TopLevelSubMechanismIllustrationPoint(new WindDirection("WEST", 4), "sluit", new TestSubMechanismIllustrationPoint()) @@ -131,9 +134,10 @@ }; const string governingWindDirection = "EAST"; GeneralResult generalResult = - withIllustrationPoints ? new GeneralResult(new WindDirection(governingWindDirection, 2), - stochasts, - illustrationPoints) + withIllustrationPoints + ? new GeneralResult(new WindDirection(governingWindDirection, 2), + stochasts, + illustrationPoints) : null; var hydraulicBoundaryLocationOutput = new HydraulicBoundaryLocationOutput(designWaterLevel, @@ -214,70 +218,115 @@ Assert.IsInstanceOf(classTypeConverter); PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(9, dynamicProperties.Count); + Assert.AreEqual(10, dynamicProperties.Count); + const string generalCategory = "Algemeen"; + const string resultCategory = "Resultaat"; + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, - "Algemeen", + generalCategory, "ID", "ID van de hydraulische randvoorwaardenlocatie in de database.", true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, - "Algemeen", + generalCategory, "Naam", "Naam van de hydraulische randvoorwaardenlocatie.", true); PropertyDescriptor coordinatesProperty = dynamicProperties[coordinatesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(coordinatesProperty, - "Algemeen", + generalCategory, "Coördinaten [m]", "Coördinaten van de hydraulische randvoorwaardenlocatie.", true); PropertyDescriptor designWaterLevelProperty = dynamicProperties[designWaterLevelPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(designWaterLevelProperty, - "Resultaat", + resultCategory, "Toetspeil [m+NAP]", "Berekend toetspeil.", true); PropertyDescriptor targetProbabilityProperty = dynamicProperties[targetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbabilityProperty, - "Resultaat", + resultCategory, "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor targetReliabilityProperty = dynamicProperties[targetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliabilityProperty, - "Resultaat", + resultCategory, "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor calculatedProbabilityProperty = dynamicProperties[calculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbabilityProperty, - "Resultaat", + resultCategory, "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculatedReliabilityProperty = dynamicProperties[calculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliabilityProperty, - "Resultaat", + resultCategory, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor convergenceProperty = dynamicProperties[convergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(convergenceProperty, - "Resultaat", + resultCategory, "Convergentie", "Is convergentie bereikt in de toetspeil berekening?", true); + + PropertyDescriptor calculateIllustrationPointsProperty = dynamicProperties[shouldCalculateIllustrationPointsIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculateIllustrationPointsProperty, + "Illustratiepunten", + "Illustratiepunten inlezen", + "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); } + + [Test] + public void ShouldIllustrationPointsBeCalculated_SetNewValue_NotifyObservers() + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + HydraulicBoundaryLocation hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + { + Locations = + { + hydraulicBoundaryLocation + } + }; + + hydraulicBoundaryDatabase.Attach(observer); + + var properties = new DesignWaterLevelLocationContextProperties + { + Data = new DesignWaterLevelLocationContext(hydraulicBoundaryDatabase, hydraulicBoundaryLocation) + }; + + // Precondition + Assert.IsFalse(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated); + + // Call + properties.ShouldIllustrationPointsBeCalculated = true; + + // Assert + Assert.IsTrue(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated); + mocks.VerifyAll(); + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationContextPropertiesTest.cs =================================================================== diff -u -rd25204b5728226909d03e56e21a954d4980c45c7 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationContextPropertiesTest.cs (.../WaveHeightLocationContextPropertiesTest.cs) (revision d25204b5728226909d03e56e21a954d4980c45c7) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationContextPropertiesTest.cs (.../WaveHeightLocationContextPropertiesTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -22,9 +22,11 @@ using System; using System.ComponentModel; using System.Linq; +using Core.Common.Base; using Core.Common.TestUtil; using Core.Common.Utils; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Data.TestUtil; @@ -47,6 +49,7 @@ private const int calculatedProbabilityPropertyIndex = 6; private const int calculatedReliabilityPropertyIndex = 7; private const int convergencePropertyIndex = 8; + private const int shouldCalculateIllustrationPointsIndex = 9; [Test] public void Constructor_ExpectedValues() @@ -103,6 +106,7 @@ NoValueRoundedDoubleConverter>( nameof(WaveHeightLocationContextProperties.CalculatedReliability)); Assert.IsEmpty(properties.Convergence); + Assert.AreEqual(hydraulicBoundaryLocation.WaveHeightCalculation.InputParameters.ShouldIllustrationPointsBeCalculated, properties.ShouldIllustrationPointsBeCalculated); } [Test] @@ -134,9 +138,10 @@ }; const string governingWindDirection = "EAST"; GeneralResult generalResult = - withIllustrationPoints ? new GeneralResult(new WindDirection(governingWindDirection, 2), - stochasts, - illustrationPoints) + withIllustrationPoints + ? new GeneralResult(new WindDirection(governingWindDirection, 2), + stochasts, + illustrationPoints) : null; var hydraulicBoundaryLocationOutput = new HydraulicBoundaryLocationOutput(waveHeight, @@ -216,70 +221,115 @@ Assert.IsInstanceOf(classTypeConverter); PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(9, dynamicProperties.Count); + Assert.AreEqual(10, dynamicProperties.Count); + const string generalCategory = "Algemeen"; + const string resultCategory = "Resultaat"; + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, - "Algemeen", + generalCategory, "ID", "ID van de hydraulische randvoorwaardenlocatie in de database.", true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, - "Algemeen", + generalCategory, "Naam", "Naam van de hydraulische randvoorwaardenlocatie.", true); PropertyDescriptor coordinatesProperty = dynamicProperties[coordinatesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(coordinatesProperty, - "Algemeen", + generalCategory, "Coördinaten [m]", "Coördinaten van de hydraulische randvoorwaardenlocatie.", true); PropertyDescriptor waveHeightProperty = dynamicProperties[waveHeightPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveHeightProperty, - "Resultaat", + resultCategory, "Hs [m]", "Berekende golfhoogte.", true); PropertyDescriptor targetProbabilityProperty = dynamicProperties[targetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbabilityProperty, - "Resultaat", + resultCategory, "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor targetReliabilityProperty = dynamicProperties[targetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliabilityProperty, - "Resultaat", + resultCategory, "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor calculatedProbabilityProperty = dynamicProperties[calculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbabilityProperty, - "Resultaat", + resultCategory, "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculatedReliabilityProperty = dynamicProperties[calculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliabilityProperty, - "Resultaat", + resultCategory, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor convergenceProperty = dynamicProperties[convergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(convergenceProperty, - "Resultaat", + resultCategory, "Convergentie", "Is convergentie bereikt in de golfhoogte berekening?", true); + + PropertyDescriptor calculateIllustrationPointsProperty = dynamicProperties[shouldCalculateIllustrationPointsIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculateIllustrationPointsProperty, + "Illustratiepunten", + "Illustratiepunten inlezen", + "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); } + + [Test] + public void ShouldIllustrationPointsBeCalculated_SetNewValue_NotifyObservers() + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + HydraulicBoundaryLocation hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + { + Locations = + { + hydraulicBoundaryLocation + } + }; + + hydraulicBoundaryDatabase.Attach(observer); + + var properties = new WaveHeightLocationContextProperties + { + Data = new WaveHeightLocationContext(hydraulicBoundaryDatabase, hydraulicBoundaryLocation) + }; + + // Precondition + Assert.IsFalse(hydraulicBoundaryLocation.WaveHeightCalculation.InputParameters.ShouldIllustrationPointsBeCalculated); + + // Call + properties.ShouldIllustrationPointsBeCalculated = true; + + // Assert + Assert.IsTrue(hydraulicBoundaryLocation.WaveHeightCalculation.InputParameters.ShouldIllustrationPointsBeCalculated); + mocks.VerifyAll(); + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs =================================================================== diff -u -r1f0cd3fafaa7340a446612870810629587474302 -rfaea7b000850729e2b0c6c2a06fe3a7e94541abd --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs (.../HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs) (revision 1f0cd3fafaa7340a446612870810629587474302) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs (.../HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs) (revision faea7b000850729e2b0c6c2a06fe3a7e94541abd) @@ -46,7 +46,6 @@ using Ringtoets.Integration.Forms.PresentationObjects; using Ringtoets.Piping.Data; using Ringtoets.Piping.Data.TestUtil; -using Ringtoets.Piping.KernelWrapper.TestUtil; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Integration.Plugin.Test.TreeNodeInfos @@ -61,11 +60,6 @@ private readonly string testDataPathNoSettings = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Forms, "HydraulicBoundaryDatabaseNoSettings"); private readonly string testDataPathInvalidSettings = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Forms, "HydraulicBoundaryDatabaseSettingsInvalid"); - public override void Setup() - { - mocks = new MockRepository(); - } - [Test] public void Initialized_Always_ExpectedPropertiesSet() { @@ -611,6 +605,11 @@ mocks.VerifyAll(); } + public override void Setup() + { + mocks = new MockRepository(); + } + private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin) { return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(HydraulicBoundaryDatabaseContext));