Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs =================================================================== diff -u -r736f04ea6f24399148ab8efd7f3b03ae8f8f56b5 -rb786d74976260be812dc25649d51338884ea7030 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision 736f04ea6f24399148ab8efd7f3b03ae8f8f56b5) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision b786d74976260be812dc25649d51338884ea7030) @@ -273,24 +273,28 @@ } [Test] - public void Run_InvalidCalculation_LogsErrorOutputNotUpdated() + [TestCaseSource(typeof(HydraRingCalculatorTestCaseProvider), nameof(HydraRingCalculatorTestCaseProvider.GetCalculatorFailingConditionsWithReportDetails), new object[] { + nameof(Run_InvalidCalculation_LogsErrorOutputNotUpdated) + })] + public void Run_InvalidCalculation_LogsErrorOutputNotUpdated(bool endInFailure, string lastErrorFileContent, string detailedReport) + { // Setup const string locationName = "locationName"; - const string calculationFailedMessage = "Something went wrong"; var calculator = new TestWaveHeightCalculator { - EndInFailure = true, - LastErrorFileContent = calculationFailedMessage + EndInFailure = endInFailure, + LastErrorFileContent = lastErrorFileContent }; var calculatorFactory = mockRepository.StrictMock(); calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(calculator); var calculationMessageProvider = mockRepository.Stub(); calculationMessageProvider.Stub(calc => calc.GetActivityDescription(locationName)).Return(string.Empty); calculationMessageProvider.Stub(calc => calc.GetCalculationName(locationName)).Return(string.Empty); - calculationMessageProvider.Stub(calc => calc.GetCalculationFailedMessage(null, null)).IgnoreArguments().Return(calculationFailedMessage); + calculationMessageProvider.Stub(calc => calc.GetCalculationFailedMessage(null, null)).IgnoreArguments().Return(detailedReport); + calculationMessageProvider.Stub(calc => calc.GetCalculationFailedUnexplainedMessage(null)).IgnoreArguments().Return(detailedReport); mockRepository.ReplayAll(); var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) @@ -313,7 +317,7 @@ Action call = () => activity.Run(); // Assert - TestHelper.AssertLogMessageIsGenerated(call, calculationFailedMessage, 6); + TestHelper.AssertLogMessageIsGenerated(call, detailedReport, 6); Assert.IsNaN(hydraulicBoundaryLocation.WaveHeight); Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocation.WaveHeightCalculationConvergence); } @@ -372,9 +376,10 @@ } [Test] - [TestCase(true, null)] - [TestCase(true, "An error occurred")] - [TestCase(false, "An error occurred")] + [TestCaseSource(typeof(HydraRingCalculatorTestCaseProvider), nameof(HydraRingCalculatorTestCaseProvider.GetCalculatorFailingConditions), new object[] + { + nameof(Run_ErrorInCalculation_PerformValidationAndCalculationAndLogStartAndEndAndError) + })] public void Run_ErrorInCalculation_PerformValidationAndCalculationAndLogStartAndEndAndError(bool endInFailure, string lastErrorFileContent) { // Setup