Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapperTests.cs =================================================================== diff -u -r3689 -r3764 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapperTests.cs (.../MacroStabilityInwardsKernelWrapperTests.cs) (revision 3689) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapperTests.cs (.../MacroStabilityInwardsKernelWrapperTests.cs) (revision 3764) @@ -36,10 +36,8 @@ using Deltares.DamEngine.Io; using Deltares.DamEngine.TestHelpers; using Deltares.DamEngine.TestHelpers.Factories; -using Deltares.MacroStability.CSharpWrapper.Output; using NUnit.Framework; using CharacteristicPointType = Deltares.DamEngine.Data.Geotechnics.CharacteristicPointType; -using LogMessage = Deltares.DamEngine.Data.Standard.Logging.LogMessage; using MacroStabilityOutput = Deltares.DamEngine.Calculators.KernelWrappers.MacroStabilityInwards.MacroStabilityOutput; namespace Deltares.DamEngine.Calculators.Tests.KernelWrappers.MacroStabilityInwards @@ -48,7 +46,7 @@ public class MacroStabilityInwardsKernelWrapperTests { private const string TestFolder = @"..\..\Deltares.DamEngine.IntegrationTests\TestFiles"; - private string inputXmlForDamEngine = Path.Combine(TestFolder, "StabilityDesign1Dbased.xml"); + private readonly string inputXmlForDamEngine = Path.Combine(TestFolder, "StabilityDesign1Dbased.xml"); [Test] public void TestPrepare() @@ -137,7 +135,6 @@ { Location = kernelInput.Location }; - List results; macroStabilityOutput.CalculationResult = CalculationResult.Succeeded; var macroStabilityOutputItem = new MacroStabilityOutputItem { @@ -210,10 +207,9 @@ ResultantMoment = 59, ResultantAngle = 60 }; - macroStabilityOutput.StabilityOutputItems[0].ResultSlices = new List(); - macroStabilityOutput.StabilityOutputItems[0].ResultSlices.Add(resultSlice); - - kernelWrapper.PostProcess(kernelInput, macroStabilityOutput, designScenario, "", out results); + macroStabilityOutput.StabilityOutputItems[0].ResultSlices = new List { resultSlice }; + + kernelWrapper.PostProcess(kernelInput, macroStabilityOutput, designScenario, "", out var results); Assert.IsTrue(results.Count > 0); foreach (var result in results) { @@ -299,13 +295,22 @@ [Test] public void TestFullCalculationFails() { - var kernelWrapper = new MacroStabilityInwardsKernelWrapper(); - + var kernelWrapper = new MacroStabilityInwardsKernelWrapper + { + FailureMechanismParametersMStab = new FailureMechanismParametersMStab + { + MStabParameters = + { + Model = MStabModelType.UpliftVan + } + } + }; + IKernelDataInput kernelDataInput = new MacroStabilityKernelDataInput(); + IKernelDataOutput kernelDataOutput = new MacroStabilityOutput(); // Run the dll - List messages; - kernelWrapper.Execute(kernelDataInput, kernelDataOutput, out messages); + kernelWrapper.Execute(kernelDataInput, kernelDataOutput, out var messages); MacroStabilityOutput macroStabilityOutput = (MacroStabilityOutput)kernelDataOutput; Assert.IsTrue(messages.Count > 0); // as there is no data at all, expect unexpected error @@ -337,8 +342,7 @@ Assert.AreEqual(PrepareResult.Successful, prepareResult); // Validate the input - List messages; - var errorCount = kernelWrapper.Validate(kernelDataInput, kernelDataOutput, out messages); + var errorCount = kernelWrapper.Validate(kernelDataInput, kernelDataOutput, out var messages); Assert.IsTrue(errorCount == 0); // Run the dl; the tangent line position is defined in such a way that this calculation will result in @@ -374,8 +378,7 @@ Assert.AreEqual(PrepareResult.Successful, prepareResult); // Validate the input - List messages; - var errorCount = kernelWrapper.Validate(kernelDataInput, kernelDataOutput, out messages); + var errorCount = kernelWrapper.Validate(kernelDataInput, kernelDataOutput, out var messages); Assert.IsTrue(errorCount == 0); // Run the dll @@ -392,8 +395,7 @@ { Location = kernelInput.Location }; - List results; - kernelWrapper.PostProcess(kernelInput, macroStabilityOutput, designScenario, "", out results); + kernelWrapper.PostProcess(kernelInput, macroStabilityOutput, designScenario, "", out var results); Assert.IsTrue(results.Count > 0); foreach (var result in results) { @@ -486,8 +488,7 @@ { Location = kernelInput.Location }; - List results; - kernelWrapper.PostProcess(kernelInput, macroStabilityOutput, designScenario, "", out results); + kernelWrapper.PostProcess(kernelInput, macroStabilityOutput, designScenario, "", out var results); Assert.IsTrue(results.Count > 0); } @@ -566,13 +567,15 @@ SetWaterpressureInterpolationModel(soilProfile.Layers); // This test is based on a 1D profile, to be combined with the surface line. - var subSoilScenario = new SoilGeometryProbability(); - subSoilScenario.SoilProfileType = SoilProfileType.ProfileType1D; - subSoilScenario.StiFileName = ""; - subSoilScenario.FullStiFileName = ""; - subSoilScenario.SoilProfile2D = null; - subSoilScenario.SegmentFailureMechanismType = SegmentFailureMechanismType.Stability; - subSoilScenario.SoilProfile1D = soilProfile; + var subSoilScenario = new SoilGeometryProbability + { + SoilProfileType = SoilProfileType.ProfileType1D, + StiFileName = "", + FullStiFileName = "", + SoilProfile2D = null, + SegmentFailureMechanismType = SegmentFailureMechanismType.Stability, + SoilProfile1D = soilProfile + }; var damKernelInput = new DamKernelInput {