Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Factories/WaveConditionsChartDataPointsFactory.cs
===================================================================
diff -u -r5d517d1330fbcd67b88a1f23d01e006e1ad98c1c -r7d7b7e2a678a3cb63cf7e629754a9642abb7034f
--- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Factories/WaveConditionsChartDataPointsFactory.cs (.../WaveConditionsChartDataPointsFactory.cs) (revision 5d517d1330fbcd67b88a1f23d01e006e1ad98c1c)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Factories/WaveConditionsChartDataPointsFactory.cs (.../WaveConditionsChartDataPointsFactory.cs) (revision 7d7b7e2a678a3cb63cf7e629754a9642abb7034f)
@@ -192,17 +192,19 @@
/// Create design water level geometry points in 2D space based on the provided .
///
/// The to create the design water level geometry points for.
+ /// The normative assessment level to use while determining water levels.
/// A collection of points in 2D space or an empty collection when:
///
/// - is null;
/// - is null;
- /// - the is not set.
+ /// - the normative assessment level is .
///
///
- public static IEnumerable CreateDesignWaterLevelGeometryPoints(WaveConditionsInput input)
+ public static IEnumerable CreateDesignWaterLevelGeometryPoints(WaveConditionsInput input,
+ RoundedDouble normativeAssessmentLevel)
{
- return input?.HydraulicBoundaryLocation != null
- ? CreateGeometryPoints(input, () => input.HydraulicBoundaryLocation.DesignWaterLevel)
+ return input != null
+ ? CreateGeometryPoints(input, () => normativeAssessmentLevel)
: new Point2D[0];
}
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Views/WaveConditionsInputView.cs
===================================================================
diff -u -rc9718aac47d13f790a2ec0cc7d51305361b90d77 -r7d7b7e2a678a3cb63cf7e629754a9642abb7034f
--- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Views/WaveConditionsInputView.cs (.../WaveConditionsInputView.cs) (revision c9718aac47d13f790a2ec0cc7d51305361b90d77)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Views/WaveConditionsInputView.cs (.../WaveConditionsInputView.cs) (revision 7d7b7e2a678a3cb63cf7e629754a9642abb7034f)
@@ -187,7 +187,7 @@
upperBoundaryRevetmentChartData.Points = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryRevetmentGeometryPoints(input);
lowerBoundaryWaterLevelsChartData.Points = WaveConditionsChartDataPointsFactory.CreateLowerBoundaryWaterLevelsGeometryPoints(input);
upperBoundaryWaterLevelsChartData.Points = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryWaterLevelsGeometryPoints(input);
- designWaterLevelChartData.Points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input);
+ designWaterLevelChartData.Points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input, getNormativeAssessmentLevelFunc());
waterLevelsChartData.Lines = WaveConditionsChartDataPointsFactory.CreateWaterLevelsGeometryPoints(input, getNormativeAssessmentLevelFunc());
revetmentBaseChartData.Points = WaveConditionsChartDataPointsFactory.CreateRevetmentBaseGeometryPoints(input);
revetmentChartData.Points = WaveConditionsChartDataPointsFactory.CreateRevetmentGeometryPoints(input);
Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Factories/WaveConditionsChartDataPointsFactoryTest.cs
===================================================================
diff -u -r5d517d1330fbcd67b88a1f23d01e006e1ad98c1c -r7d7b7e2a678a3cb63cf7e629754a9642abb7034f
--- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Factories/WaveConditionsChartDataPointsFactoryTest.cs (.../WaveConditionsChartDataPointsFactoryTest.cs) (revision 5d517d1330fbcd67b88a1f23d01e006e1ad98c1c)
+++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Factories/WaveConditionsChartDataPointsFactoryTest.cs (.../WaveConditionsChartDataPointsFactoryTest.cs) (revision 7d7b7e2a678a3cb63cf7e629754a9642abb7034f)
@@ -764,33 +764,20 @@
public void CreateDesignWaterLevelGeometryPoints_InputNull_ReturnsEmptyPointsCollection()
{
// Call
- IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(null);
+ IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(null, RoundedDouble.NaN);
// Assert
CollectionAssert.IsEmpty(points);
}
[Test]
- public void CreateDesignWaterLevelGeometryPoints_HydraulicBoundaryLocationNull_ReturnsEmptyPointsCollection()
+ public void CreateDesignWaterLevelGeometryPoints_NormativeAssessmentLevelNaN_ReturnsEmptyPointsCollection()
{
- // Call
- IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(new WaveConditionsInput());
-
- // Assert
- CollectionAssert.IsEmpty(points);
- }
-
- [Test]
- public void CreateDesignWaterLevelGeometryPoints_DesignWaterLevelNaN_ReturnsEmptyPointsCollection()
- {
// Setup
- var input = new WaveConditionsInput
- {
- HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation()
- };
+ var input = new WaveConditionsInput();
// Call
- IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input);
+ IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input, RoundedDouble.NaN);
// Assert
CollectionAssert.IsEmpty(points);
@@ -800,13 +787,10 @@
public void CreateDesignWaterLevelGeometryPoints_NoForeshoreProfile_ReturnsDesignWaterLevelGeometryPointsCollection()
{
// Setup
- var input = new WaveConditionsInput
- {
- HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(6)
- };
+ var input = new WaveConditionsInput();
// Call
- IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input);
+ IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input, GetTestNormativeAssessmentLevel());
// Assert
var expectedPoints = new[]
@@ -823,7 +807,6 @@
// Setup
var input = new WaveConditionsInput
{
- HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(6),
ForeshoreProfile = new TestForeshoreProfile(new[]
{
new Point2D(0, 0),
@@ -833,7 +816,7 @@
};
// Call
- IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input);
+ IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input, GetTestNormativeAssessmentLevel());
// Assert
var expectedPoints = new[]
@@ -853,18 +836,18 @@
IEnumerable foreshoreProfileGeometry)
{
// Setup
+ RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel();
var input = new WaveConditionsInput
{
- HydraulicBoundaryLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(6),
ForeshoreProfile = new TestForeshoreProfile(foreshoreProfileGeometry)
};
// Call
- IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input);
+ IEnumerable points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input, normativeAssessmentLevel);
// Assert
Point2D lastGeometryPoint = foreshoreProfileGeometry.Last();
- double endPointX = (input.HydraulicBoundaryLocation.DesignWaterLevel - lastGeometryPoint.Y) / 3;
+ double endPointX = (normativeAssessmentLevel - lastGeometryPoint.Y) / 3;
var expectedPoints = new[]
{
@@ -1025,5 +1008,10 @@
new Point2D(10, 7)
}).SetName(string.Format(testNameFormat, "ForeshoreProfilePositiveCoordinates"));
}
+
+ private static RoundedDouble GetTestNormativeAssessmentLevel()
+ {
+ return (RoundedDouble) 6;
+ }
}
}
\ No newline at end of file