Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs =================================================================== diff -u -r797860a90e2e806327a86f77e20a368eaf25d6ed -re6e0f3a201a644070997b531763b63f19d44df0e --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 797860a90e2e806327a86f77e20a368eaf25d6ed) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision e6e0f3a201a644070997b531763b63f19d44df0e) @@ -188,7 +188,7 @@ [Test] [TestCase(true)] [TestCase(false)] - public void Calculate_ValidDesignWaterLevelCalculationAndDoesNotConverge_StartsCalculationWithRightParametersAndLogsWarning(bool readIllustrationPoints) + public void Calculate_ValidDesignWaterLevelCalculationAndDoesNotConverge_SetsOutputAndLogs(bool readIllustrationPoints) { // Setup string validFilePath = Path.Combine(testDataPath, validFile); @@ -247,7 +247,7 @@ } [Test] - public void Calculate_ValidDesignWaterLevelCalculationButInvalidIllustrationPointResults_StartsCalculationWithRightParametersAndLogsWarning() + public void Calculate_ValidDesignWaterLevelCalculationButInvalidIllustrationPointResults_IllustrationPointNotSetAndLog() { // Setup string validFilePath = Path.Combine(testDataPath, validFile); @@ -298,10 +298,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); } @@ -487,15 +483,22 @@ }; // 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($"Toetspeil 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);