Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapperTests.cs =================================================================== diff -u -r6688 -r6851 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapperTests.cs (.../MacroStabilityInwardsKernelWrapperTests.cs) (revision 6688) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapperTests.cs (.../MacroStabilityInwardsKernelWrapperTests.cs) (revision 6851) @@ -55,7 +55,7 @@ [TestCase(1.4, true, false, PrepareResult.NotRelevant, false)] [TestCase(1.4, true, true, PrepareResult.Successful)] [TestCase(1.2, false, false, PrepareResult.Failed)] - public void TestPrepare(double upliftCriterionStability, bool isInputValid, bool expectedIsUplift, + public void TestPrepare(double upliftCriterionStability, bool isInputValid, bool expectedIsUplift, PrepareResult expectedPrepareResult, bool isStability = true) { // Setup @@ -65,6 +65,7 @@ { kernelInput.SubSoilScenario.SegmentFailureMechanismType = SegmentFailureMechanismType.Piping; } + var kernelWrapper = new MacroStabilityInwardsKernelWrapper { FailureMechanismParametersMStab = new FailureMechanismParametersMStab @@ -582,13 +583,32 @@ Assert.That(engineInterface.DamProjectData, Is.Not.Null); engineInterface.DamProjectData.DamProjectCalculationSpecification.CurrentSpecification.StabilityModelType = StabilityModelType.UpliftVan; - + Output output = GeneralHelper.RunAfterInputValidation(engineInterface); Assert.That(output.Results.CalculationResults[0].StabilityDesignResults.SafetyFactor, Is.EqualTo(1.6099).Within(tolerance4Decimals)); } [Test] + public void TestAddMessageToCalculationMessages() + { + var kernelDataOutput = new MacroStabilityOutput(); + var message = new LogMessage + { + Message = "Warning during calculation", + MessageType = LogMessageType.Warning + }; + kernelDataOutput.Message = message; + var logMessages = new List(); + IKernelWrapper kernelWrapper = new MacroStabilityInwardsKernelWrapper(); + + kernelWrapper.AddMessageToCalculationMessages(kernelDataOutput, logMessages); + + Assert.That(logMessages, Has.Count.EqualTo(1)); + Assert.That(logMessages[0], Is.EqualTo(message)); + } + + [Test] [SetUICulture("nl-NL")] public void TestLanguageNLThrowsExceptionWhenInputIsNull() {