Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PropertyClasses/WaveConditionsInputContextPropertiesTest.cs =================================================================== diff -u -re444a84b4fbf8411cd3237eb2e836df68790652b -ra073f90798f50ba8c37b59664beddebf61db30b9 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PropertyClasses/WaveConditionsInputContextPropertiesTest.cs (.../WaveConditionsInputContextPropertiesTest.cs) (revision e444a84b4fbf8411cd3237eb2e836df68790652b) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PropertyClasses/WaveConditionsInputContextPropertiesTest.cs (.../WaveConditionsInputContextPropertiesTest.cs) (revision a073f90798f50ba8c37b59664beddebf61db30b9) @@ -91,31 +91,14 @@ public void Constructor_DataNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new TestWaveConditionsInputContextProperties(null, GetTestNormativeAssessmentLevel, handler); + TestDelegate test = () => new TestWaveConditionsInputContextProperties(null, GetTestNormativeAssessmentLevel(), handler); // Assert string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("context", paramName); } [Test] - public void Constructor_GetNormativeAssessmentLevelFuncNull_ThrowsArgumentNullException() - { - // Setup - var context = new TestWaveConditionsInputContext( - new WaveConditionsInput(), - Enumerable.Empty(), - Enumerable.Empty()); - - // Call - TestDelegate test = () => new TestWaveConditionsInputContextProperties(context, null, handler); - - // Assert - var exception = Assert.Throws(test); - Assert.AreEqual("getNormativeAssessmentLevelFunc", exception.ParamName); - } - - [Test] public void Constructor_PropertyChangeHandlerNull_ThrowsArgumentNullException() { // Setup @@ -125,7 +108,7 @@ Enumerable.Empty()); // Call - TestDelegate test = () => new TestWaveConditionsInputContextProperties(context, GetTestNormativeAssessmentLevel, null); + TestDelegate test = () => new TestWaveConditionsInputContextProperties(context, GetTestNormativeAssessmentLevel(), null); // Assert var exception = Assert.Throws(test); @@ -174,7 +157,7 @@ var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], new HydraulicBoundaryLocation[0]); // Call - var properties = new TestWaveConditionsInputContextProperties(inputContext, () => assessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, assessmentLevel, handler); // Assert Assert.IsInstanceOf>(properties); @@ -227,7 +210,7 @@ }, new HydraulicBoundaryLocation[0]); // Call - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel(), handler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -368,7 +351,7 @@ var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], new HydraulicBoundaryLocation[0]); // Call - var properties = new TestWaveConditionsInputContextProperties(inputContext, () => assessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, assessmentLevel, handler); // Assert Assert.IsNotEmpty(properties.WaterLevels); @@ -462,7 +445,7 @@ var input = new WaveConditionsInput(); var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], new HydraulicBoundaryLocation[0]); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel(), handler); SelectableHydraulicBoundaryLocation selectedHydraulicBoundaryLocation = null; @@ -490,7 +473,7 @@ }; var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], locations); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel(), handler); // Call IEnumerable availableHydraulicBoundaryLocations = @@ -520,7 +503,7 @@ ForeshoreProfile = new TestForeshoreProfile(new Point2D(200620.173572981, 503401.652985217)) }; var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], new HydraulicBoundaryLocation[0]); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel(), handler); // Call SelectableHydraulicBoundaryLocation selectedHydraulicBoundaryLocation = properties.SelectedHydraulicBoundaryLocation; @@ -554,7 +537,7 @@ }; var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], locations); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel(), handler); // When IEnumerable availableHydraulicBoundaryLocations = @@ -582,7 +565,7 @@ var input = new WaveConditionsInput(); var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], locations); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel(), handler); // Call IEnumerable availableHydraulicBoundaryLocations = properties.GetSelectableHydraulicBoundaryLocations(); @@ -614,7 +597,7 @@ }; var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], locations); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel(), handler); // Call IEnumerable availableHydraulicBoundaryLocations = properties.GetSelectableHydraulicBoundaryLocations(); @@ -651,7 +634,7 @@ var otherProfile = new TestForeshoreProfile(new Point2D(0, 190)); var customHandler = new SetPropertyValueAfterConfirmationParameterTester(Enumerable.Empty()); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, customHandler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel(), customHandler); IEnumerable originalList = properties.GetSelectableHydraulicBoundaryLocations() .ToList(); @@ -685,7 +668,7 @@ var input = new WaveConditionsInput(); var inputContext = new TestWaveConditionsInputContext(input, locations, new HydraulicBoundaryLocation[0]); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel(), handler); // Call IEnumerable availableForeshoreProfiles = properties.GetAvailableForeshoreProfiles(); @@ -703,8 +686,10 @@ mocks.ReplayAll(); var calculation = new TestWaveConditionsCalculation(); - var input = new WaveConditionsInput(); - input.ForeshoreProfile = new TestForeshoreProfile(); + var input = new WaveConditionsInput + { + ForeshoreProfile = new TestForeshoreProfile() + }; var context = new TestWaveConditionsInputContext(input, calculation, @@ -717,7 +702,7 @@ observable }); - var properties = new TestWaveConditionsInputContextProperties(context, GetTestNormativeAssessmentLevel, customHandler); + var properties = new TestWaveConditionsInputContextProperties(context, GetTestNormativeAssessmentLevel(), customHandler); // Call setProperty(properties); @@ -735,9 +720,9 @@ private class TestWaveConditionsInputContextProperties : WaveConditionsInputContextProperties { public TestWaveConditionsInputContextProperties(WaveConditionsInputContext context, - Func getNormativeAssessmentLevelFunc, + RoundedDouble normativeAssessmentLevel, IObservablePropertyChangeHandler handler) - : base(context, getNormativeAssessmentLevelFunc, handler) {} + : base(context, normativeAssessmentLevel, handler) {} public override string RevetmentType {