Index: Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs =================================================================== diff -u -r95e5c7c46e45f5c240cd0c9928484f0f4714e147 -rd79f0f4aa80c99ba45a7ff3a502b5437975f7b58 --- Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision 95e5c7c46e45f5c240cd0c9928484f0f4714e147) +++ Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision d79f0f4aa80c99ba45a7ff3a502b5437975f7b58) @@ -101,8 +101,9 @@ /// The object which is used to build log messages. /// Preprocessing is disabled when /// equals . - /// Thrown when or - /// is null. + /// Thrown when , + /// or + /// is null. /// Thrown when /// /// contains invalid characters. @@ -133,6 +134,11 @@ throw new ArgumentNullException(nameof(hydraulicBoundaryLocationCalculation)); } + if (messageProvider == null) + { + throw new ArgumentNullException(nameof(messageProvider)); + } + string hlcdDirectory = Path.GetDirectoryName(hydraulicBoundaryDatabaseFilePath); CalculationServiceHelper.LogCalculationBegin(); Index: Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs =================================================================== diff -u -r7dce1ceb498815baa3486f459710c77327d4ef10 -rd79f0f4aa80c99ba45a7ff3a502b5437975f7b58 --- Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision 7dce1ceb498815baa3486f459710c77327d4ef10) +++ Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision d79f0f4aa80c99ba45a7ff3a502b5437975f7b58) @@ -101,8 +101,9 @@ /// The norm of the assessment section. /// The object which is used to build log messages. /// Preprocessing is disabled when equals . - /// Thrown when or - /// is null. + /// Thrown when , + /// or + /// is null. /// Thrown when /// /// contains invalid characters. @@ -133,6 +134,11 @@ throw new ArgumentNullException(nameof(hydraulicBoundaryLocationCalculation)); } + if (messageProvider == null) + { + throw new ArgumentNullException(nameof(messageProvider)); + } + string hlcdDirectory = Path.GetDirectoryName(hydraulicBoundaryDatabaseFilePath); CalculationServiceHelper.LogCalculationBegin(); Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs =================================================================== diff -u -r95e5c7c46e45f5c240cd0c9928484f0f4714e147 -rd79f0f4aa80c99ba45a7ff3a502b5437975f7b58 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 95e5c7c46e45f5c240cd0c9928484f0f4714e147) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision d79f0f4aa80c99ba45a7ff3a502b5437975f7b58) @@ -177,6 +177,22 @@ } [Test] + public void Calculate_MessageProviderNull_ThrowArgumentNullException() + { + // Call + TestDelegate test = () => new DesignWaterLevelCalculationService().Calculate(new TestHydraulicBoundaryLocation(), + new HydraulicBoundaryLocationCalculation(), + string.Empty, + string.Empty, + 1, + null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("messageProvider", exception.ParamName); + } + + [Test] [TestCase(true)] [TestCase(false)] public void Calculate_ValidDesignWaterLevelCalculationAndConverges_StartsCalculationWithRightParametersAndLogs(bool readIllustrationPoints) Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs =================================================================== diff -u -r7dce1ceb498815baa3486f459710c77327d4ef10 -rd79f0f4aa80c99ba45a7ff3a502b5437975f7b58 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 7dce1ceb498815baa3486f459710c77327d4ef10) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision d79f0f4aa80c99ba45a7ff3a502b5437975f7b58) @@ -164,7 +164,7 @@ mockRepository.ReplayAll(); // Call - TestDelegate test = () => new WaveHeightCalculationService().Calculate(new TestHydraulicBoundaryLocation(), + TestDelegate test = () => new WaveHeightCalculationService().Calculate(new TestHydraulicBoundaryLocation(), null, testDataPath, validPreprocessorDirectory, @@ -177,6 +177,22 @@ } [Test] + public void Calculate_MessageProviderNull_ThrowArgumentNullException() + { + // Call + TestDelegate test = () => new WaveHeightCalculationService().Calculate(new TestHydraulicBoundaryLocation(), + new HydraulicBoundaryLocationCalculation(), + string.Empty, + string.Empty, + 1, + null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("messageProvider", exception.ParamName); + } + + [Test] [TestCase(true)] [TestCase(false)] public void Calculate_ValidWaveHeightCalculationAndConverges_StartsCalculationWithRightParametersAndLogs(bool readIllustrationPoints)