Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveConditionsInputViewInfoTest.cs =================================================================== diff -u -r10a580f9d181a02ed67f162ff3dd10889906142b -r20e1c7320f826ad749b155d6fd5b521e3a2dbeee --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveConditionsInputViewInfoTest.cs (.../WaveConditionsInputViewInfoTest.cs) (revision 10a580f9d181a02ed67f162ff3dd10889906142b) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveConditionsInputViewInfoTest.cs (.../WaveConditionsInputViewInfoTest.cs) (revision 20e1c7320f826ad749b155d6fd5b521e3a2dbeee) @@ -431,7 +431,7 @@ } [Test] - [TestCaseSource(nameof(GetInputContextDatas))] + [TestCaseSource(nameof(GetInputContextDatasWithExpectedStyling))] public void CreateInstance_WaveConditionsInputContext_ReturnViewWithStylingApplied(WaveConditionsInputContext context, Color revetmentLineColor, string designWaterLevelName) @@ -456,6 +456,20 @@ Assert.AreEqual(revetmentLineColor, revetmentChartData.Style.Color); } + [Test] + [TestCaseSource(nameof(GetInputContextDatasWithExpectedAssessmentLevel))] + public void CreateInstance_WaveConditionsInputContext_ReturnViewWithCorrespondingAssessmentLevel(WaveConditionsInputContext context, double assessmentLevel) + { + // Call + var view = (WaveConditionsInputView) info.CreateInstance(context); + view.Data = context.Calculation; + + // Assert + ChartDataCollection chartData = view.Chart.Data; + var designWaterLevelChartData = (ChartLineData) chartData.Collection.ElementAt(designWaterLevelChartDataIndex); + Assert.AreEqual(assessmentLevel, designWaterLevelChartData.Points.First().Y); + } + private static RoundedDouble GetTestNormativeAssessmentLevel() { return (RoundedDouble) 1.1; @@ -469,7 +483,7 @@ private const int revetmentBaseChartDataIndex = 7; private const int revetmentChartDataIndex = 8; - private static IEnumerable GetInputContextDatas() + private static IEnumerable GetInputContextDatasWithExpectedStyling() { yield return new TestCaseData( new GrassCoverErosionOutwardsWaveConditionsInputContext( @@ -502,6 +516,76 @@ .SetName("Wave impact asphalt cover input context"); } + private static IEnumerable GetInputContextDatasWithExpectedAssessmentLevel() + { + const double assessmentLevel1 = 1.1; + const double assessmentLevel2 = 2.2; + + var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation + { + DesignWaterLevelCalculation1 = + { + Output = new TestHydraulicBoundaryLocationOutput(assessmentLevel1) + }, + DesignWaterLevelCalculation3 = + { + Output = new TestHydraulicBoundaryLocationOutput(assessmentLevel2) + } + }; + + var waveConditionsInput = new WaveConditionsInput + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation + }; + + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + yield return new TestCaseData( + new GrassCoverErosionOutwardsWaveConditionsInputContext( + waveConditionsInput, + new GrassCoverErosionOutwardsWaveConditionsCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation + } + }, + assessmentSection, + new GrassCoverErosionOutwardsFailureMechanism()), + assessmentLevel1) + .SetName("Grass outwards input context"); + + yield return new TestCaseData( + new StabilityStoneCoverWaveConditionsInputContext( + waveConditionsInput, + new StabilityStoneCoverWaveConditionsCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation + } + }, + assessmentSection, + new ForeshoreProfile[0]), + assessmentLevel2) + .SetName("Stability stone cover input context"); + + yield return new TestCaseData( + new WaveImpactAsphaltCoverWaveConditionsInputContext( + waveConditionsInput, + new WaveImpactAsphaltCoverWaveConditionsCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation + } + }, + assessmentSection, + new ForeshoreProfile[0]), + assessmentLevel2) + .SetName("Wave impact asphalt cover input context"); + } + private static IEnumerable GetCalculationContextDatas(string testNameFormat) { var grassCoverErosionOutwardsWaveConditionsCalculation = new GrassCoverErosionOutwardsWaveConditionsCalculation();