Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/DesignWaterLevelCalculation.cs =================================================================== diff -u -r0af56a3dcb9ca14f10534fbddc99286023b605ee -r0225653c669d19e281784bea8146c25bfe568a29 --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/DesignWaterLevelCalculation.cs (.../DesignWaterLevelCalculation.cs) (revision 0af56a3dcb9ca14f10534fbddc99286023b605ee) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/DesignWaterLevelCalculation.cs (.../DesignWaterLevelCalculation.cs) (revision 0225653c669d19e281784bea8146c25bfe568a29) @@ -50,7 +50,7 @@ if (hydraulicBoundaryLocationCalculation == null) { - throw new ArgumentNullException(nameof(hydraulicBoundaryLocation)); + throw new ArgumentNullException(nameof(hydraulicBoundaryLocationCalculation)); } this.hydraulicBoundaryLocation = hydraulicBoundaryLocation; Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/WaveHeightCalculation.cs =================================================================== diff -u -r0af56a3dcb9ca14f10534fbddc99286023b605ee -r0225653c669d19e281784bea8146c25bfe568a29 --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/WaveHeightCalculation.cs (.../WaveHeightCalculation.cs) (revision 0af56a3dcb9ca14f10534fbddc99286023b605ee) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/WaveHeightCalculation.cs (.../WaveHeightCalculation.cs) (revision 0225653c669d19e281784bea8146c25bfe568a29) @@ -50,7 +50,7 @@ if (hydraulicBoundaryLocationCalculation == null) { - throw new ArgumentNullException(nameof(hydraulicBoundaryLocation)); + throw new ArgumentNullException(nameof(hydraulicBoundaryLocationCalculation)); } this.hydraulicBoundaryLocation = hydraulicBoundaryLocation; Index: Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/HydraulicBoundaryLocationCalculationGuiService.cs =================================================================== diff -u -ra35b3daf3f5adce226ce869c2c45d465dd2c985a -r0225653c669d19e281784bea8146c25bfe568a29 --- Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/HydraulicBoundaryLocationCalculationGuiService.cs (.../HydraulicBoundaryLocationCalculationGuiService.cs) (revision a35b3daf3f5adce226ce869c2c45d465dd2c985a) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/HydraulicBoundaryLocationCalculationGuiService.cs (.../HydraulicBoundaryLocationCalculationGuiService.cs) (revision 0225653c669d19e281784bea8146c25bfe568a29) @@ -65,16 +65,21 @@ double norm, ICalculationMessageProvider messageProvider) { - if (messageProvider == null) + if (locations == null) { - throw new ArgumentNullException(nameof(messageProvider)); + throw new ArgumentNullException(nameof(locations)); } - if (locations == null) + if (getCalculationFunc == null) { - throw new ArgumentNullException(nameof(locations)); + throw new ArgumentNullException(nameof(getCalculationFunc)); } + if (messageProvider == null) + { + throw new ArgumentNullException(nameof(messageProvider)); + } + RunActivities(hydraulicBoundaryDatabaseFilePath, preprocessorDirectory, locations.Select(location => new DesignWaterLevelCalculationActivity(new DesignWaterLevelCalculation(location, getCalculationFunc(location)), @@ -91,16 +96,21 @@ double norm, ICalculationMessageProvider messageProvider) { - if (messageProvider == null) + if (locations == null) { - throw new ArgumentNullException(nameof(messageProvider)); + throw new ArgumentNullException(nameof(locations)); } - if (locations == null) + if (getCalculationFunc == null) { - throw new ArgumentNullException(nameof(locations)); + throw new ArgumentNullException(nameof(getCalculationFunc)); } + if (messageProvider == null) + { + throw new ArgumentNullException(nameof(messageProvider)); + } + RunActivities(hydraulicBoundaryDatabaseFilePath, preprocessorDirectory, locations.Select(location => new WaveHeightCalculationActivity(new WaveHeightCalculation(location, getCalculationFunc(location)), Index: Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/IHydraulicBoundaryLocationCalculationGuiService.cs =================================================================== diff -u -rc57ec815a985272c07c2ae21dc777e2ae1f61fa5 -r0225653c669d19e281784bea8146c25bfe568a29 --- Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/IHydraulicBoundaryLocationCalculationGuiService.cs (.../IHydraulicBoundaryLocationCalculationGuiService.cs) (revision c57ec815a985272c07c2ae21dc777e2ae1f61fa5) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/IHydraulicBoundaryLocationCalculationGuiService.cs (.../IHydraulicBoundaryLocationCalculationGuiService.cs) (revision 0225653c669d19e281784bea8146c25bfe568a29) @@ -45,8 +45,8 @@ /// The message provider for the services. /// Preprocessing is disabled when /// equals . - /// Thrown when , - /// or is null. + /// Thrown when , + /// or is null. void CalculateDesignWaterLevels(string hydraulicBoundaryDatabaseFilePath, string preprocessorDirectory, IEnumerable locations, @@ -67,8 +67,8 @@ /// The message provider for the services. /// Preprocessing is disabled when /// equals . - /// Thrown when , - /// or is null. + /// Thrown when , + /// or is null. void CalculateWaveHeights(string hydraulicBoundaryDatabaseFilePath, string preprocessorDirectory, IEnumerable locations, Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs =================================================================== diff -u -r4d7ed7b9b61c4eb4e41cbec33d5baf2ac05905c4 -r0225653c669d19e281784bea8146c25bfe568a29 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs (.../HydraulicBoundaryLocationCalculationGuiServiceTest.cs) (revision 4d7ed7b9b61c4eb4e41cbec33d5baf2ac05905c4) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs (.../HydraulicBoundaryLocationCalculationGuiServiceTest.cs) (revision 0225653c669d19e281784bea8146c25bfe568a29) @@ -73,10 +73,11 @@ } [Test] - public void CalculateDesignWaterLevels_CalculationServiceMessageProviderNull_ThrowsArgumentNullException() + public void CalculateDesignWaterLevels_LocationsNull_ThrowsArgumentNullException() { // Setup var calculatorFactory = mockRepository.StrictMock(); + var calculationMessageProvider = mockRepository.StrictMock(); mockRepository.ReplayAll(); using (var viewParent = new Form()) @@ -87,22 +88,22 @@ // Call TestDelegate test = () => guiService.CalculateDesignWaterLevels(validFilePath, validPreprocessorDirectory, - Enumerable.Empty(), + null, hbl => new HydraulicBoundaryLocationCalculation(), 1, - null); + calculationMessageProvider); // Assert string paramName = Assert.Throws(test).ParamName; - const string expectedParamName = "messageProvider"; + const string expectedParamName = "locations"; Assert.AreEqual(expectedParamName, paramName); } mockRepository.VerifyAll(); } [Test] - public void CalculateDesignWaterLevels_LocationsNull_ThrowsArgumentNullException() + public void CalculateDesignWaterLevels_GetCalculationFuncNull_ThrowsArgumentNullException() { // Setup var calculatorFactory = mockRepository.StrictMock(); @@ -117,26 +118,25 @@ // Call TestDelegate test = () => guiService.CalculateDesignWaterLevels(validFilePath, validPreprocessorDirectory, + Enumerable.Empty(), null, - hbl => new HydraulicBoundaryLocationCalculation(), 1, calculationMessageProvider); // Assert string paramName = Assert.Throws(test).ParamName; - const string expectedParamName = "locations"; + const string expectedParamName = "getCalculationFunc"; Assert.AreEqual(expectedParamName, paramName); } mockRepository.VerifyAll(); } [Test] - public void CalculateDesignWaterLevels_GetCalculationFuncNull_ThrowsArgumentNullException() + public void CalculateDesignWaterLevels_CalculationServiceMessageProviderNull_ThrowsArgumentNullException() { // Setup var calculatorFactory = mockRepository.StrictMock(); - var calculationMessageProvider = mockRepository.StrictMock(); mockRepository.ReplayAll(); using (var viewParent = new Form()) @@ -148,13 +148,13 @@ TestDelegate test = () => guiService.CalculateDesignWaterLevels(validFilePath, validPreprocessorDirectory, Enumerable.Empty(), - null, + hbl => new HydraulicBoundaryLocationCalculation(), 1, - calculationMessageProvider); + null); // Assert string paramName = Assert.Throws(test).ParamName; - const string expectedParamName = "getCalculationFunc"; + const string expectedParamName = "messageProvider"; Assert.AreEqual(expectedParamName, paramName); } @@ -283,10 +283,11 @@ } [Test] - public void CalculateWaveHeights_CalculationServiceMessageProviderNull_ThrowsArgumentNullException() + public void CalculateWaveHeights_LocationsNull_ThrowsArgumentNullException() { // Setup var calculatorFactory = mockRepository.StrictMock(); + var calculationMessageProvider = mockRepository.StrictMock(); mockRepository.ReplayAll(); using (var viewParent = new Form()) @@ -297,22 +298,22 @@ // Call TestDelegate test = () => guiService.CalculateWaveHeights(validFilePath, validPreprocessorDirectory, - Enumerable.Empty(), + null, hbl => new HydraulicBoundaryLocationCalculation(), 1, - null); + calculationMessageProvider); // Assert string paramName = Assert.Throws(test).ParamName; - const string expectedParamName = "messageProvider"; + const string expectedParamName = "locations"; Assert.AreEqual(expectedParamName, paramName); } mockRepository.VerifyAll(); } [Test] - public void CalculateWaveHeights_LocationsNull_ThrowsArgumentNullException() + public void CalculateWaveHeights_GetCalculationFuncNull_ThrowsArgumentNullException() { // Setup var calculatorFactory = mockRepository.StrictMock(); @@ -327,26 +328,25 @@ // Call TestDelegate test = () => guiService.CalculateWaveHeights(validFilePath, validPreprocessorDirectory, + Enumerable.Empty(), null, - hbl => new HydraulicBoundaryLocationCalculation(), 1, calculationMessageProvider); // Assert string paramName = Assert.Throws(test).ParamName; - const string expectedParamName = "locations"; + const string expectedParamName = "getCalculationFunc"; Assert.AreEqual(expectedParamName, paramName); } mockRepository.VerifyAll(); } [Test] - public void CalculateWaveHeights_GetCalculationFuncNull_ThrowsArgumentNullException() + public void CalculateWaveHeights_CalculationServiceMessageProviderNull_ThrowsArgumentNullException() { // Setup var calculatorFactory = mockRepository.StrictMock(); - var calculationMessageProvider = mockRepository.StrictMock(); mockRepository.ReplayAll(); using (var viewParent = new Form()) @@ -358,13 +358,13 @@ TestDelegate test = () => guiService.CalculateWaveHeights(validFilePath, validPreprocessorDirectory, Enumerable.Empty(), - null, + hbl => new HydraulicBoundaryLocationCalculation(), 1, - calculationMessageProvider); + null); // Assert string paramName = Assert.Throws(test).ParamName; - const string expectedParamName = "getCalculationFunc"; + const string expectedParamName = "messageProvider"; Assert.AreEqual(expectedParamName, paramName); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -r75d12c89224759df39acf21f187f309a3e4ae274 -r0225653c669d19e281784bea8146c25bfe568a29 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 0225653c669d19e281784bea8146c25bfe568a29) @@ -299,7 +299,7 @@ var guiService = mockRepository.StrictMock(); IEnumerable locations = null; - guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, 1, null)).IgnoreArguments().WhenCalled( + guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, 1, null)).IgnoreArguments().WhenCalled( invocation => { locations = (IEnumerable) invocation.Arguments[2]; }); mockRepository.ReplayAll(); @@ -361,7 +361,7 @@ HydraulicBoundaryLocation[] calculatedLocationsValue = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; - guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, 1, null)).IgnoreArguments().WhenCalled( + guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, 1, null)).IgnoreArguments().WhenCalled( invocation => { hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); @@ -423,7 +423,7 @@ HydraulicBoundaryLocation[] calculatedLocationsValue = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; - guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, 1, null)).IgnoreArguments().WhenCalled( + guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, 1, null)).IgnoreArguments().WhenCalled( invocation => { hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); @@ -484,7 +484,7 @@ HydraulicBoundaryLocation[] calculatedLocationsValue = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; - guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, 1, null)).IgnoreArguments().WhenCalled( + guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, 1, null)).IgnoreArguments().WhenCalled( invocation => { hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString();