Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs =================================================================== diff -u -r6cebfd1214a436c86e4d4b4f930ae77a69b0499d -ra84c93d532432d0aac54202eb1a4514ac9a9b21c --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs (.../WaveConditionsInputViewTest.cs) (revision 6cebfd1214a436c86e4d4b4f930ae77a69b0499d) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs (.../WaveConditionsInputViewTest.cs) (revision a84c93d532432d0aac54202eb1a4514ac9a9b21c) @@ -190,6 +190,9 @@ AssertRevetmentBaseChartData(calculation.InputParameters.ForeshoreGeometry.Last(), calculation.InputParameters.LowerBoundaryRevetment, chartData.Collection.ElementAt(revetmentBaseChartDataIndex)); + AssertLowerBoundaryRevetmentChartData(calculation.InputParameters.ForeshoreGeometry, + calculation.InputParameters.LowerBoundaryRevetment, + chartData.Collection.ElementAt(lowerBoundaryRevetmentChartDataIndex)); } } @@ -261,7 +264,7 @@ // Setup var mocks = new MockRepository(); var observer = mocks.StrictMock(); - observer.Expect(o => o.UpdateObserver()).Repeat.Times(3); + observer.Expect(o => o.UpdateObserver()).Repeat.Times(4); mocks.ReplayAll(); var calculation = new TestWaveConditionsCalculation @@ -287,10 +290,12 @@ var foreshoreChartData = (ChartLineData) view.Chart.Data.Collection.ElementAt(foreShoreChartDataIndex); var revetmentChartData = (ChartLineData) view.Chart.Data.Collection.ElementAt(revetmentChartDataIndex); var revetmentBaseChartData = (ChartLineData) view.Chart.Data.Collection.ElementAt(revetmentBaseChartDataIndex); + var lowerBoundaryRevetmentChartData = (ChartLineData) view.Chart.Data.Collection.ElementAt(lowerBoundaryRevetmentChartDataIndex); foreshoreChartData.Attach(observer); revetmentChartData.Attach(observer); revetmentBaseChartData.Attach(observer); + lowerBoundaryRevetmentChartData.Attach(observer); ForeshoreProfile profile2 = new TestForeshoreProfile(new[] { @@ -312,7 +317,12 @@ AssertForeshoreChartData(profile2, foreshoreChartData); AssertRevetmentChartData(profile2.Geometry.Last(), calculation.InputParameters.LowerBoundaryRevetment, calculation.InputParameters.UpperBoundaryRevetment, revetmentChartData); - AssertRevetmentBaseChartData(profile2.Geometry.Last(), calculation.InputParameters.LowerBoundaryRevetment, revetmentBaseChartData); + AssertRevetmentBaseChartData(profile2.Geometry.Last(), + calculation.InputParameters.LowerBoundaryRevetment, + revetmentBaseChartData); + AssertLowerBoundaryRevetmentChartData(calculation.InputParameters.ForeshoreGeometry, + calculation.InputParameters.LowerBoundaryRevetment, + lowerBoundaryRevetmentChartData); mocks.VerifyAll(); } } @@ -400,11 +410,11 @@ Assert.IsInstanceOf(chartData); var revetmentChartData = (ChartLineData) chartData; - double startPointX = (lowerBoundaryRevetment - lastForeshorePoint.Y) / 3; + double startPointX = ((lowerBoundaryRevetment - lastForeshorePoint.Y) / 3) + lastForeshorePoint.X; double deltaY = upperBoundaryRevetment - lowerBoundaryRevetment; var expectedGeometry = new[] { - new Point2D(startPointX + lastForeshorePoint.X, lowerBoundaryRevetment), + new Point2D(startPointX, lowerBoundaryRevetment), new Point2D(deltaY / 3 + startPointX, upperBoundaryRevetment) }; @@ -432,5 +442,26 @@ Assert.AreEqual("Bekleding", revetmentChartData.Name); } + + private static void AssertLowerBoundaryRevetmentChartData(RoundedPoint2DCollection foreshorePoints, + double lowerBoundaryRevetment, + ChartData chartData) + { + Assert.IsInstanceOf(chartData); + var revetmentChartData = (ChartLineData)chartData; + + Point2D lastForeshorePoint = foreshorePoints.Last(); + double endPointX = (lowerBoundaryRevetment - lastForeshorePoint.Y) / 3; + + var expectedGeometry = new[] + { + new Point2D(foreshorePoints.First().X, lowerBoundaryRevetment), + new Point2D(endPointX + lastForeshorePoint.X, lowerBoundaryRevetment) + }; + + CollectionAssert.AreEqual(expectedGeometry, revetmentChartData.Points); + + Assert.AreEqual("Ondergrens bekleding", revetmentChartData.Name); + } } } \ No newline at end of file