Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Factories/WaveConditionsChartDataFactory.cs
===================================================================
diff -u -r2a00fd15de1fcdd317234f2f490fe298905979a4 -rea5b720c67aefb37bfe14973a2333b40af6e0160
--- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Factories/WaveConditionsChartDataFactory.cs (.../WaveConditionsChartDataFactory.cs) (revision 2a00fd15de1fcdd317234f2f490fe298905979a4)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Factories/WaveConditionsChartDataFactory.cs (.../WaveConditionsChartDataFactory.cs) (revision ea5b720c67aefb37bfe14973a2333b40af6e0160)
@@ -85,27 +85,6 @@
}
///
- /// Updates the name of based on .
- ///
- /// The to update the name for.
- /// The used for obtaining the name.
- /// A default name is set (the same as in ) when:
- ///
- /// - is null;
- /// - the foreshore profile in is null;
- /// - the foreshore profile should not be used.
- ///
- ///
- public static void UpdateForeshoreGeometryChartDataName(ChartLineData chartData, WaveConditionsInput input)
- {
- chartData.Name = input?.ForeshoreProfile != null && input.UseForeshore
- ? string.Format(RingtoetsCommonFormsResources.ChartDataFactory_Create_DataIdentifier_0_DataTypeDisplayName_1_,
- input.ForeshoreProfile.Name,
- RingtoetsCommonFormsResources.Foreshore_DisplayName)
- : RingtoetsCommonFormsResources.Foreshore_DisplayName;
- }
-
- ///
/// Create with default styling for lower boundary water levels.
///
/// The created .
@@ -129,6 +108,39 @@
};
}
+ ///
+ /// Create with default styling for design water level.
+ ///
+ /// The created .
+ public static ChartLineData CreateDesignWaterLevelChartdata()
+ {
+ return new ChartLineData("Toetspeil")
+ {
+ Style = new ChartLineStyle(Color.Red, 2, DashStyle.Solid)
+ };
+ }
+
+ ///
+ /// Updates the name of based on .
+ ///
+ /// The to update the name for.
+ /// The used for obtaining the name.
+ /// A default name is set (the same as in ) when:
+ ///
+ /// - is null;
+ /// - the foreshore profile in is null;
+ /// - the foreshore profile should not be used.
+ ///
+ ///
+ public static void UpdateForeshoreGeometryChartDataName(ChartLineData chartData, WaveConditionsInput input)
+ {
+ chartData.Name = input?.ForeshoreProfile != null && input.UseForeshore
+ ? string.Format(RingtoetsCommonFormsResources.ChartDataFactory_Create_DataIdentifier_0_DataTypeDisplayName_1_,
+ input.ForeshoreProfile.Name,
+ RingtoetsCommonFormsResources.Foreshore_DisplayName)
+ : RingtoetsCommonFormsResources.Foreshore_DisplayName;
+ }
+
private static ChartLineStyle GetRevetmentBoundaryStyle()
{
return new ChartLineStyle(Color.Gray, 2, DashStyle.Solid);
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Factories/WaveConditionsChartDataPointsFactory.cs
===================================================================
diff -u -r44fdff23a18b3b9c97489455962b43b7841a2c39 -rea5b720c67aefb37bfe14973a2333b40af6e0160
--- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Factories/WaveConditionsChartDataPointsFactory.cs (.../WaveConditionsChartDataPointsFactory.cs) (revision 44fdff23a18b3b9c97489455962b43b7841a2c39)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Factories/WaveConditionsChartDataPointsFactory.cs (.../WaveConditionsChartDataPointsFactory.cs) (revision ea5b720c67aefb37bfe14973a2333b40af6e0160)
@@ -24,6 +24,7 @@
using Core.Common.Base.Geometry;
using Core.Components.Charting.Data;
using Ringtoets.Common.Data.DikeProfiles;
+using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Common.Forms.Factories;
using Ringtoets.Revetment.Data;
@@ -122,7 +123,9 @@
///
public static Point2D[] CreateLowerBoundaryRevetmentGeometryPoints(WaveConditionsInput input)
{
- return CreateGeometryPoints(input, () => input.LowerBoundaryRevetment);
+ return input != null
+ ? CreateGeometryPoints(input, () => input.LowerBoundaryRevetment)
+ : new Point2D[0];
}
///
@@ -137,7 +140,9 @@
///
public static Point2D[] CreateUpperBoundaryRevetmentGeometryPoints(WaveConditionsInput input)
{
- return CreateGeometryPoints(input, () => input.UpperBoundaryRevetment);
+ return input != null
+ ? CreateGeometryPoints(input, () => input.UpperBoundaryRevetment)
+ : new Point2D[0];
}
///
@@ -152,7 +157,9 @@
///
public static Point2D[] CreateLowerBoundaryWaterLevelsGeometryPoints(WaveConditionsInput input)
{
- return CreateGeometryPoints(input, () => input.LowerBoundaryWaterLevels);
+ return input != null
+ ? CreateGeometryPoints(input, () => input.LowerBoundaryWaterLevels)
+ : new Point2D[0];
}
///
@@ -167,16 +174,31 @@
///
public static Point2D[] CreateUpperBoundaryWaterLevelsGeometryPoints(WaveConditionsInput input)
{
- return CreateGeometryPoints(input, () => input.UpperBoundaryWaterLevels);
+ return input != null
+ ? CreateGeometryPoints(input, () => input.UpperBoundaryWaterLevels)
+ : new Point2D[0];
}
- private static Point2D[] CreateGeometryPoints(WaveConditionsInput input, Func getValueFunc)
+ ///
+ /// Create design water level geometry points in 2D space based on the provided .
+ ///
+ /// The to create the design water level geometry points for.
+ /// An array of points in 2D space or an empty array when:
+ ///
+ /// - is null;
+ /// - is null;
+ /// - the is not set;
+ ///
+ ///
+ public static Point2D[] CreateDesignWaterLevelGeometryPoints(WaveConditionsInput input)
{
- if (input == null)
- {
- return new Point2D[0];
- }
+ return input?.HydraulicBoundaryLocation != null
+ ? CreateGeometryPoints(input, () => input.HydraulicBoundaryLocation.DesignWaterLevel)
+ : new Point2D[0];
+ }
+ private static Point2D[] CreateGeometryPoints(WaveConditionsInput input, Func getValueFunc)
+ {
double value = getValueFunc();
return double.IsNaN(value)
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Views/WaveConditionsInputView.cs
===================================================================
diff -u -r44fdff23a18b3b9c97489455962b43b7841a2c39 -rea5b720c67aefb37bfe14973a2333b40af6e0160
--- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Views/WaveConditionsInputView.cs (.../WaveConditionsInputView.cs) (revision 44fdff23a18b3b9c97489455962b43b7841a2c39)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Views/WaveConditionsInputView.cs (.../WaveConditionsInputView.cs) (revision ea5b720c67aefb37bfe14973a2333b40af6e0160)
@@ -48,6 +48,7 @@
private readonly ChartLineData lowerBoundaryWaterLevelsChartData;
private readonly ChartLineData upperBoundaryWaterLevelsChartData;
+ private readonly ChartLineData designWaterLevelChartData;
private IWaveConditionsCalculation data;
@@ -70,6 +71,7 @@
lowerBoundaryWaterLevelsChartData = WaveConditionsChartDataFactory.CreateLowerWaterLevelsBoundaryChartdata();
upperBoundaryWaterLevelsChartData = WaveConditionsChartDataFactory.CreateUpperWaterLevelsBoundaryChartdata();
+ designWaterLevelChartData = WaveConditionsChartDataFactory.CreateDesignWaterLevelChartdata();
chartDataCollection.Add(foreshoreChartData);
chartDataCollection.Add(lowerBoundaryRevetmentChartData);
@@ -78,6 +80,7 @@
chartDataCollection.Add(revetmentBaseChartData);
chartDataCollection.Add(lowerBoundaryWaterLevelsChartData);
chartDataCollection.Add(upperBoundaryWaterLevelsChartData);
+ chartDataCollection.Add(designWaterLevelChartData);
}
public object Data
@@ -139,6 +142,7 @@
upperBoundaryRevetmentChartData.NotifyObservers();
lowerBoundaryWaterLevelsChartData.NotifyObservers();
upperBoundaryWaterLevelsChartData.NotifyObservers();
+ designWaterLevelChartData.NotifyObservers();
}
private void UpdateChartTitle()
@@ -161,6 +165,8 @@
lowerBoundaryWaterLevelsChartData.Points = WaveConditionsChartDataPointsFactory.CreateLowerBoundaryWaterLevelsGeometryPoints(input);
upperBoundaryWaterLevelsChartData.Points = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryWaterLevelsGeometryPoints(input);
+
+ designWaterLevelChartData.Points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input);
}
}
}
\ No newline at end of file
Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Factories/WaveConditionsChartDataFactoryTest.cs
===================================================================
diff -u -r2a00fd15de1fcdd317234f2f490fe298905979a4 -rea5b720c67aefb37bfe14973a2333b40af6e0160
--- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Factories/WaveConditionsChartDataFactoryTest.cs (.../WaveConditionsChartDataFactoryTest.cs) (revision 2a00fd15de1fcdd317234f2f490fe298905979a4)
+++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Factories/WaveConditionsChartDataFactoryTest.cs (.../WaveConditionsChartDataFactoryTest.cs) (revision ea5b720c67aefb37bfe14973a2333b40af6e0160)
@@ -104,6 +104,17 @@
}
[Test]
+ public void CreateDesignwaterLevelChartData_ReturnsEmptyChartLineDataWithDefaultStyling()
+ {
+ // Call
+ ChartLineData data = WaveConditionsChartDataFactory.CreateDesignWaterLevelChartdata();
+ // Assert
+ Assert.IsEmpty(data.Points);
+ Assert.AreEqual("Toetspeil", data.Name);
+ AssertEqualStyle(data.Style, Color.Red, 2, DashStyle.Solid);
+ }
+
+ [Test]
public void UpdateForeshoreGeometryChartDataName_InputNull_NameSetToDefaultName()
{
// Setup
Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Factories/WaveConditionsChartDataPointsFactoryTest.cs
===================================================================
diff -u -r44fdff23a18b3b9c97489455962b43b7841a2c39 -rea5b720c67aefb37bfe14973a2333b40af6e0160
--- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Factories/WaveConditionsChartDataPointsFactoryTest.cs (.../WaveConditionsChartDataPointsFactoryTest.cs) (revision 44fdff23a18b3b9c97489455962b43b7841a2c39)
+++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Factories/WaveConditionsChartDataPointsFactoryTest.cs (.../WaveConditionsChartDataPointsFactoryTest.cs) (revision ea5b720c67aefb37bfe14973a2333b40af6e0160)
@@ -699,7 +699,7 @@
{
"CreateUpperBoundaryWaterLevelsGeometryPoints_WithForeshoreProfile_ReturnsUppserBoundaryWaterLevelsGeometryPointsArray({0})"
})]
- public void CreateUpperBoundaryWaterLevelsGeometryPoints_WithForeshoreProfile_ReturnsUppserBoundaryWaterLevelsGeometryPointsArray(
+ public void CreateUpperBoundaryWaterLevelsGeometryPoints_WithForeshoreProfile_ReturnsUpperBoundaryWaterLevelsGeometryPointsArray(
IEnumerable foreshoreProfileGeometry)
{
// Call
@@ -724,6 +724,120 @@
CollectionAssert.AreEqual(expectedPoints, points);
}
+ [Test]
+ public void CreateDesignWaterLevelGeometryPoints_InputNull_ReturnsEmptyPointsArray()
+ {
+ // Call
+ Point2D[] points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(null);
+
+ // Assert
+ CollectionAssert.IsEmpty(points);
+ }
+
+ [Test]
+ public void CreateDesignWaterLevelGeometryPoints_HydraulicBoundaryLocationNull_ReturnsEmptyPointsArray()
+ {
+ // Call
+ Point2D[] points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(new WaveConditionsInput());
+
+ // Assert
+ CollectionAssert.IsEmpty(points);
+ }
+
+ [Test]
+ public void CreateDesignWaterLevelGeometryPoints_DesignWaterLevelNaN_ReturnsEmptyPointsArray()
+ {
+ // Setup
+ var input = new WaveConditionsInput
+ {
+ HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation()
+ };
+
+ // Call
+ Point2D[] points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input);
+
+ // Assert
+ CollectionAssert.IsEmpty(points);
+ }
+
+ [Test]
+ public void CreateDesignWaterLevelGeometryPoints_NoForeshoreProfile_ReturnsDesignWaterLevelGeometryPointsArray()
+ {
+ // Call
+ var input = new WaveConditionsInput
+ {
+ HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(6)
+ };
+
+ // Call
+ Point2D[] points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input);
+
+ // Assert
+ var expectedPoints = new[]
+ {
+ new Point2D(-10, 6),
+ new Point2D(2, 6)
+ };
+ CollectionAssert.AreEqual(expectedPoints, points);
+ }
+
+ [Test]
+ public void CreateDesignWaterLevelGeometryPoints_UseForeshoreProfileFalse_ReturnsDesignWaterLevelGeometryPointsArray()
+ {
+ // Call
+ var input = new WaveConditionsInput
+ {
+ HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(6),
+ ForeshoreProfile = new TestForeshoreProfile(new[]
+ {
+ new Point2D(0, 0),
+ new Point2D(3, 4)
+ }),
+ UseForeshore = false
+ };
+
+ // Call
+ Point2D[] points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input);
+
+ // Assert
+ var expectedPoints = new[]
+ {
+ new Point2D(-10, 6),
+ new Point2D(2, 6)
+ };
+ CollectionAssert.AreEqual(expectedPoints, points);
+ }
+
+ [Test]
+ [TestCaseSource(nameof(GetForeshoreProfileGeometries), new object[]
+ {
+ "CreateDesignWaterLevelGeometryPoints_WithForeshoreProfile_ReturnsDesignWaterLevelGeometryPointsArray({0})"
+ })]
+ public void CreateDesignWaterLevelGeometryPoints_WithForeshoreProfile_ReturnsDesignWaterLevelGeometryPointsArray(
+ IEnumerable foreshoreProfileGeometry)
+ {
+ // Call
+ var input = new WaveConditionsInput
+ {
+ HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(6),
+ ForeshoreProfile = new TestForeshoreProfile(foreshoreProfileGeometry)
+ };
+
+ // Call
+ Point2D[] points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input);
+
+ // Assert
+ Point2D lastGeometryPoint = foreshoreProfileGeometry.Last();
+ double endPointX = (input.HydraulicBoundaryLocation.DesignWaterLevel - lastGeometryPoint.Y) / 3;
+
+ var expectedPoints = new[]
+ {
+ new Point2D(foreshoreProfileGeometry.First().X, 6),
+ new Point2D(endPointX + lastGeometryPoint.X, 6)
+ };
+ CollectionAssert.AreEqual(expectedPoints, points);
+ }
+
private static IEnumerable GetInputWithoutRevetmentBoundaries(string testNameFormat)
{
yield return new TestCaseData(new WaveConditionsInput())
Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs
===================================================================
diff -u -r44fdff23a18b3b9c97489455962b43b7841a2c39 -rea5b720c67aefb37bfe14973a2333b40af6e0160
--- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs (.../WaveConditionsInputViewTest.cs) (revision 44fdff23a18b3b9c97489455962b43b7841a2c39)
+++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs (.../WaveConditionsInputViewTest.cs) (revision ea5b720c67aefb37bfe14973a2333b40af6e0160)
@@ -46,6 +46,7 @@
private const int revetmentBaseChartDataIndex = 4;
private const int lowerBoundaryWaterLevelsChartDataIndex = 5;
private const int upperBoundaryWaterLevelsChartDataIndex = 6;
+ private const int designWaterLevelChartDataIndex = 7;
[Test]
public void Constructor_ExpectedValues()
@@ -121,7 +122,7 @@
})
{
// Precondition
- Assert.AreEqual(7, view.Chart.Data.Collection.Count());
+ Assert.AreEqual(8, view.Chart.Data.Collection.Count());
Assert.AreEqual("Nieuwe berekening", view.Chart.ChartTitle);
// Call
@@ -172,7 +173,8 @@
LowerBoundaryRevetment = (RoundedDouble) 5,
UpperBoundaryRevetment = (RoundedDouble) 8,
LowerBoundaryWaterLevels = (RoundedDouble) 3,
- UpperBoundaryWaterLevels = (RoundedDouble) 9
+ UpperBoundaryWaterLevels = (RoundedDouble) 9,
+ HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(6)
}
};
@@ -185,7 +187,7 @@
ChartDataCollection chartData = view.Chart.Data;
Assert.IsInstanceOf(chartData);
- Assert.AreEqual(7, chartData.Collection.Count());
+ Assert.AreEqual(8, chartData.Collection.Count());
AssertForeshoreChartData(calculation.InputParameters.ForeshoreProfile, chartData.Collection.ElementAt(foreShoreChartDataIndex));
AssertRevetmentChartData(calculation.InputParameters.ForeshoreGeometry.Last(),
@@ -208,6 +210,10 @@
AssertUpperBoundaryWaterLevelsChartData(calculation.InputParameters.ForeshoreGeometry,
calculation.InputParameters.UpperBoundaryWaterLevels,
chartData.Collection.ElementAt(upperBoundaryWaterLevelsChartDataIndex));
+
+ AssertDesignWaterLevelChartData(calculation.InputParameters.ForeshoreGeometry,
+ calculation.InputParameters.HydraulicBoundaryLocation.DesignWaterLevel,
+ chartData.Collection.ElementAt(designWaterLevelChartDataIndex));
}
}
@@ -279,7 +285,7 @@
// Setup
var mocks = new MockRepository();
var observer = mocks.StrictMock();
- observer.Expect(o => o.UpdateObserver()).Repeat.Times(7);
+ observer.Expect(o => o.UpdateObserver()).Repeat.Times(8);
mocks.ReplayAll();
var calculation = new TestWaveConditionsCalculation
@@ -295,7 +301,8 @@
LowerBoundaryRevetment = (RoundedDouble) 5,
UpperBoundaryRevetment = (RoundedDouble) 8,
LowerBoundaryWaterLevels = (RoundedDouble) 3,
- UpperBoundaryWaterLevels = (RoundedDouble) 7
+ UpperBoundaryWaterLevels = (RoundedDouble) 7,
+ HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(6)
}
};
@@ -311,6 +318,7 @@
var upperBoundaryRevetmentChartData = (ChartLineData) view.Chart.Data.Collection.ElementAt(upperBoundaryRevetmentChartDataIndex);
var lowerBoundaryWaterLevelsChartData = (ChartLineData) view.Chart.Data.Collection.ElementAt(lowerBoundaryWaterLevelsChartDataIndex);
var upperBoundaryWaterLevelsChartData = (ChartLineData) view.Chart.Data.Collection.ElementAt(upperBoundaryWaterLevelsChartDataIndex);
+ var designWaterLevelChartData = (ChartLineData) view.Chart.Data.Collection.ElementAt(designWaterLevelChartDataIndex);
foreshoreChartData.Attach(observer);
revetmentChartData.Attach(observer);
@@ -319,6 +327,7 @@
upperBoundaryRevetmentChartData.Attach(observer);
lowerBoundaryWaterLevelsChartData.Attach(observer);
upperBoundaryWaterLevelsChartData.Attach(observer);
+ designWaterLevelChartData.Attach(observer);
ForeshoreProfile profile2 = new TestForeshoreProfile(new[]
{
@@ -340,6 +349,7 @@
Assert.AreSame(upperBoundaryRevetmentChartData, (ChartLineData) view.Chart.Data.Collection.ElementAt(upperBoundaryRevetmentChartDataIndex));
Assert.AreSame(lowerBoundaryWaterLevelsChartData, (ChartLineData) view.Chart.Data.Collection.ElementAt(lowerBoundaryWaterLevelsChartDataIndex));
Assert.AreSame(upperBoundaryWaterLevelsChartData, (ChartLineData) view.Chart.Data.Collection.ElementAt(upperBoundaryWaterLevelsChartDataIndex));
+ Assert.AreSame(designWaterLevelChartData, (ChartLineData) view.Chart.Data.Collection.ElementAt(designWaterLevelChartDataIndex));
AssertForeshoreChartData(profile2, foreshoreChartData);
AssertRevetmentChartData(profile2.Geometry.Last(), calculation.InputParameters.LowerBoundaryRevetment,
@@ -360,6 +370,10 @@
AssertUpperBoundaryWaterLevelsChartData(calculation.InputParameters.ForeshoreGeometry,
calculation.InputParameters.UpperBoundaryWaterLevels,
upperBoundaryWaterLevelsChartData);
+
+ AssertDesignWaterLevelChartData(calculation.InputParameters.ForeshoreGeometry,
+ calculation.InputParameters.HydraulicBoundaryLocation.DesignWaterLevel,
+ designWaterLevelChartData);
mocks.VerifyAll();
}
}
@@ -405,7 +419,7 @@
List chartDatasList = chartDataCollection.Collection.ToList();
- Assert.AreEqual(7, chartDatasList.Count);
+ Assert.AreEqual(8, chartDatasList.Count);
var foreshoreData = (ChartLineData) chartDatasList[foreShoreChartDataIndex];
var lowerBoundaryRevetmentData = (ChartLineData) chartDatasList[lowerBoundaryRevetmentChartDataIndex];
@@ -414,6 +428,7 @@
var revetmentBaseData = (ChartLineData) chartDatasList[revetmentBaseChartDataIndex];
var lowerBoundaryWaterLevelsData = (ChartLineData) chartDatasList[lowerBoundaryWaterLevelsChartDataIndex];
var upperBoundaryWaterLevelsData = (ChartLineData) chartDatasList[upperBoundaryWaterLevelsChartDataIndex];
+ var designWaterLevelData = (ChartLineData) chartDatasList[designWaterLevelChartDataIndex];
CollectionAssert.IsEmpty(foreshoreData.Points);
CollectionAssert.IsEmpty(lowerBoundaryRevetmentData.Points);
@@ -422,6 +437,7 @@
CollectionAssert.IsEmpty(revetmentBaseData.Points);
CollectionAssert.IsEmpty(lowerBoundaryWaterLevelsData.Points);
CollectionAssert.IsEmpty(upperBoundaryWaterLevelsData.Points);
+ CollectionAssert.IsEmpty(designWaterLevelData.Points);
Assert.AreEqual("Voorlandprofiel", foreshoreData.Name);
Assert.AreEqual("Ondergrens bekleding", lowerBoundaryRevetmentData.Name);
@@ -430,6 +446,7 @@
Assert.AreEqual("Bekleding", revetmentBaseData.Name);
Assert.AreEqual("Ondergrens waterstanden", lowerBoundaryWaterLevelsData.Name);
Assert.AreEqual("Bovengrens waterstanden", upperBoundaryWaterLevelsData.Name);
+ Assert.AreEqual("Toetspeil", designWaterLevelData.Name);
}
private static void AssertForeshoreChartData(ForeshoreProfile foreshoreProfile, ChartData chartData)
@@ -554,6 +571,24 @@
Assert.AreEqual("Bovengrens waterstanden", waterLevelsChartData.Name);
}
+ private static void AssertDesignWaterLevelChartData(RoundedPoint2DCollection foreshorePoints,
+ double designWaterLevel,
+ ChartData chartData)
+ {
+ Assert.IsInstanceOf(chartData);
+ var waterLevelsChartData = (ChartLineData) chartData;
+
+ var expectedGeometry = new[]
+ {
+ new Point2D(foreshorePoints.First().X, designWaterLevel),
+ new Point2D(GetPointX(designWaterLevel, foreshorePoints.Last()), designWaterLevel)
+ };
+
+ CollectionAssert.AreEqual(expectedGeometry, waterLevelsChartData.Points);
+
+ Assert.AreEqual("Toetspeil", waterLevelsChartData.Name);
+ }
+
private static double GetPointX(double pointY, Point2D lastForeshorePoint)
{
return ((pointY - lastForeshorePoint.Y) / 3) + lastForeshorePoint.X;