Index: Ringtoets/Common/src/Ringtoets.Common.Service/RingtoetsCommonDataSynchronizationService.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r87aafc58782eb7ce49b1e06b1db2feda8cd85948 --- Ringtoets/Common/src/Ringtoets.Common.Service/RingtoetsCommonDataSynchronizationService.cs (.../RingtoetsCommonDataSynchronizationService.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/Common/src/Ringtoets.Common.Service/RingtoetsCommonDataSynchronizationService.cs (.../RingtoetsCommonDataSynchronizationService.cs) (revision 87aafc58782eb7ce49b1e06b1db2feda8cd85948) @@ -24,7 +24,6 @@ using System.Collections.ObjectModel; using System.Linq; using Core.Common.Base; -using Core.Common.Base.Data; using Ringtoets.Common.Data; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.DikeProfiles; @@ -102,13 +101,10 @@ private static IEnumerable ClearHydraulicBoundaryLocationOutput(HydraulicBoundaryLocation location) { - if (!double.IsNaN(location.DesignWaterLevel) || - !double.IsNaN(location.WaveHeight)) + if (location.DesignWaterLevelOutput != null || location.WaveHeightOutput != null) { - location.DesignWaterLevel = RoundedDouble.NaN; - location.WaveHeight = RoundedDouble.NaN; - location.DesignWaterLevelCalculationConvergence = CalculationConvergence.NotCalculated; - location.WaveHeightCalculationConvergence = CalculationConvergence.NotCalculated; + location.DesignWaterLevelOutput = null; + location.WaveHeightOutput = null; return new[] { Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/RingtoetsCommonDataSynchronizationServicesTest.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r87aafc58782eb7ce49b1e06b1db2feda8cd85948 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/RingtoetsCommonDataSynchronizationServicesTest.cs (.../RingtoetsCommonDataSynchronizationServicesTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/RingtoetsCommonDataSynchronizationServicesTest.cs (.../RingtoetsCommonDataSynchronizationServicesTest.cs) (revision 87aafc58782eb7ce49b1e06b1db2feda8cd85948) @@ -22,7 +22,6 @@ using System; using System.Collections.Generic; using Core.Common.Base; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data; @@ -49,18 +48,12 @@ } [Test] - [TestCase(3.4, 5.3)] - [TestCase(3.4, double.NaN)] - [TestCase(double.NaN, 8.5)] - public void ClearHydraulicBoundaryLocationOutput_LocationWithData_ClearsDataAndReturnsTrue(double designWaterLevel, double waveHeight) + public void ClearHydraulicBoundaryLocationOutput_LocationWithData_ClearsDataAndReturnsAffectedObjects( + [Values(3.4, double.NaN)] double designWaterLevel, + [Values(5.3, double.NaN)] double waveHeight) { // Setup - var location = new HydraulicBoundaryLocation(1, string.Empty, 0, 0) - { - DesignWaterLevel = (RoundedDouble) designWaterLevel, - WaveHeight = (RoundedDouble) waveHeight - }; - + HydraulicBoundaryLocation location = new TestHydraulicBoundaryLocation(designWaterLevel, waveHeight); var locations = new ObservableList { location @@ -70,6 +63,8 @@ IEnumerable affectedObjects = RingtoetsCommonDataSynchronizationService.ClearHydraulicBoundaryLocationOutput(locations); // Assert + Assert.IsNull(location.DesignWaterLevelOutput); + Assert.IsNull(location.WaveHeightOutput); Assert.IsNaN(location.DesignWaterLevel); Assert.IsNaN(location.WaveHeight); Assert.AreEqual(CalculationConvergence.NotCalculated, location.DesignWaterLevelCalculationConvergence); @@ -82,7 +77,7 @@ } [Test] - public void ClearHydraulicBoundaryLocationOutput_HydraulicBoundaryDatabaseWithoutLocations_ReturnsFalse() + public void ClearHydraulicBoundaryLocationOutput_HydraulicBoundaryDatabaseWithoutLocations_ReturnsNoAffectedObjects() { // Setup var locations = new ObservableList(); @@ -95,7 +90,7 @@ } [Test] - public void ClearHydraulicBoundaryLocationOutput_LocationWithoutWaveHeightAndDesignWaterLevel_ReturnsFalse() + public void ClearHydraulicBoundaryLocationOutput_LocationWithoutWaveHeightAndDesignWaterLevel_ReturnsNoAffectedObjects() { // Setup var locations = new ObservableList @@ -167,7 +162,7 @@ public void ClearForeshoreProfile_CalculationsWithForeshoreProfile_ClearForeshoreProfileAndReturnAffectedInputs() { // Setup - var foreshoreProfileToBeRemoved = new TestForeshoreProfile(new Point2D(0,0)); + var foreshoreProfileToBeRemoved = new TestForeshoreProfile(new Point2D(0, 0)); var foreshoreProfile = new TestForeshoreProfile(new Point2D(1, 1)); var calculation1 = new StructuresCalculation @@ -224,10 +219,7 @@ private class SimpleStructuresInput : StructuresInputBase { - protected override void UpdateStructureParameters() - { - - } + protected override void UpdateStructureParameters() {} } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextPropertiesTest.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r87aafc58782eb7ce49b1e06b1db2feda8cd85948 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextPropertiesTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsContextPropertiesTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextPropertiesTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsContextPropertiesTest.cs) (revision 87aafc58782eb7ce49b1e06b1db2feda8cd85948) @@ -21,7 +21,6 @@ using System.ComponentModel; using Core.Common.Base; -using Core.Common.Base.Data; using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; using NUnit.Framework; @@ -49,11 +48,8 @@ public void GetProperties_WithData_ReturnExpectedValues() { // Setup - RoundedDouble designWaterLevel = (RoundedDouble) 12.34; - var location = new HydraulicBoundaryLocation(1, "name", 1.0, 2.0) - { - DesignWaterLevel = designWaterLevel - }; + var designWaterLevel = 12.34; + var location = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(designWaterLevel); // Call GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties properties = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsFailureMechanismPropertiesTest.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r87aafc58782eb7ce49b1e06b1db2feda8cd85948 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsFailureMechanismPropertiesTest.cs (.../GrassCoverErosionOutwardsFailureMechanismPropertiesTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsFailureMechanismPropertiesTest.cs (.../GrassCoverErosionOutwardsFailureMechanismPropertiesTest.cs) (revision 87aafc58782eb7ce49b1e06b1db2feda8cd85948) @@ -28,6 +28,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.GrassCoverErosionOutwards.Data; using Ringtoets.GrassCoverErosionOutwards.Data.Properties; using Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses; @@ -172,11 +173,7 @@ observerMock.Expect(o => o.UpdateObserver()); mockRepository.ReplayAll(); - var hydraulicLocation = new HydraulicBoundaryLocation(1, string.Empty, 0, 0) - { - DesignWaterLevel = (RoundedDouble) 3.8, - WaveHeight = (RoundedDouble) 5.2 - }; + var hydraulicLocation = new TestHydraulicBoundaryLocation(3.8, 5.2); var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism { Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveConditionsInputContextPropertiesTest.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r87aafc58782eb7ce49b1e06b1db2feda8cd85948 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveConditionsInputContextPropertiesTest.cs (.../GrassCoverErosionOutwardsWaveConditionsInputContextPropertiesTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveConditionsInputContextPropertiesTest.cs (.../GrassCoverErosionOutwardsWaveConditionsInputContextPropertiesTest.cs) (revision 87aafc58782eb7ce49b1e06b1db2feda8cd85948) @@ -31,7 +31,6 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.DikeProfiles; -using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PropertyClasses; using Ringtoets.Common.Forms.UITypeEditors; @@ -139,10 +138,7 @@ Orientation = foreshoreProfileOrientation, X0 = -3 }); - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, string.Empty, 0, 0) - { - DesignWaterLevel = assessmentLevel - }; + var hydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(assessmentLevel); var input = new WaveConditionsInput() { ForeshoreProfile = foreshoreProfile, @@ -198,10 +194,7 @@ var newUpperBoundaryWaterLevels = newLowerBoundaryWaterLevels + (RoundedDouble) random.NextDouble(); var newStepSize = WaveConditionsInputStepSize.Half; - var newHydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, "name", 0.0, 1.1) - { - DesignWaterLevel = assessmentLevel - }; + var newHydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(assessmentLevel); var newSelectableHydraulicBoundaryLocation = new SelectableHydraulicBoundaryLocation(newHydraulicBoundaryLocation, null); var input = new WaveConditionsInput(); Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r87aafc58782eb7ce49b1e06b1db2feda8cd85948 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 87aafc58782eb7ce49b1e06b1db2feda8cd85948) @@ -635,10 +635,7 @@ if (validCalculation) { - calculation.InputParameters.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 1, 1) - { - DesignWaterLevel = (RoundedDouble) 12.0 - }; + calculation.InputParameters.HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(12); calculation.InputParameters.LowerBoundaryRevetment = (RoundedDouble) 1.0; calculation.InputParameters.UpperBoundaryRevetment = (RoundedDouble) 10.0; calculation.InputParameters.StepSize = WaveConditionsInputStepSize.One; @@ -1052,11 +1049,11 @@ private static GrassCoverErosionOutwardsWaveConditionsCalculation GetValidCalculation() { - var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation + return new GrassCoverErosionOutwardsWaveConditionsCalculation { InputParameters = { - HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1300001, "", 0.0, 0.0), + HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(9.3), ForeshoreProfile = new TestForeshoreProfile(true), UseForeshore = true, UseBreakWater = true, @@ -1067,8 +1064,6 @@ LowerBoundaryWaterLevels = (RoundedDouble) 7.1 } }; - calculation.InputParameters.HydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble) 9.3; - return calculation; } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r87aafc58782eb7ce49b1e06b1db2feda8cd85948 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 87aafc58782eb7ce49b1e06b1db2feda8cd85948) @@ -651,10 +651,7 @@ Name = "A", InputParameters = { - HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 1, 1) - { - DesignWaterLevel = (RoundedDouble) 12.0 - }, + HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(12), LowerBoundaryRevetment = (RoundedDouble) 1.0, UpperBoundaryRevetment = (RoundedDouble) 10.0, StepSize = WaveConditionsInputStepSize.One, @@ -668,10 +665,7 @@ Name = "B", InputParameters = { - HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 1, 1) - { - DesignWaterLevel = (RoundedDouble) 12.0 - }, + HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(12), LowerBoundaryRevetment = (RoundedDouble) 1.0, UpperBoundaryRevetment = (RoundedDouble) 10.0, StepSize = WaveConditionsInputStepSize.One, @@ -1179,11 +1173,11 @@ private static GrassCoverErosionOutwardsWaveConditionsCalculation GetValidCalculation() { - var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation + return new GrassCoverErosionOutwardsWaveConditionsCalculation { InputParameters = { - HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1300001, "", 0.0, 0.0), + HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(9.3), ForeshoreProfile = new TestForeshoreProfile(true), UseForeshore = true, UseBreakWater = true, @@ -1194,8 +1188,6 @@ LowerBoundaryWaterLevels = (RoundedDouble) 7.1 } }; - calculation.InputParameters.HydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble) 9.3; - return calculation; } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/TestDataGenerator.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r87aafc58782eb7ce49b1e06b1db2feda8cd85948 --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/TestDataGenerator.cs (.../TestDataGenerator.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/TestDataGenerator.cs (.../TestDataGenerator.cs) (revision 87aafc58782eb7ce49b1e06b1db2feda8cd85948) @@ -56,10 +56,10 @@ var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, string.Empty, 0, 0) { - DesignWaterLevel = (RoundedDouble) 1.1, - DesignWaterLevelCalculationConvergence = CalculationConvergence.CalculatedConverged, - WaveHeight = (RoundedDouble) 2.2, - WaveHeightCalculationConvergence = CalculationConvergence.CalculatedConverged + DesignWaterLevelOutput = new HydraulicBoundaryLocationOutput( + 1.1, double.NaN,double.NaN, double.NaN, double.NaN, CalculationConvergence.CalculatedConverged), + WaveHeightOutput = new HydraulicBoundaryLocationOutput( + 2.2, double.NaN,double.NaN, double.NaN, double.NaN, CalculationConvergence.CalculatedConverged) }; assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase {