Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs =================================================================== diff -u -rd8c4ceab914f43e5cfab5f0472477d44ff5fc81f -rdf02e0f3f8fe431d194cf440d5bc39d1f2497b59 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs (.../DesignWaterLevelLocationsView.cs) (revision d8c4ceab914f43e5cfab5f0472477d44ff5fc81f) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs (.../DesignWaterLevelLocationsView.cs) (revision df02e0f3f8fe431d194cf440d5bc39d1f2497b59) @@ -37,27 +37,31 @@ /// public partial class DesignWaterLevelLocationsView : HydraulicBoundaryLocationsView { - private readonly double norm; + private readonly Func getNormFunc; private readonly DesignWaterLevelCalculationMessageProvider messageProvider; /// /// Creates a new instance of . /// /// The locations to show in the view. /// The assessment section which the locations belong to. - /// The norm to use during calculations. - /// Thrown when or - /// is null. + /// for getting the norm to use during calculations. + /// Thrown when any input parameter is null. public DesignWaterLevelLocationsView(ObservableList locations, IAssessmentSection assessmentSection, - double norm) + Func getNormFunc) : base(locations, assessmentSection) { + if (getNormFunc == null) + { + throw new ArgumentNullException(nameof(getNormFunc)); + } + InitializeComponent(); messageProvider = new DesignWaterLevelCalculationMessageProvider(); - this.norm = norm; + this.getNormFunc = getNormFunc; } protected override object CreateSelectedItemFromCurrentRow() @@ -75,7 +79,7 @@ AssessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), locations, hbl => hbl.DesignWaterLevelCalculation, - norm, + getNormFunc(), messageProvider); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -r384159a25f7e4598081e23c92fde39578b078434 -rdf02e0f3f8fe431d194cf440d5bc39d1f2497b59 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 384159a25f7e4598081e23c92fde39578b078434) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision df02e0f3f8fe431d194cf440d5bc39d1f2497b59) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -72,6 +73,21 @@ } [Test] + public void Constructor_GetNormFuncNull_ThrowsArgumentNullException() + { + // Setup + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); + mockRepository.ReplayAll(); + + // Call + TestDelegate test = () => new DesignWaterLevelLocationsView(new ObservableList(), assessmentSection, null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("getNormFunc", exception.ParamName); + } + + [Test] public void Constructor_ExpectedValues() { // Setup