Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs =================================================================== diff -u -r50e1d812cc1052ab89ed516efb97991d03287634 -re1e46824d33ee0e3ac6cca4416ffb4a55a12148c --- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision 50e1d812cc1052ab89ed516efb97991d03287634) +++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision e1e46824d33ee0e3ac6cca4416ffb4a55a12148c) @@ -124,8 +124,7 @@ CloseForData = RiskeerPluginHelper.ShouldCloseViewWithCalculationData, CreateInstance = context => new WaveConditionsInputView( context.Calculation, - () => context.AssessmentSection.GetHydraulicBoundaryLocationCalculation(context.Calculation.InputParameters.HydraulicBoundaryLocation, - context.Calculation.InputParameters.CategoryType), + () => WaveConditionsInputHelper.GetHydraulicBoundaryLocationCalculation(context.WrappedData, context.AssessmentSection), new WaveImpactAsphaltCoverWaveConditionsInputViewStyle()) }; } Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs =================================================================== diff -u -r1dd2c22368f99235c15314f434505d4b5fc27a90 -re1e46824d33ee0e3ac6cca4416ffb4a55a12148c --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs) (revision 1dd2c22368f99235c15314f434505d4b5fc27a90) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs) (revision e1e46824d33ee0e3ac6cca4416ffb4a55a12148c) @@ -22,6 +22,7 @@ using System; using System.Drawing; using System.Linq; +using Core.Common.Base.Data; using Core.Common.Controls.Views; using Core.Common.TestUtil; using Core.Components.Chart.Data; @@ -36,6 +37,7 @@ using Riskeer.Common.Forms.PresentationObjects; using Riskeer.Common.Plugin.TestUtil; using Riskeer.Revetment.Data; +using Riskeer.Revetment.Data.TestUtil; using Riskeer.Revetment.Forms.Views; using Riskeer.WaveImpactAsphaltCover.Data; using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects; @@ -104,7 +106,7 @@ new AssessmentSectionCategoryWaveConditionsInput(), calculation, new AssessmentSectionStub(), - new ForeshoreProfile[0]); + Array.Empty()); // Call var view = (WaveConditionsInputView) info.CreateInstance(context); @@ -126,37 +128,39 @@ [Test] [TestCaseSource( - typeof(AssessmentSectionTestHelper), - nameof(AssessmentSectionTestHelper.GetHydraulicBoundaryLocationCalculationConfigurationPerAssessmentSectionCategoryType))] - public void CreateInstance_WithContextThatHasInputWithSpecificCategoryType_ReturnViewWithCorrespondingAssessmentLevel( + typeof(WaveConditionsInputTestHelper), + nameof(WaveConditionsInputTestHelper.GetAssessmentLevelConfigurationPerWaterLevelType))] + public void CreateInstance_WithContextThatHasInputWithSpecificWaterLevelType_ReturnViewWithCorrespondingAssessmentLevel( IAssessmentSection assessmentSection, - HydraulicBoundaryLocation hydraulicBoundaryLocation, - AssessmentSectionCategoryType categoryType, - HydraulicBoundaryLocationCalculation expectedHydraulicBoundaryLocationCalculation) + Action configureInputAction, + RoundedDouble expectedAssessmentLevel) { // Setup - var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation - { - InputParameters = - { - HydraulicBoundaryLocation = hydraulicBoundaryLocation, - CategoryType = categoryType - } - }; + var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation(); + configureInputAction(calculation.InputParameters); + var context = new WaveImpactAsphaltCoverWaveConditionsInputContext( calculation.InputParameters, calculation, assessmentSection, - new ForeshoreProfile[0]); + Array.Empty()); // Call var view = (WaveConditionsInputView) info.CreateInstance(context); // Assert ChartDataCollection chartData = view.Chart.Data; var designWaterLevelChartData = (ChartLineData) chartData.Collection.ElementAt(designWaterLevelChartDataIndex); - Assert.AreEqual(expectedHydraulicBoundaryLocationCalculation.Output.Result, designWaterLevelChartData.Points.First().Y); + + if (expectedAssessmentLevel != RoundedDouble.NaN) + { + Assert.AreEqual(expectedAssessmentLevel, designWaterLevelChartData.Points.First().Y); + } + else + { + Assert.IsEmpty(designWaterLevelChartData.Points); + } } #region ShouldCloseViewWithCalculationDataTester