Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs =================================================================== diff -u -r639ed2d13b89000c99295422e20162320a1456cb -r7dce1ceb498815baa3486f459710c77327d4ef10 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 639ed2d13b89000c99295422e20162320a1456cb) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 7dce1ceb498815baa3486f459710c77327d4ef10) @@ -28,6 +28,7 @@ using Rhino.Mocks; using Ringtoets.Common.Data.Exceptions; using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Service.MessageProviders; using Ringtoets.Common.Service.TestUtil; using Ringtoets.HydraRing.Calculation.Calculator; @@ -134,22 +135,48 @@ } [Test] - public void Calculate_CalculationWrapperNull_ThrowArgumentNullException() + public void Calculate_HydraulicBoundaryLocationNull_ThrowArgumentNullException() { // Setup var mockRepository = new MockRepository(); var calculationMessageProvider = mockRepository.Stub(); mockRepository.ReplayAll(); // Call - TestDelegate test = () => new WaveHeightCalculationService().Calculate(null, testDataPath, validPreprocessorDirectory, 1, calculationMessageProvider); + TestDelegate test = () => new WaveHeightCalculationService().Calculate(null, + new HydraulicBoundaryLocationCalculation(), + testDataPath, + validPreprocessorDirectory, + 1, + calculationMessageProvider); // Assert var exception = Assert.Throws(test); - Assert.AreEqual("calculationWrapper", exception.ParamName); + Assert.AreEqual("hydraulicBoundaryLocation", exception.ParamName); } [Test] + public void Calculate_HydraulicBoundaryLocationCalculationNull_ThrowArgumentNullException() + { + // Setup + var mockRepository = new MockRepository(); + var calculationMessageProvider = mockRepository.Stub(); + mockRepository.ReplayAll(); + + // Call + TestDelegate test = () => new WaveHeightCalculationService().Calculate(new TestHydraulicBoundaryLocation(), + null, + testDataPath, + validPreprocessorDirectory, + 1, + calculationMessageProvider); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("hydraulicBoundaryLocationCalculation", exception.ParamName); + } + + [Test] [TestCase(true)] [TestCase(false)] public void Calculate_ValidWaveHeightCalculationAndConverges_StartsCalculationWithRightParametersAndLogs(bool readIllustrationPoints) @@ -181,7 +208,8 @@ using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { - Action call = () => new WaveHeightCalculationService().Calculate(new HydraulicBoundaryCalculationWrapper(location, calculation), + Action call = () => new WaveHeightCalculationService().Calculate(location, + calculation, validFilePath, validPreprocessorDirectory, norm, @@ -237,7 +265,8 @@ using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { // Call - new WaveHeightCalculationService().Calculate(new HydraulicBoundaryCalculationWrapper(location, calculation), + new WaveHeightCalculationService().Calculate(location, + calculation, validFilePath, preprocessorDirectory, 1.0 / 30, @@ -282,7 +311,8 @@ using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { - Action call = () => new WaveHeightCalculationService().Calculate(new HydraulicBoundaryCalculationWrapper(location, calculation), + Action call = () => new WaveHeightCalculationService().Calculate(location, + calculation, validFilePath, validPreprocessorDirectory, 1.0 / 30, @@ -336,7 +366,8 @@ using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { // Call - Action call = () => new WaveHeightCalculationService().Calculate(new HydraulicBoundaryCalculationWrapper(location, calculation), + Action call = () => new WaveHeightCalculationService().Calculate(location, + calculation, validFilePath, validPreprocessorDirectory, 1.0 / 30, @@ -394,7 +425,8 @@ using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { // Call - Action call = () => new WaveHeightCalculationService().Calculate(new HydraulicBoundaryCalculationWrapper(location, calculation), + Action call = () => new WaveHeightCalculationService().Calculate(location, + calculation, validFilePath, validPreprocessorDirectory, 1.0 / 30, @@ -449,12 +481,12 @@ using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { // Call - TestDelegate call = () => new WaveHeightCalculationService() - .Calculate(new HydraulicBoundaryCalculationWrapper(location, calculation), - validFilePath, - validPreprocessorDirectory, - 1.0 / 30, - calculationMessageProvider); + TestDelegate call = () => new WaveHeightCalculationService().Calculate(location, + calculation, + validFilePath, + validPreprocessorDirectory, + 1.0 / 30, + calculationMessageProvider); // Assert var thrownException = Assert.Throws(call); @@ -494,12 +526,12 @@ using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { // Call - Action call = () => new WaveHeightCalculationService() - .Calculate(new HydraulicBoundaryCalculationWrapper(location, calculation), - validFilePath, - validPreprocessorDirectory, - 1.0 / 30, - calculationMessageProvider); + Action call = () => new WaveHeightCalculationService().Calculate(location, + calculation, + validFilePath, + validPreprocessorDirectory, + 1.0 / 30, + calculationMessageProvider); // Assert TestHelper.AssertLogMessages(call, messages => @@ -541,12 +573,12 @@ using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { // Call - Action call = () => new WaveHeightCalculationService() - .Calculate(new HydraulicBoundaryCalculationWrapper(location, calculation), - validFilePath, - validPreprocessorDirectory, - 1.0 / 30, - calculationMessageProvider); + Action call = () => new WaveHeightCalculationService().Calculate(location, + calculation, + validFilePath, + validPreprocessorDirectory, + 1.0 / 30, + calculationMessageProvider); // Assert TestHelper.AssertLogMessages(call, messages => @@ -587,7 +619,8 @@ calculator.CalculationFinishedHandler += (s, e) => service.Cancel(); // Call - service.Calculate(new HydraulicBoundaryCalculationWrapper(location, calculation), + service.Calculate(location, + calculation, validFilePath, validPreprocessorDirectory, norm, @@ -650,7 +683,8 @@ { try { - new WaveHeightCalculationService().Calculate(new HydraulicBoundaryCalculationWrapper(location, calculation), + new WaveHeightCalculationService().Calculate(location, + calculation, validFilePath, validPreprocessorDirectory, norm,