Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs =================================================================== diff -u -r1513447d61c0a667d233af5da6ba0480ffe5c3c3 -rdc63bd719e4df9534b154598033f9dd459268879 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 1513447d61c0a667d233af5da6ba0480ffe5c3c3) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision dc63bd719e4df9534b154598033f9dd459268879) @@ -220,7 +220,7 @@ CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[2]); }); - AssessmentLevelCalculationInput expectedInput = CreateInput(100, 1.0 / 30); + AssessmentLevelCalculationInput expectedInput = CreateInput(0, 1.0 / 30); AssertInput(expectedInput, calculator.ReceivedInputs.Single()); Assert.IsFalse(calculator.IsCanceled); @@ -278,6 +278,7 @@ { // Setup const double norm = 1.0 / 30; + const string locationName = "punt_flw_1"; var calculator = new TestDesignWaterLevelCalculator { @@ -291,10 +292,10 @@ const string failedConvergenceMessage = "Did not converge"; var calculationMessageProvider = mockRepository.StrictMock(); - calculationMessageProvider.Expect(c => c.GetCalculatedNotConvergedMessage("punt_flw_ 1")).Return(failedConvergenceMessage); + calculationMessageProvider.Expect(c => c.GetCalculatedNotConvergedMessage(locationName)).Return(failedConvergenceMessage); mockRepository.ReplayAll(); - var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()) + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation(locationName)) { InputParameters = { @@ -323,7 +324,7 @@ CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[3]); }); - AssessmentLevelCalculationInput expectedInput = CreateInput(100, norm); + AssessmentLevelCalculationInput expectedInput = CreateInput(0, norm); AssertInput(expectedInput, calculator.ReceivedInputs.Single()); Assert.IsFalse(calculator.IsCanceled); Assert.IsNotNull(hydraulicBoundaryLocationCalculation.Output); @@ -394,6 +395,8 @@ public void Calculate_CalculationRanErrorInSettingIllustrationPoints_IllustrationPointsNotSetAndLogsWarning() { // Setup + const string locationName = "punt_flw_1"; + var calculator = new TestDesignWaterLevelCalculator { IllustrationPointsResult = GeneralResultTestFactory.CreateGeneralResultWithDuplicateStochasts(), @@ -407,7 +410,7 @@ var calculationMessageProvider = mockRepository.StrictMock(); mockRepository.ReplayAll(); - var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()) + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation(locationName)) { InputParameters = { @@ -433,7 +436,7 @@ Assert.AreEqual(4, msgs.Length); CalculationServiceTestHelper.AssertCalculationStartMessage(msgs[0]); - Assert.AreEqual("Fout bij het uitlezen van de illustratiepunten voor berekening punt_flw_ 1: " + + Assert.AreEqual($"Fout bij het uitlezen van de illustratiepunten voor berekening {locationName}: " + "Een of meerdere stochasten hebben dezelfde naam. " + "Het uitlezen van illustratiepunten wordt overgeslagen.", msgs[1]); Assert.AreEqual($"Toetspeil berekening is uitgevoerd op de tijdelijke locatie '{calculator.OutputDirectory}'. " + @@ -451,6 +454,8 @@ public void Calculate_ValidDesignWaterLevelCalculationThrowsException_ThrowsHydraRingFileParserException() { // Setup + const string locationName = "punt_flw_1"; + var expectedException = new HydraRingFileParserException(); var mockRepository = new MockRepository(); @@ -464,10 +469,10 @@ calculatorFactory.Expect(cf => cf.CreateDesignWaterLevelCalculator(testDataPath, validPreprocessorDirectory)).Return(calculator); var calculationMessageProvider = mockRepository.Stub(); - calculationMessageProvider.Stub(mp => mp.GetCalculatedNotConvergedMessage("punt_flw_ 1")).Return(string.Empty); + calculationMessageProvider.Stub(mp => mp.GetCalculatedNotConvergedMessage(locationName)).Return(string.Empty); mockRepository.ReplayAll(); - var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation(locationName)); using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { @@ -625,7 +630,7 @@ public void Run_InvalidCalculation_LogsErrorAndThrowException(bool endInFailure, string lastErrorFileContent) { // Setup - const string locationName = "punt_flw_ 1"; + const string locationName = "punt_flw_1"; const string calculationFailedMessage = "calculationFailedMessage"; const double norm = 1.0 / 30;