Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs =================================================================== diff -u -r248d8a19f75dff2b22237c139199914e1047f103 -r36f4d51d69a11467523957f85e0ef1f4731aee01 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs (.../WaveConditionsInputViewTest.cs) (revision 248d8a19f75dff2b22237c139199914e1047f103) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs (.../WaveConditionsInputViewTest.cs) (revision 36f4d51d69a11467523957f85e0ef1f4731aee01) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using Core.Common.Base; @@ -126,6 +127,23 @@ } [Test] + public void Data_EmptyCalculation_NoChartDataSet() + { + // Setup + using (var view = new WaveConditionsInputView()) + { + var calculation = new TestWaveConditionsCalculation(); + calculation.InputParameters.ForeshoreProfile = null; + + // Call + view.Data = calculation; + + // Assert + AssertEmptyChartData(view.Chart.Data); + } + } + + [Test] public void Data_SetChartData_ChartDataSet() { // Setup @@ -231,10 +249,10 @@ { var foreshoreChartData = (ChartLineData) view.Chart.Data.Collection.ElementAt(0); foreshoreChartData.Attach(observer); - ForeshoreProfile profile2 = new TestForeshoreProfile(new [] + ForeshoreProfile profile2 = new TestForeshoreProfile(new[] { - new Point2D(0, 0), - new Point2D(3, 3), + new Point2D(0, 0), + new Point2D(3, 3), new Point2D(8, 8) }); @@ -285,6 +303,21 @@ } } + private static void AssertEmptyChartData(ChartDataCollection chartDataCollection) + { + Assert.AreEqual("Invoer", chartDataCollection.Name); + + List chartDatasList = chartDataCollection.Collection.ToList(); + + Assert.AreEqual(1, chartDatasList.Count); + + var foreshoreData = (ChartLineData) chartDatasList[0]; + + CollectionAssert.IsEmpty(foreshoreData.Points); + + Assert.AreEqual("Voorlandprofiel", foreshoreData.Name); + } + private static void AssertForeshoreChartData(ForeshoreProfile foreshoreProfile, ChartData chartData) { Assert.IsInstanceOf(chartData);