Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs =================================================================== diff -u -re7e455ded8ce63d7d6694009d2b6d71d6e233bdf -rd16723db8548660eb4586fe7fbd7d8e48c695735 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision e7e455ded8ce63d7d6694009d2b6d71d6e233bdf) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision d16723db8548660eb4586fe7fbd7d8e48c695735) @@ -112,7 +112,8 @@ GetViewData = context => context.Calculation, CloseForData = RingtoetsPluginHelper.ShouldCloseViewWithCalculationData, CreateInstance = context => new WaveConditionsInputView(new StabilityStoneCoverWaveConditionsInputViewStyle(), - () => context.AssessmentSection.GetNormativeAssessmentLevel(context.Calculation.InputParameters.HydraulicBoundaryLocation)) + () => context.AssessmentSection.GetAssessmentLevel(context.Calculation.InputParameters.HydraulicBoundaryLocation, + context.Calculation.InputParameters.CategoryType)) }; } Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverWaveConditionsInputViewInfoTest.cs =================================================================== diff -u -r12eb4df5de341fb318093517a33d805caef22b1a -rd16723db8548660eb4586fe7fbd7d8e48c695735 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverWaveConditionsInputViewInfoTest.cs (.../StabilityStoneCoverWaveConditionsInputViewInfoTest.cs) (revision 12eb4df5de341fb318093517a33d805caef22b1a) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverWaveConditionsInputViewInfoTest.cs (.../StabilityStoneCoverWaveConditionsInputViewInfoTest.cs) (revision d16723db8548660eb4586fe7fbd7d8e48c695735) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections; using System.Drawing; using System.Linq; using Core.Common.Base.Data; @@ -27,9 +28,11 @@ using Core.Common.TestUtil; using Core.Components.Chart.Data; using NUnit.Framework; +using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Common.Plugin.TestUtil; @@ -135,33 +138,26 @@ } [Test] - public void CreateInstance_StabilityStoneCoverWaveConditionsInputContext_ReturnViewWithCorrespondingAssessmentLevel() + [TestCaseSource(nameof(DifferentCategoryTypes))] + public void CreateInstance_WithContextThatHasInputWithSpecificCategoryType_ReturnViewWithCorrespondingAssessmentLevel( + IAssessmentSection assessmentSection, + HydraulicBoundaryLocation hydraulicBoundaryLocation, + AssessmentSectionCategoryType categoryType, + RoundedDouble expectedAssessmentLevel) { // Setup - const double assessmentLevel = 2.2; - - var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); - - var assessmentSection = new AssessmentSectionStub(); - assessmentSection.SetHydraulicBoundaryLocationCalculations(new[] + var calculation = new StabilityStoneCoverWaveConditionsCalculation { - hydraulicBoundaryLocation - }); + InputParameters = + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation, + CategoryType = categoryType + } + }; - assessmentSection.WaterLevelCalculationsForLowerLimitNorm.First().Output = new TestHydraulicBoundaryLocationCalculationOutput(assessmentLevel); - var context = new StabilityStoneCoverWaveConditionsInputContext( - new AssessmentSectionCategoryWaveConditionsInput - { - HydraulicBoundaryLocation = hydraulicBoundaryLocation - }, - new StabilityStoneCoverWaveConditionsCalculation - { - InputParameters = - { - HydraulicBoundaryLocation = hydraulicBoundaryLocation - } - }, + calculation.InputParameters, + calculation, assessmentSection, new ForeshoreProfile[0]); @@ -172,9 +168,48 @@ // Assert ChartDataCollection chartData = view.Chart.Data; var designWaterLevelChartData = (ChartLineData) chartData.Collection.ElementAt(designWaterLevelChartDataIndex); - Assert.AreEqual(assessmentLevel, designWaterLevelChartData.Points.First().Y); + Assert.AreEqual(expectedAssessmentLevel, designWaterLevelChartData.Points.First().Y); } + private static IEnumerable DifferentCategoryTypes() + { + var assessmentSection = new AssessmentSectionStub(); + var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + + assessmentSection.SetHydraulicBoundaryLocationCalculations(new[] + { + hydraulicBoundaryLocation + }, true); + + yield return new TestCaseData( + assessmentSection, + hydraulicBoundaryLocation, + AssessmentSectionCategoryType.FactorizedSignalingNorm, + assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.ElementAt(0).Output.Result + ).SetName("FactorizedSignalingNorm"); + + yield return new TestCaseData( + assessmentSection, + hydraulicBoundaryLocation, + AssessmentSectionCategoryType.SignalingNorm, + assessmentSection.WaterLevelCalculationsForSignalingNorm.ElementAt(0).Output.Result + ).SetName("SignalingNorm"); + + yield return new TestCaseData( + assessmentSection, + hydraulicBoundaryLocation, + AssessmentSectionCategoryType.LowerLimitNorm, + assessmentSection.WaterLevelCalculationsForLowerLimitNorm.ElementAt(0).Output.Result + ).SetName("LowerLimitNorm"); + + yield return new TestCaseData( + assessmentSection, + hydraulicBoundaryLocation, + AssessmentSectionCategoryType.FactorizedLowerLimitNorm, + assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.ElementAt(0).Output.Result + ).SetName("FactorizedLowerLimitNorm"); + } + #region ShouldCloseViewWithCalculationDataTester protected override bool ShouldCloseMethod(IView view, object o)