Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs =================================================================== diff -u -r948 -r950 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs (.../DamMacroStabilityInwardsKernelWrapperTests.cs) (revision 948) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs (.../DamMacroStabilityInwardsKernelWrapperTests.cs) (revision 950) @@ -49,7 +49,8 @@ { // expected results are based on test CanCalculateStabilitySafetyFactorGeometry2D // in 'https://repos.deltares.nl/repos/dam/dam classic' revision 190 - FullCalculation(MStabModelType.Bishop, 1.5570); + var expectedValues = new List { 1.5570 }; + FullCalculation(MStabModelType.Bishop, expectedValues, expectedValues); } [Test] @@ -60,11 +61,22 @@ // but I changed (in dam classic) the model to UpliftVan // and added UpliftCriterionStability = 1.2 // result in dam classic = 1.0105 - FullCalculation(MStabModelType.UpliftVan, 1.0105); + var expectedValues = new List { 1.0105 }; + FullCalculation(MStabModelType.UpliftVan, expectedValues, expectedValues); } - public void FullCalculation(MStabModelType model, double expectedValue) + [Test] + public void TestFullCalculationBishopUpliftVan() { + // expected result is worst of Bishop (1.5570) and UpliftVan (1.0105) + var expectedValues = new List { 1.5570, 1.0105 }; + var expectedOutputValues = new List { 1.5570, 1.0105, 1.0105 }; + FullCalculation(MStabModelType.BishopUpliftVan, expectedValues, expectedOutputValues); + } + + public void FullCalculation(MStabModelType model, List expectedCalculationValues, + List expectedOutputValues) + { const double diff = 0.01; var soilDbName = Path.Combine(TestFolder, "soilmaterials.mdb"); var soilGeometry2DName = "1D1.sti"; @@ -88,7 +100,6 @@ scenario.ModelFactors.RequiredSafetyFactorStabilityInnerSlope = 1.1; scenario.ModelFactors.UpliftCriterionStability = 1.2; - var subSoilScenario = new SoilGeometryProbability(); subSoilScenario.StiFileName = soilGeometry2DName; subSoilScenario.SoilProfileType = SoilProfileType.ProfileTypeStiFile; @@ -123,13 +134,21 @@ kernelWrapper.Execute(damStabilityInput, kernelOutput, out messages); DamMacroStabilityOutput damMacroStabilityOutput = (DamMacroStabilityOutput) kernelOutput; Assert.AreEqual(0, messages.Count); - Assert.AreEqual(expectedValue, damMacroStabilityOutput.StabilityOutputItems[0].Zone1Results.SafetyFactor, diff); - Assert.IsNull(damMacroStabilityOutput.StabilityOutputItems[0].Zone2Results); + Assert.AreEqual(expectedCalculationValues.Count, damMacroStabilityOutput.StabilityOutputItems.Count); + for (int index = 0; index < expectedCalculationValues.Count; index++) + { + Assert.AreEqual(expectedCalculationValues[0], damMacroStabilityOutput.StabilityOutputItems[0].Zone1Results.SafetyFactor, diff); + Assert.IsNull(damMacroStabilityOutput.StabilityOutputItems[0].Zone2Results); + } // Fill the design results List results; kernelWrapper.PostProcess(damKernelInput, damMacroStabilityOutput, "", out results); - Assert.AreEqual(expectedValue, results[0].StabilityDesignResults.SafetyFactor, diff); + Assert.AreEqual(expectedOutputValues.Count, results.Count); + for (int index = 0; index < expectedOutputValues.Count; index++) + { + Assert.AreEqual(expectedOutputValues[0], results[0].StabilityDesignResults.SafetyFactor, diff); + } } private XDocument ModifiedXmlDocument(string stiFileName)