Index: Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs =================================================================== diff -u -re9c3d4a33eebda4101b3f23e1310fdc029806adc -ree1f859cae82b4321da205d5e1fd339b021f2d7d --- Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision e9c3d4a33eebda4101b3f23e1310fdc029806adc) +++ Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision ee1f859cae82b4321da205d5e1fd339b021f2d7d) @@ -273,13 +273,12 @@ /// A . /// Thrown when /// or the calculated probability falls outside the [0.0, 1.0] range and is not . - private HydraulicBoundaryLocationOutput CreateHydraulicBoundaryLocationOutput( - ICalculationMessageProvider messageProvider, - string hydraulicBoundaryLocationName, - double targetReliability, - double targetProbability, - bool? calculatorConverged, - GeneralResult generalResult) + private HydraulicBoundaryLocationOutput CreateHydraulicBoundaryLocationOutput(ICalculationMessageProvider messageProvider, + string hydraulicBoundaryLocationName, + double targetReliability, + double targetProbability, + bool? calculatorConverged, + GeneralResult generalResult) { double designWaterLevel = calculator.DesignWaterLevel; double reliability = calculator.ReliabilityIndex; Index: Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs =================================================================== diff -u -re9c3d4a33eebda4101b3f23e1310fdc029806adc -ree1f859cae82b4321da205d5e1fd339b021f2d7d --- Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision e9c3d4a33eebda4101b3f23e1310fdc029806adc) +++ Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision ee1f859cae82b4321da205d5e1fd339b021f2d7d) @@ -273,13 +273,12 @@ /// A . /// Thrown when /// or the calculated probability falls outside the [0.0, 1.0] range and is not . - private HydraulicBoundaryLocationOutput CreateHydraulicBoundaryLocationOutput( - ICalculationMessageProvider messageProvider, - string hydraulicBoundaryLocationName, - double targetReliability, - double targetProbability, - bool? calculatorConverged, - GeneralResult generalResult) + private HydraulicBoundaryLocationOutput CreateHydraulicBoundaryLocationOutput(ICalculationMessageProvider messageProvider, + string hydraulicBoundaryLocationName, + double targetReliability, + double targetProbability, + bool? calculatorConverged, + GeneralResult generalResult) { double waveHeight = calculator.WaveHeight; double reliability = calculator.ReliabilityIndex; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/HydraulicBoundaryCalculationWrapperTest.cs =================================================================== diff -u -re9c3d4a33eebda4101b3f23e1310fdc029806adc -ree1f859cae82b4321da205d5e1fd339b021f2d7d --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/HydraulicBoundaryCalculationWrapperTest.cs (.../HydraulicBoundaryCalculationWrapperTest.cs) (revision e9c3d4a33eebda4101b3f23e1310fdc029806adc) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/HydraulicBoundaryCalculationWrapperTest.cs (.../HydraulicBoundaryCalculationWrapperTest.cs) (revision ee1f859cae82b4321da205d5e1fd339b021f2d7d) @@ -88,13 +88,13 @@ }; // Call - var calculation = new HydraulicBoundaryCalculationWrapper(hydraulicBoundaryLocation, hydraulicBoundaryLocationCalculation); + var calculationWrapper = new HydraulicBoundaryCalculationWrapper(hydraulicBoundaryLocation, hydraulicBoundaryLocationCalculation); // Assert - Assert.AreEqual(hydraulicBoundaryLocation.Id, calculation.Id); - Assert.AreSame(hydraulicBoundaryLocation.Name, calculation.Name); - Assert.AreEqual(hydraulicBoundaryLocationCalculation.InputParameters.ShouldIllustrationPointsBeCalculated, calculation.CalculateIllustrationPoints); - Assert.AreSame(hydraulicBoundaryLocation, calculation.ObservableObject); + Assert.AreEqual(hydraulicBoundaryLocation.Id, calculationWrapper.Id); + Assert.AreSame(hydraulicBoundaryLocation.Name, calculationWrapper.Name); + Assert.AreEqual(hydraulicBoundaryLocationCalculation.InputParameters.ShouldIllustrationPointsBeCalculated, calculationWrapper.CalculateIllustrationPoints); + Assert.AreSame(hydraulicBoundaryLocation, calculationWrapper.ObservableObject); } [Test] @@ -119,14 +119,15 @@ // Setup var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(); - var calculation = new HydraulicBoundaryCalculationWrapper(hydraulicBoundaryLocation, hydraulicBoundaryLocationCalculation); + var calculationWrapper = new HydraulicBoundaryCalculationWrapper(hydraulicBoundaryLocation, hydraulicBoundaryLocationCalculation); var output = new TestHydraulicBoundaryLocationOutput(1); // Call - calculation.Output = output; + calculationWrapper.Output = output; // Assert - Assert.AreSame(hydraulicBoundaryLocationCalculation.Output, output); + Assert.AreSame(output, calculationWrapper.Output); + Assert.AreSame(output, hydraulicBoundaryLocationCalculation.Output); } } } \ No newline at end of file Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationPropertiesTest.cs =================================================================== diff -u -ra65b035e6c859fc9a6c8e92becb7f9643d18d243 -ree1f859cae82b4321da205d5e1fd339b021f2d7d --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationPropertiesTest.cs (.../DuneLocationPropertiesTest.cs) (revision a65b035e6c859fc9a6c8e92becb7f9643d18d243) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationPropertiesTest.cs (.../DuneLocationPropertiesTest.cs) (revision ee1f859cae82b4321da205d5e1fd339b021f2d7d) @@ -322,5 +322,20 @@ // Assert Assert.AreEqual(expectedPropertyValue, properties.Offset); } + + [Test] + public void ToString_Always_ExpectedValue() + { + // Setup + var duneLocation = new DuneLocation(1, "Name", new Point2D(0.0, 1.1), new DuneLocation.ConstructionProperties()); + var duneLocationCalculation = new DuneLocationCalculation(); + var properties = new DuneLocationProperties(duneLocation, duneLocationCalculation); + + // Call + string result = properties.ToString(); + + // Assert + Assert.AreEqual($"{duneLocation.Name} {duneLocation.Location}", result); + } } } \ No newline at end of file Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationsPropertiesTest.cs =================================================================== diff -u -r27d409ea2f4b5e37e14cc057512f37e69b5e77c5 -ree1f859cae82b4321da205d5e1fd339b021f2d7d --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationsPropertiesTest.cs (.../DuneLocationsPropertiesTest.cs) (revision 27d409ea2f4b5e37e14cc057512f37e69b5e77c5) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationsPropertiesTest.cs (.../DuneLocationsPropertiesTest.cs) (revision ee1f859cae82b4321da205d5e1fd339b021f2d7d) @@ -41,6 +41,17 @@ private const int requiredLocationsPropertyIndex = 0; [Test] + public void Constructor_LocationsNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new DuneLocationsProperties(null, hbl => new DuneLocationCalculation()); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("locations", exception.ParamName); + } + + [Test] public void Constructor_GetCalculationFuncNull_ThrowsArgumentNullException() { // Call @@ -108,6 +119,8 @@ TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true); Assert.IsInstanceOf(classTypeConverter); + Assert.AreSame(locations, properties.Data); + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(1, dynamicProperties.Count); Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs =================================================================== diff -u -r4dc948e21c0dc0076780aaf48e0c2acf35a4b802 -ree1f859cae82b4321da205d5e1fd339b021f2d7d --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 4dc948e21c0dc0076780aaf48e0c2acf35a4b802) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision ee1f859cae82b4321da205d5e1fd339b021f2d7d) @@ -147,7 +147,9 @@ GetViewName = (view, locations) => RingtoetsGrassCoverErosionOutwardsFormsResources.GrassCoverErosionOutwardsWaterLevelLocations_DisplayName, GetViewData = context => context.WrappedData, Image = RingtoetsCommonFormsResources.GenericInputOutputIcon, - CreateInstance = context => new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(context.FailureMechanism, context.AssessmentSection, () => context.AssessmentSection.FailureMechanismContribution.Norm), + CreateInstance = context => new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(context.FailureMechanism, + context.AssessmentSection, + () => context.AssessmentSection.FailureMechanismContribution.Norm), AfterCreate = (view, context) => { view.CalculationGuiService = hydraulicBoundaryLocationCalculationGuiService; @@ -164,7 +166,9 @@ GetViewData = context => context.WrappedData, CloseForData = CloseGrassCoverErosionOutwardsLocationsViewForData, Image = RingtoetsCommonFormsResources.GenericInputOutputIcon, - CreateInstance = context => new GrassCoverErosionOutwardsWaveHeightLocationsView(context.FailureMechanism, context.AssessmentSection, () => context.AssessmentSection.FailureMechanismContribution.Norm), + CreateInstance = context => new GrassCoverErosionOutwardsWaveHeightLocationsView(context.FailureMechanism, + context.AssessmentSection, + () => context.AssessmentSection.FailureMechanismContribution.Norm), AfterCreate = (view, context) => { view.CalculationGuiService = hydraulicBoundaryLocationCalculationGuiService; Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -r4dc948e21c0dc0076780aaf48e0c2acf35a4b802 -ree1f859cae82b4321da205d5e1fd339b021f2d7d --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 4dc948e21c0dc0076780aaf48e0c2acf35a4b802) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision ee1f859cae82b4321da205d5e1fd339b021f2d7d) @@ -425,6 +425,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -433,6 +434,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func) invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -467,6 +469,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = locations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.DesignWaterLevelCalculation, getCalculationFunc(expectedLocation)); } [Test] @@ -489,6 +492,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -497,6 +501,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func)invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -534,6 +539,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.DesignWaterLevelCalculation, getCalculationFunc(expectedLocation)); } [Test] @@ -555,6 +561,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -563,6 +570,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func)invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -600,6 +608,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.DesignWaterLevelCalculation, getCalculationFunc(expectedLocation)); } private DataGridView GetLocationsDataGridView() Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs =================================================================== diff -u -r4dc948e21c0dc0076780aaf48e0c2acf35a4b802 -ree1f859cae82b4321da205d5e1fd339b021f2d7d --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision 4dc948e21c0dc0076780aaf48e0c2acf35a4b802) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision ee1f859cae82b4321da205d5e1fd339b021f2d7d) @@ -425,6 +425,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -433,6 +434,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func)invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -466,6 +468,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.WaveHeightCalculation, getCalculationFunc(expectedLocation)); } [Test] @@ -488,6 +491,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -496,6 +500,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func)invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -533,6 +538,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.WaveHeightCalculation, getCalculationFunc(expectedLocation)); } [Test] @@ -554,6 +560,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -562,6 +569,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func)invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -599,6 +607,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.WaveHeightCalculation, getCalculationFunc(expectedLocation)); } private DataGridView GetLocationsDataGridView() Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -rcaebe0a4ed7807b5ef15ba294518529341c05900 -ree1f859cae82b4321da205d5e1fd339b021f2d7d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision caebe0a4ed7807b5ef15ba294518529341c05900) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision ee1f859cae82b4321da205d5e1fd339b021f2d7d) @@ -400,6 +400,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -408,6 +409,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func)invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -433,6 +435,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = hydraulicBoundaryDatabase.Locations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.DesignWaterLevelCalculation, getCalculationFunc(expectedLocation)); } [Test] @@ -463,6 +466,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -471,6 +475,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func)invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -496,6 +501,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = hydraulicBoundaryDatabase.Locations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.DesignWaterLevelCalculation, getCalculationFunc(expectedLocation)); } [Test] @@ -525,6 +531,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -533,6 +540,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func)invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -558,6 +566,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = hydraulicBoundaryDatabase.Locations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.DesignWaterLevelCalculation, getCalculationFunc(expectedLocation)); } private DataGridView GetLocationsDataGridView() Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs =================================================================== diff -u -r9a848a7f52c953e8a44544609d919ea45ac84c6e -ree1f859cae82b4321da205d5e1fd339b021f2d7d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 9a848a7f52c953e8a44544609d919ea45ac84c6e) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision ee1f859cae82b4321da205d5e1fd339b021f2d7d) @@ -400,6 +400,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -408,6 +409,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func) invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -433,6 +435,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = hydraulicBoundaryDatabase.Locations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.WaveHeightCalculation, getCalculationFunc(expectedLocation)); } [Test] @@ -463,6 +466,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -471,6 +475,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func) invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -496,6 +501,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = hydraulicBoundaryDatabase.Locations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.WaveHeightCalculation, getCalculationFunc(expectedLocation)); } [Test] @@ -525,6 +531,7 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; HydraulicBoundaryLocation[] calculatedLocationsValue = null; + Func getCalculationFunc = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( @@ -533,6 +540,7 @@ hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); + getCalculationFunc = (Func) invocation.Arguments[3]; normValue = (double) invocation.Arguments[4]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; }); @@ -558,6 +566,7 @@ Assert.AreEqual(1, calculatedLocationsValue.Length); HydraulicBoundaryLocation expectedLocation = hydraulicBoundaryDatabase.Locations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); + Assert.AreSame(expectedLocation.WaveHeightCalculation, getCalculationFunc(expectedLocation)); } private DataGridView GetLocationsDataGridView()