Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryLocation.cs
===================================================================
diff -u -re1d4d3fe987bfa6504703952ea0dbd8a18f5a698 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision e1d4d3fe987bfa6504703952ea0dbd8a18f5a698)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -73,7 +73,7 @@
get
{
return DesignWaterLevelOutput == null
- ? new RoundedDouble(2, double.NaN)
+ ? (RoundedDouble) double.NaN
: DesignWaterLevelOutput.Result;
}
set
@@ -106,20 +106,16 @@
}
///
- /// Gets or sets the wave height of the hydraulic boundary location.
+ /// Gets the wave height of the hydraulic boundary location.
///
public RoundedDouble WaveHeight
{
get
{
return WaveHeightOutput == null
- ? new RoundedDouble(2, double.NaN)
+ ? (RoundedDouble) double.NaN
: WaveHeightOutput.Result;
}
- set
- {
- WaveHeightOutput = new HydraulicBoundaryLocationOutput(value, 0, 0, 0, 0, CalculationConvergence.NotCalculated);
- }
}
///
Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/HydraulicBoundaryLocationTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -62,9 +62,7 @@
Assert.AreEqual(x, location.X);
Assert.AreEqual(y, location.Y);
Assert.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel);
- Assert.AreEqual(2, hydraulicBoundaryLocation.DesignWaterLevel.NumberOfDecimalPlaces);
Assert.IsNaN(hydraulicBoundaryLocation.WaveHeight);
- Assert.AreEqual(2, hydraulicBoundaryLocation.WaveHeight.NumberOfDecimalPlaces);
Assert.AreEqual(CalculationConvergence.NotCalculated, hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence);
Assert.AreEqual(CalculationConvergence.NotCalculated, hydraulicBoundaryLocation.WaveHeightCalculationConvergence);
Assert.IsNull(hydraulicBoundaryLocation.DesignWaterLevelOutput);
Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestHydraulicBoundaryLocationTest.cs
===================================================================
diff -u -r7a7526e4ff1bccf09b09fadcfd309a725c6494b9 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestHydraulicBoundaryLocationTest.cs (.../TestHydraulicBoundaryLocationTest.cs) (revision 7a7526e4ff1bccf09b09fadcfd309a725c6494b9)
+++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestHydraulicBoundaryLocationTest.cs (.../TestHydraulicBoundaryLocationTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -19,7 +19,6 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
using NUnit.Framework;
using Ringtoets.Common.Data.Hydraulics;
@@ -48,54 +47,79 @@
}
[Test]
- public void CreateDesignWaterLevelCalculated_DesignWaterLevel_ExpectedValues(
- [Random(1)] double designWaterLevelValue)
+ public void CreateDesignWaterLevelCalculated_DesignWaterLevel_ExpectedValues()
{
// Setup
- var designWaterLevel = new RoundedDouble(4, designWaterLevelValue);
+ const double designWaterLevelValue = 4.5;
// Call
- HydraulicBoundaryLocation testLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(designWaterLevel);
+ HydraulicBoundaryLocation testLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(designWaterLevelValue);
// Assert
Assert.IsInstanceOf(testLocation);
Assert.AreEqual(0, testLocation.Id);
Assert.IsEmpty(testLocation.Name);
Assert.AreEqual(new Point2D(0, 0), testLocation.Location);
- Assert.AreEqual(designWaterLevel, testLocation.DesignWaterLevel, testLocation.DesignWaterLevel.GetAccuracy());
+ Assert.AreEqual(designWaterLevelValue, testLocation.DesignWaterLevel, testLocation.DesignWaterLevel.GetAccuracy());
Assert.IsNaN(testLocation.WaveHeight);
Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.DesignWaterLevelCalculationConvergence);
Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.WaveHeightCalculationConvergence);
- var expectedDesignWaterLevelOutput = CreateHydraulicBoundaryLocationOutput(designWaterLevel);
+ var expectedDesignWaterLevelOutput = CreateHydraulicBoundaryLocationOutput(designWaterLevelValue);
AssertAreEqual(expectedDesignWaterLevelOutput, testLocation.DesignWaterLevelOutput);
Assert.IsNull(testLocation.WaveHeightOutput);
}
[Test]
- public void CreateWaveHeightCalculated_WaveHeight_ExpectedValues([Random(1)] double waveHeightValue)
+ public void CreateWaveHeightCalculated_WaveHeight_ExpectedValues()
{
// Setup
- var waveHeight = new RoundedDouble(4, waveHeightValue);
+ const double waveHeightValue = 5.5;
// Call
- HydraulicBoundaryLocation testLocation = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(waveHeight);
+ HydraulicBoundaryLocation testLocation = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(waveHeightValue);
// Assert
Assert.IsInstanceOf(testLocation);
Assert.AreEqual(0, testLocation.Id);
Assert.IsEmpty(testLocation.Name);
Assert.AreEqual(new Point2D(0, 0), testLocation.Location);
Assert.IsNaN(testLocation.DesignWaterLevel);
- Assert.AreEqual(waveHeight, testLocation.WaveHeight, testLocation.WaveHeight.GetAccuracy());
+ Assert.AreEqual(waveHeightValue, testLocation.WaveHeight, testLocation.WaveHeight.GetAccuracy());
Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.DesignWaterLevelCalculationConvergence);
Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.WaveHeightCalculationConvergence);
Assert.IsNull(testLocation.DesignWaterLevelOutput);
- var expectedWaveHeightOutput = CreateHydraulicBoundaryLocationOutput(waveHeight);
+ var expectedWaveHeightOutput = CreateHydraulicBoundaryLocationOutput(waveHeightValue);
AssertAreEqual(expectedWaveHeightOutput, testLocation.WaveHeightOutput);
}
+ [Test]
+ public void Constructor_DesignWaterLevelAndWaveHeight_ExpectedValues()
+ {
+ // Setup
+ const double designWaterLevelValue = 4.5;
+ const double waveHeightValue = 5.5;
+
+ // Call
+ HydraulicBoundaryLocation testLocation = new TestHydraulicBoundaryLocation(designWaterLevelValue, waveHeightValue);
+
+ // Assert
+ Assert.IsInstanceOf(testLocation);
+ Assert.AreEqual(0, testLocation.Id);
+ Assert.IsEmpty(testLocation.Name);
+ Assert.AreEqual(new Point2D(0, 0), testLocation.Location);
+ Assert.AreEqual(designWaterLevelValue, testLocation.DesignWaterLevel, testLocation.DesignWaterLevel.GetAccuracy());
+ Assert.AreEqual(waveHeightValue, testLocation.WaveHeight, testLocation.WaveHeight.GetAccuracy());
+ Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.DesignWaterLevelCalculationConvergence);
+ Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.WaveHeightCalculationConvergence);
+
+ var expectedDesignWaterLevelOutput = CreateHydraulicBoundaryLocationOutput(designWaterLevelValue);
+ AssertAreEqual(expectedDesignWaterLevelOutput, testLocation.DesignWaterLevelOutput);
+ var expectedWaveHeightOutput = CreateHydraulicBoundaryLocationOutput(waveHeightValue);
+ AssertAreEqual(expectedWaveHeightOutput, testLocation.WaveHeightOutput);
+ }
+
private static HydraulicBoundaryLocationOutput CreateHydraulicBoundaryLocationOutput(double result)
{
return new HydraulicBoundaryLocationOutput(result, 0, 0, 0, 0, CalculationConvergence.NotCalculated);
Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestHydraulicBoundaryLocation.cs
===================================================================
diff -u -r0981b22c56801334d3f71343f1a861070a404e3e -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestHydraulicBoundaryLocation.cs (.../TestHydraulicBoundaryLocation.cs) (revision 0981b22c56801334d3f71343f1a861070a404e3e)
+++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestHydraulicBoundaryLocation.cs (.../TestHydraulicBoundaryLocation.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -33,7 +33,7 @@
///
/// Creates a new instance of .
///
- public TestHydraulicBoundaryLocation() : this(null, null) { }
+ public TestHydraulicBoundaryLocation() : this(null, null) {}
///
/// Creates a new instance of with
@@ -47,12 +47,11 @@
if (designWaterLevel.HasValue)
{
DesignWaterLevelOutput = new HydraulicBoundaryLocationOutput(designWaterLevel.Value, 0, 0, 0, 0, CalculationConvergence.NotCalculated);
- DesignWaterLevel = (RoundedDouble)designWaterLevel.Value;
+ DesignWaterLevel = (RoundedDouble) designWaterLevel.Value;
}
if (waveHeight.HasValue)
{
WaveHeightOutput = new HydraulicBoundaryLocationOutput(waveHeight.Value, 0, 0, 0, 0, CalculationConvergence.NotCalculated);
- WaveHeight = (RoundedDouble)waveHeight.Value;
}
}
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs (.../HydraulicBoundaryLocationsViewTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs (.../HydraulicBoundaryLocationsViewTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -35,6 +35,7 @@
using Ringtoets.Common.Data.Contribution;
using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.Forms.GuiServices;
using Ringtoets.Common.Forms.Views;
@@ -394,11 +395,11 @@
Locations.Add(new HydraulicBoundaryLocation(1, "1", 1.0, 1.0));
Locations.Add(new HydraulicBoundaryLocation(2, "2", 2.0, 2.0)
{
- DesignWaterLevel = (RoundedDouble) 1.23
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(1.23)
});
Locations.Add(new HydraulicBoundaryLocation(3, "3", 3.0, 3.0)
{
- WaveHeight = (RoundedDouble) 2.45
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(2.45)
});
}
}
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/WaveHeightLocationRowTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/WaveHeightLocationRowTest.cs (.../WaveHeightLocationRowTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/WaveHeightLocationRowTest.cs (.../WaveHeightLocationRowTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -56,7 +56,7 @@
RoundedDouble waveHeight = (RoundedDouble) 3.0;
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, locationname, coordinateX, coordinateY)
{
- WaveHeight = waveHeight
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(waveHeight)
};
// Call
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Hydraulics/HydraulicBoundaryLocationsExporterTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Hydraulics/HydraulicBoundaryLocationsExporterTest.cs (.../HydraulicBoundaryLocationsExporterTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Hydraulics/HydraulicBoundaryLocationsExporterTest.cs (.../HydraulicBoundaryLocationsExporterTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -23,11 +23,11 @@
using System.IO;
using System.Linq;
using System.Security.AccessControl;
-using Core.Common.Base.Data;
using Core.Common.Base.IO;
using Core.Common.TestUtil;
using NUnit.Framework;
using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.IO.Hydraulics;
namespace Ringtoets.Common.IO.Test.Hydraulics
@@ -68,8 +68,8 @@
// Setup
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2)
{
- DesignWaterLevel = (RoundedDouble) 111.111,
- WaveHeight = (RoundedDouble) 222.222
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(111.111),
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(222.222)
};
// Call
@@ -88,8 +88,8 @@
// Setup
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2)
{
- DesignWaterLevel = (RoundedDouble) 111.111,
- WaveHeight = (RoundedDouble) 222.222
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(111.111),
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(222.222)
};
string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, "test.shp");
@@ -111,8 +111,8 @@
// Setup
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2)
{
- DesignWaterLevel = (RoundedDouble) 111.111,
- WaveHeight = (RoundedDouble) 222.222
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(111.111),
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(222.222)
};
string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, "test.shp");
@@ -134,8 +134,8 @@
// Setup
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2)
{
- DesignWaterLevel = (RoundedDouble) 111.111,
- WaveHeight = (RoundedDouble) 222.222
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(111.111),
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(222.222)
};
string directoryPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO,
@@ -172,8 +172,8 @@
// Setup
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2)
{
- DesignWaterLevel = (RoundedDouble) 111.111,
- WaveHeight = (RoundedDouble) 222.222
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(111.111),
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(222.222)
};
string directoryPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO,
@@ -211,8 +211,8 @@
// Setup
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2)
{
- DesignWaterLevel = (RoundedDouble) 111.111,
- WaveHeight = (RoundedDouble) 222.222
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(111.111),
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(222.222)
};
string directoryPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO,
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Hydraulics/HydraulicBoundaryLocationsWriterTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Hydraulics/HydraulicBoundaryLocationsWriterTest.cs (.../HydraulicBoundaryLocationsWriterTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Hydraulics/HydraulicBoundaryLocationsWriterTest.cs (.../HydraulicBoundaryLocationsWriterTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -22,10 +22,10 @@
using System;
using System.IO;
using System.Linq;
-using Core.Common.Base.Data;
using Core.Common.TestUtil;
using NUnit.Framework;
using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.IO.Hydraulics;
namespace Ringtoets.Common.IO.Test.Hydraulics
@@ -91,8 +91,8 @@
// Setup
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2)
{
- DesignWaterLevel = (RoundedDouble) 111.111,
- WaveHeight = (RoundedDouble) 222.222
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(111.111),
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(222.222)
};
string directoryPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO,
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -35,6 +35,7 @@
using Ringtoets.Common.Data.Contribution;
using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.Forms.GuiServices;
using Ringtoets.Common.Forms.Views;
using Ringtoets.Common.Service.MessageProviders;
@@ -156,11 +157,11 @@
new HydraulicBoundaryLocation(1, "1", 1.0, 1.0),
new HydraulicBoundaryLocation(2, "2", 2.0, 2.0)
{
- WaveHeight = (RoundedDouble) 1.23
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(1.23)
},
new HydraulicBoundaryLocation(3, "3", 3.0, 3.0)
{
- DesignWaterLevel = (RoundedDouble) 2.45
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(2.45)
}
};
@@ -223,7 +224,7 @@
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
{
- DesignWaterLevel = (RoundedDouble) 10.23
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(10.23)
};
locations.Clear();
@@ -416,11 +417,11 @@
new HydraulicBoundaryLocation(1, "1", 1.0, 1.0),
new HydraulicBoundaryLocation(2, "2", 2.0, 2.0)
{
- DesignWaterLevel = (RoundedDouble) 1.23
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(1.23)
},
new HydraulicBoundaryLocation(3, "3", 3.0, 3.0)
{
- WaveHeight = (RoundedDouble) 2.45
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(2.45)
}
};
return view;
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -25,7 +25,6 @@
using System.Linq;
using System.Windows.Forms;
using Core.Common.Base;
-using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
using Core.Common.TestUtil;
using NUnit.Extensions.Forms;
@@ -35,6 +34,7 @@
using Ringtoets.Common.Data.Contribution;
using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.Forms.GuiServices;
using Ringtoets.Common.Forms.Views;
using Ringtoets.Common.Service.MessageProviders;
@@ -152,11 +152,11 @@
new HydraulicBoundaryLocation(1, "1", 1.0, 1.0),
new HydraulicBoundaryLocation(2, "2", 2.0, 2.0)
{
- WaveHeight = (RoundedDouble) 1.23
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(1.23)
},
new HydraulicBoundaryLocation(3, "3", 3.0, 3.0)
{
- DesignWaterLevel = (RoundedDouble) 2.45
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(2.45)
}
};
@@ -219,7 +219,7 @@
HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10, 10)
{
- WaveHeight = (RoundedDouble) 10
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(10)
};
locations.Clear();
@@ -257,7 +257,7 @@
Assert.AreEqual("-", rows[2].Cells[locationWaveHeightColumnIndex].FormattedValue);
// Call
- locations.ForEach(loc => loc.WaveHeight = RoundedDouble.NaN);
+ locations.ForEach(loc => loc.WaveHeightOutput = null);
locations.NotifyObservers();
// Assert
@@ -406,16 +406,18 @@
{
var view = ShowWaveHeightLocationsView();
- ObservableList locations = new ObservableList();
- locations.Add(new HydraulicBoundaryLocation(1, "1", 1.0, 1.0));
- locations.Add(new HydraulicBoundaryLocation(2, "2", 2.0, 2.0)
+ ObservableList locations = new ObservableList
{
- WaveHeight = (RoundedDouble) 1.23
- });
- locations.Add(new HydraulicBoundaryLocation(3, "3", 3.0, 3.0)
- {
- DesignWaterLevel = (RoundedDouble) 2.45
- });
+ new HydraulicBoundaryLocation(1, "1", 1.0, 1.0),
+ new HydraulicBoundaryLocation(2, "2", 2.0, 2.0)
+ {
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(1.23)
+ },
+ new HydraulicBoundaryLocation(3, "3", 3.0, 3.0)
+ {
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(2.45)
+ }
+ };
view.Data = locations;
return view;
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/FailureMechanismContributionViewIntegrationTest.cs
===================================================================
diff -u -r0981b22c56801334d3f71343f1a861070a404e3e -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/FailureMechanismContributionViewIntegrationTest.cs (.../FailureMechanismContributionViewIntegrationTest.cs) (revision 0981b22c56801334d3f71343f1a861070a404e3e)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/FailureMechanismContributionViewIntegrationTest.cs (.../FailureMechanismContributionViewIntegrationTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -108,8 +108,10 @@
};
var grassCoverErosionOutwardsHydraulicBoundaryLocation = hydraulicBoundaryLocation;
- grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeight = waveHeight;
- grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevel = designWaterLevel;
+ grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(
+ waveHeight);
+ grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(
+ designWaterLevel);
assessmentSection.GrassCoverErosionOutwards.HydraulicBoundaryLocations.Add(grassCoverErosionOutwardsHydraulicBoundaryLocation);
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -296,7 +296,7 @@
var hydraulicBoundaryLocation1 = new HydraulicBoundaryLocation(100001, "", 1.1, 2.2);
var hydraulicBoundaryLocation2 = new HydraulicBoundaryLocation(100002, "", 3.3, 4.4)
{
- WaveHeight = waveHeight
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(waveHeight)
};
var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -34,6 +34,7 @@
using Ringtoets.Common.Data.Contribution;
using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.Forms.GuiServices;
using Ringtoets.Common.Forms.Views;
using Ringtoets.Common.Service.MessageProviders;
@@ -188,7 +189,7 @@
HydraulicBoundaryDatabase newHydraulicBoundaryDatabase = new HydraulicBoundaryDatabase();
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
{
- DesignWaterLevel = (RoundedDouble) 10.23
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(10.23)
};
newHydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation);
@@ -229,7 +230,7 @@
Assert.AreEqual("-", rows[2].Cells[locationDesignWaterlevelColumnIndex].FormattedValue);
// Call
- assessmentSection.HydraulicBoundaryDatabase.Locations.ForEach(loc => loc.DesignWaterLevel = RoundedDouble.NaN);
+ assessmentSection.HydraulicBoundaryDatabase.Locations.ForEach(loc => loc.DesignWaterLevelOutput = null);
assessmentSection.NotifyObservers();
// Assert
@@ -342,7 +343,7 @@
});
Locations.Add(new HydraulicBoundaryLocation(3, "3", 3.0, 3.0)
{
- WaveHeight = (RoundedDouble) 2.45
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(2.45)
});
}
}
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -24,7 +24,6 @@
using System.Linq;
using System.Windows.Forms;
using Core.Common.Base;
-using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
using NUnit.Extensions.Forms;
using NUnit.Framework;
@@ -34,6 +33,7 @@
using Ringtoets.Common.Data.Contribution;
using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.Forms.GuiServices;
using Ringtoets.Common.Forms.Views;
using Ringtoets.Integration.Forms.PresentationObjects;
@@ -182,7 +182,7 @@
HydraulicBoundaryDatabase newHydraulicBoundaryDatabase = new HydraulicBoundaryDatabase();
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
{
- WaveHeight = (RoundedDouble) 10.23
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(10.23)
};
newHydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation);
@@ -222,7 +222,7 @@
Assert.AreEqual("-", rows[2].Cells[locationWaveHeightColumnIndex].FormattedValue);
// Call
- assessmentSection.HydraulicBoundaryDatabase.Locations.ForEach(loc => loc.WaveHeight = RoundedDouble.NaN);
+ assessmentSection.HydraulicBoundaryDatabase.Locations.ForEach(loc => loc.WaveHeightOutput = null);
assessmentSection.NotifyObservers();
// Assert
@@ -307,7 +307,7 @@
{
var view = ShowWaveHeightLocationsView();
- var assessmentSection = new TestAssessmentSection()
+ var assessmentSection = new TestAssessmentSection
{
HydraulicBoundaryDatabase = new TestHydraulicBoundaryDatabase()
};
@@ -347,11 +347,11 @@
Locations.Add(new HydraulicBoundaryLocation(1, "1", 1.0, 1.0));
Locations.Add(new HydraulicBoundaryLocation(2, "2", 2.0, 2.0)
{
- WaveHeight = (RoundedDouble) 1.23
+ WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(1.23)
});
Locations.Add(new HydraulicBoundaryLocation(3, "3", 3.0, 3.0)
{
- DesignWaterLevel = (RoundedDouble) 2.45
+ DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(2.45)
});
}
}
Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs
===================================================================
diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43
--- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43)
@@ -23,7 +23,6 @@
using System.Collections.Generic;
using System.Linq;
using Core.Common.Base;
-using Core.Common.Base.Data;
using NUnit.Framework;
using Ringtoets.ClosingStructures.Data;
using Ringtoets.Common.Data.AssessmentSection;
@@ -218,24 +217,27 @@
double waveHeight, double designWaterLevel)
{
// Setup
+ var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(waveHeight, designWaterLevel);
var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike)
{
- HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase()
+ HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
+ {
+ Locations =
+ {
+ hydraulicBoundaryLocation
+ }
+ }
};
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 0, 0)
- {
- WaveHeight = (RoundedDouble) waveHeight,
- DesignWaterLevel = (RoundedDouble) designWaterLevel
- };
- assessmentSection.HydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation);
// Call
- IEnumerable affectedObjects = RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutput(assessmentSection.HydraulicBoundaryDatabase,
- assessmentSection.GrassCoverErosionOutwards);
+ IEnumerable affectedObjects = RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutput(
+ assessmentSection.HydraulicBoundaryDatabase, assessmentSection.GrassCoverErosionOutwards);
// Assert
// Note: To make sure the clear is performed regardless of what is done with
// the return result, no ToArray() should be called before these assertions:
+ Assert.IsNull(hydraulicBoundaryLocation.DesignWaterLevelOutput);
+ Assert.IsNull(hydraulicBoundaryLocation.WaveHeightOutput);
Assert.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel);
Assert.IsNaN(hydraulicBoundaryLocation.WaveHeight);
Assert.AreEqual(CalculationConvergence.NotCalculated, hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence);
@@ -298,8 +300,10 @@
};
var grassCoverErosionOutwardsHydraulicBoundaryLocation = hydraulicBoundaryLocation;
- grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble) designWaterLevel;
- grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeight = (RoundedDouble) waveHeight;
+ grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(
+ designWaterLevel, CalculationConvergence.CalculatedConverged);
+ grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(
+ waveHeight, CalculationConvergence.CalculatedConverged);
var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism
{
@@ -315,6 +319,8 @@
// Assert
// Note: To make sure the clear is performed regardless of what is done with
// the return result, no ToArray() should be called before these assertions:
+ Assert.IsNull(grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevelOutput);
+ Assert.IsNull(grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeightOutput);
Assert.IsNaN(grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevel);
Assert.IsNaN(grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeight);
Assert.AreEqual(CalculationConvergence.NotCalculated, grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence);
@@ -361,11 +367,7 @@
double designWaterLevel, double waveHeight)
{
// Setup
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test1", 0, 0)
- {
- DesignWaterLevel = (RoundedDouble) designWaterLevel,
- WaveHeight = (RoundedDouble) waveHeight
- };
+ var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(designWaterLevel, waveHeight);
var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
{
Locations =
@@ -374,11 +376,7 @@
}
};
- var grassCoverErosionOutwardsHydraulicBoundaryLocation = new HydraulicBoundaryLocation(2, "test2", 0, 0)
- {
- DesignWaterLevel = (RoundedDouble) designWaterLevel,
- WaveHeight = (RoundedDouble) waveHeight
- };
+ var grassCoverErosionOutwardsHydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(designWaterLevel, waveHeight);
var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism
{
@@ -394,13 +392,17 @@
// Assert
// Note: To make sure the clear is performed regardless of what is done with
// the return result, no ToArray() should be called before these assertions:
+ Assert.IsNull(hydraulicBoundaryLocation.DesignWaterLevelOutput);
+ Assert.IsNull(hydraulicBoundaryLocation.WaveHeightOutput);
Assert.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel);
Assert.IsNaN(hydraulicBoundaryLocation.WaveHeight);
Assert.AreEqual(CalculationConvergence.NotCalculated, hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence);
Assert.AreEqual(CalculationConvergence.NotCalculated, hydraulicBoundaryLocation.WaveHeightCalculationConvergence);
// Note: To make sure the clear is performed regardless of what is done with
// the return result, no ToArray() should be called before these assertions:
+ Assert.IsNull(grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevelOutput);
+ Assert.IsNull(grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeightOutput);
Assert.IsNaN(grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevel);
Assert.IsNaN(grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeight);
Assert.AreEqual(CalculationConvergence.NotCalculated, grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence);