Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs =================================================================== diff -u -r948bc61d0095021cfad938557c5b98f00a150044 -r25af784999b04dc8156272632e7f6c638c55a18c --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs (.../HydraulicBoundaryLocationCalculationGuiServiceTest.cs) (revision 948bc61d0095021cfad938557c5b98f00a150044) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs (.../HydraulicBoundaryLocationCalculationGuiServiceTest.cs) (revision 25af784999b04dc8156272632e7f6c638c55a18c) @@ -193,7 +193,7 @@ } [Test] - public void CalculateDesignWaterLevels_ValidPathOneLocationInTheList_LogsMessages() + public void CalculateDesignWaterLevels_ValidPathOneCalculation_LogsMessages() { // Setup const string hydraulicLocationName = "name"; @@ -368,7 +368,7 @@ } [Test] - public void CalculateWaveHeights_ValidPathOneLocationInTheList_LogsMessages() + public void CalculateWaveHeights_ValidPathOneCalculation_LogsMessages() { // Setup const string hydraulicLocationName = "name"; Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresCharacteristicsCsvReaderTest.cs =================================================================== diff -u -rb9e640cceb967cc24e3999c373ddb5040e59a1f0 -r25af784999b04dc8156272632e7f6c638c55a18c --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresCharacteristicsCsvReaderTest.cs (.../StructuresCharacteristicsCsvReaderTest.cs) (revision b9e640cceb967cc24e3999c373ddb5040e59a1f0) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresCharacteristicsCsvReaderTest.cs (.../StructuresCharacteristicsCsvReaderTest.cs) (revision 25af784999b04dc8156272632e7f6c638c55a18c) @@ -214,7 +214,7 @@ } [Test] - public void GetLineCount_ValidFileWithOneLocationsAndExtraWhiteLines_ReturnCount() + public void GetLineCount_ValidFileWithOneLocationAndExtraWhiteLines_ReturnCount() { // Setup string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationActivityTest.cs =================================================================== diff -u -r5169b12fc5f885c17e1c6eb6ae459c5d46adfb68 -r25af784999b04dc8156272632e7f6c638c55a18c --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision 5169b12fc5f885c17e1c6eb6ae459c5d46adfb68) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision 25af784999b04dc8156272632e7f6c638c55a18c) @@ -222,7 +222,9 @@ calculationMessageProvider.Stub(calc => calc.GetActivityDescription(locationName)).Return(activityDescription); mockRepository.ReplayAll(); - var activity = new DesignWaterLevelCalculationActivity(new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation(locationName)), + var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(locationName); + + var activity = new DesignWaterLevelCalculationActivity(new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation), validFilePath, validPreprocessorDirectory, norm, @@ -248,7 +250,7 @@ AssessmentLevelCalculationInput designWaterLevelCalculationInput = calculator.ReceivedInputs.Single(); - Assert.AreEqual(new TestHydraulicBoundaryLocation(locationName).Id, designWaterLevelCalculationInput.HydraulicBoundaryLocationId); + Assert.AreEqual(hydraulicBoundaryLocation.Id, designWaterLevelCalculationInput.HydraulicBoundaryLocationId); Assert.AreEqual(StatisticsConverter.ProbabilityToReliability(norm), designWaterLevelCalculationInput.Beta); } @@ -487,7 +489,7 @@ mockRepository.ReplayAll(); const double norm = 1.0 / 30; - var activity = new DesignWaterLevelCalculationActivity(new HydraulicBoundaryLocationCalculation(new HydraulicBoundaryLocation(0, locationName, 0, 0)), + var activity = new DesignWaterLevelCalculationActivity(new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation(locationName)), validFilePath, validPreprocessorDirectory, norm, Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs =================================================================== diff -u -r5169b12fc5f885c17e1c6eb6ae459c5d46adfb68 -r25af784999b04dc8156272632e7f6c638c55a18c --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 5169b12fc5f885c17e1c6eb6ae459c5d46adfb68) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 25af784999b04dc8156272632e7f6c638c55a18c) @@ -176,6 +176,8 @@ public void Calculate_ValidDesignWaterLevelCalculationAndConverges_StartsCalculationWithRightParametersAndLogs(bool readIllustrationPoints) { // Setup + const double norm = 1.0 / 30; + var calculator = new TestDesignWaterLevelCalculator { IllustrationPointsResult = new TestGeneralResult(), @@ -189,7 +191,8 @@ var calculationMessageProvider = mockRepository.StrictMock(); mockRepository.ReplayAll(); - var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()) + var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation) { InputParameters = { @@ -203,7 +206,7 @@ Action call = () => new DesignWaterLevelCalculationService().Calculate(hydraulicBoundaryLocationCalculation, validFilePath, validPreprocessorDirectory, - 1.0 / 30, + norm, calculationMessageProvider); // Assert @@ -217,7 +220,7 @@ CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[2]); }); - AssessmentLevelCalculationInput expectedInput = CreateInput(0, 1.0 / 30); + AssessmentLevelCalculationInput expectedInput = CreateInput(hydraulicBoundaryLocation.Id, norm); AssertInput(expectedInput, calculator.ReceivedInputs.Single()); Assert.IsFalse(calculator.IsCanceled); @@ -292,7 +295,8 @@ calculationMessageProvider.Expect(c => c.GetCalculatedNotConvergedMessage(locationName)).Return(failedConvergenceMessage); mockRepository.ReplayAll(); - var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation(locationName)) + var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(locationName); + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation) { InputParameters = { @@ -321,7 +325,7 @@ CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[3]); }); - AssessmentLevelCalculationInput expectedInput = CreateInput(0, norm); + AssessmentLevelCalculationInput expectedInput = CreateInput(hydraulicBoundaryLocation.Id, norm); AssertInput(expectedInput, calculator.ReceivedInputs.Single()); Assert.IsFalse(calculator.IsCanceled); Assert.IsNotNull(hydraulicBoundaryLocationCalculation.Output); @@ -598,8 +602,6 @@ var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); - const double norm = 1.0 / 30; - using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { var service = new DesignWaterLevelCalculationService(); @@ -609,7 +611,7 @@ service.Calculate(hydraulicBoundaryLocationCalculation, validFilePath, validPreprocessorDirectory, - norm, + 1.0 / 30, calculationMessageProvider); // Assert @@ -629,7 +631,6 @@ // Setup const string locationName = "punt_flw_1"; const string calculationFailedMessage = "calculationFailedMessage"; - const double norm = 1.0 / 30; var calculator = new TestDesignWaterLevelCalculator { @@ -671,7 +672,7 @@ new DesignWaterLevelCalculationService().Calculate(hydraulicBoundaryLocationCalculation, validFilePath, validPreprocessorDirectory, - norm, + 1.0 / 30, calculationMessageProvider); } catch (HydraRingCalculationException e) Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs =================================================================== diff -u -r5169b12fc5f885c17e1c6eb6ae459c5d46adfb68 -r25af784999b04dc8156272632e7f6c638c55a18c --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision 5169b12fc5f885c17e1c6eb6ae459c5d46adfb68) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision 25af784999b04dc8156272632e7f6c638c55a18c) @@ -220,7 +220,9 @@ calculationMessageProvider.Stub(calc => calc.GetActivityDescription(locationName)).Return(activityDescription); mockRepository.ReplayAll(); - var activity = new WaveHeightCalculationActivity(new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation(locationName)), + var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(locationName); + + var activity = new WaveHeightCalculationActivity(new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation), validFilePath, validPreprocessorDirectory, norm, @@ -245,7 +247,7 @@ }); WaveHeightCalculationInput waveHeightCalculationInput = calculator.ReceivedInputs.Single(); - Assert.AreEqual(new TestHydraulicBoundaryLocation(locationName).Id, waveHeightCalculationInput.HydraulicBoundaryLocationId); + Assert.AreEqual(hydraulicBoundaryLocation.Id, waveHeightCalculationInput.HydraulicBoundaryLocationId); Assert.AreEqual(StatisticsConverter.ProbabilityToReliability(norm), waveHeightCalculationInput.Beta); } @@ -485,7 +487,7 @@ mockRepository.ReplayAll(); const double norm = 1.0 / 30; - var activity = new WaveHeightCalculationActivity(new HydraulicBoundaryLocationCalculation(new HydraulicBoundaryLocation(0, locationName, 0, 0)), + var activity = new WaveHeightCalculationActivity(new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation(locationName)), validFilePath, validPreprocessorDirectory, norm, Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs =================================================================== diff -u -rdc63bd719e4df9534b154598033f9dd459268879 -r25af784999b04dc8156272632e7f6c638c55a18c --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision dc63bd719e4df9534b154598033f9dd459268879) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 25af784999b04dc8156272632e7f6c638c55a18c) @@ -191,7 +191,8 @@ var calculationMessageProvider = mockRepository.StrictMock(); mockRepository.ReplayAll(); - var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()) + var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation) { InputParameters = { @@ -218,7 +219,7 @@ CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[2]); }); - AssessmentLevelCalculationInput expectedInput = CreateInput(0, norm); + AssessmentLevelCalculationInput expectedInput = CreateInput(hydraulicBoundaryLocation.Id, norm); AssertInput(expectedInput, calculator.ReceivedInputs.Single()); Assert.IsFalse(calculator.IsCanceled); Assert.IsNotNull(hydraulicBoundaryLocationCalculation.Output); @@ -275,6 +276,7 @@ public void Calculate_ValidWaveHeightCalculationAndDoesNotConverge_SetsOutputAndLogs(bool readIllustrationPoints) { // Setup + const double norm = 1.0 / 30; const string locationName = "punt_flw_1"; var calculator = new TestWaveHeightCalculator @@ -292,7 +294,8 @@ calculationMessageProvider.Expect(mp => mp.GetCalculatedNotConvergedMessage(locationName)).Return(failedConvergenceMessage); mockRepository.ReplayAll(); - var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation(locationName)) + var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(locationName); + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation) { InputParameters = { @@ -302,11 +305,14 @@ using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { - Action call = () => new WaveHeightCalculationService().Calculate(hydraulicBoundaryLocationCalculation, - validFilePath, - validPreprocessorDirectory, - 1.0 / 30, - calculationMessageProvider); + Action call = () => + { + new WaveHeightCalculationService().Calculate(hydraulicBoundaryLocationCalculation, + validFilePath, + validPreprocessorDirectory, + norm, + calculationMessageProvider); + }; // Assert TestHelper.AssertLogMessages(call, messages => @@ -319,6 +325,10 @@ "Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden.", msgs[2]); CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[3]); }); + + AssessmentLevelCalculationInput expectedInput = CreateInput(hydraulicBoundaryLocation.Id, norm); + AssertInput(expectedInput, calculator.ReceivedInputs.Single()); + Assert.IsFalse(calculator.IsCanceled); Assert.IsNotNull(hydraulicBoundaryLocationCalculation.Output); Assert.AreEqual(readIllustrationPoints, hydraulicBoundaryLocationCalculation.Output.HasGeneralResult); @@ -594,8 +604,6 @@ var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); - const double norm = 1.0 / 30; - using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { var service = new WaveHeightCalculationService(); @@ -605,7 +613,7 @@ service.Calculate(hydraulicBoundaryLocationCalculation, validFilePath, validPreprocessorDirectory, - norm, + 1.0 / 30, calculationMessageProvider); // Assert @@ -625,7 +633,6 @@ // Setup const string locationName = "punt_flw_1"; const string calculationFailedMessage = "calculationFailedMessage"; - const double norm = 1.0 / 30; var calculator = new TestWaveHeightCalculator { @@ -667,7 +674,7 @@ new WaveHeightCalculationService().Calculate(hydraulicBoundaryLocationCalculation, validFilePath, validPreprocessorDirectory, - norm, + 1.0 / 30, calculationMessageProvider); } catch (HydraRingCalculationException e)