Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs =================================================================== diff -u -r797860a90e2e806327a86f77e20a368eaf25d6ed -re6e0f3a201a644070997b531763b63f19d44df0e --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 797860a90e2e806327a86f77e20a368eaf25d6ed) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision e6e0f3a201a644070997b531763b63f19d44df0e) @@ -187,7 +187,7 @@ [Test] [TestCase(true)] [TestCase(false)] - public void Calculate_ValidWaveHeightCalculationAndDoesNotConverge_StartsCalculationWithRightParametersAndLogsWarning(bool readIllustrationPoints) + public void Calculate_ValidWaveHeightCalculationAndDoesNotConverge_SetsOutputAndLogs(bool readIllustrationPoints) { // Setup string validFilePath = Path.Combine(testDataPath, validFile); @@ -234,9 +234,6 @@ "Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden.", msgs[2]); CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[3]); }); - - AssessmentLevelCalculationInput expectedInput = CreateInput(id, norm); - AssertInput(expectedInput, calculator.ReceivedInputs.Single()); Assert.IsFalse(calculator.IsCanceled); Assert.IsNotNull(calculation.Output); Assert.AreEqual(readIllustrationPoints, calculation.Output.HasIllustrationPoints); @@ -245,7 +242,7 @@ } [Test] - public void Calculate_ValidDesignWaterLevelCalculationButInvalidIllustrationPointResults_StartsCalculationWithRightParametersAndLogsWarning() + public void Calculate_ValidDesignWaterLevelCalculationButInvalidIllustrationPointResults_IllustrationPointsNotSetAndLogs() { // Setup string validFilePath = Path.Combine(testDataPath, validFile); @@ -296,10 +293,6 @@ Assert.IsInstanceOf(tupleArray[1].Item3); }); - - AssessmentLevelCalculationInput expectedInput = CreateInput(id, norm); - AssertInput(expectedInput, calculator.ReceivedInputs.Single()); - Assert.IsFalse(calculator.IsCanceled); Assert.IsNotNull(calculation.Output); Assert.IsFalse(calculation.Output.HasIllustrationPoints); } @@ -484,16 +477,24 @@ }; // Assert - TestHelper.AssertLogMessages(call, messages => + TestHelper.AssertLogMessagesAndLoggedExceptions(call, messages => { - string[] msgs = messages.ToArray(); + Tuple[] generatedMessages = messages.ToArray(); + + string[] msgs = generatedMessages.Select(msg => msg.Item1).ToArray(); Assert.AreEqual(4, msgs.Length); CalculationServiceTestHelper.AssertCalculationStartMessage(msgs[0]); Assert.AreEqual(calculationFailedMessage, msgs[1]); Assert.AreEqual($"Golfhoogte berekening is uitgevoerd op de tijdelijke locatie '{calculator.OutputDirectory}'. " + "Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden.", msgs[2]); CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[3]); + + if (!endInFailure && string.IsNullOrEmpty(lastErrorFileContent)) + { + Assert.IsInstanceOf(generatedMessages[1].Item3); + } }); + Assert.IsInstanceOf(exception); } mockRepository.VerifyAll();