Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/IssuesTests.cs =================================================================== diff -u -r5768 -r5788 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/IssuesTests.cs (.../IssuesTests.cs) (revision 5768) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/IssuesTests.cs (.../IssuesTests.cs) (revision 5788) @@ -67,7 +67,6 @@ // GeometryExporter.ExportToFile(geometry, GeometryExporter.VisualizationFolder + "Geometry.txt"); // GeometryExporter.ExportWithSurfaceLineToJsonFile(GeometryExporter.VisualizationFolder + // GeometryExporter.ExportJasonFile, geometry, surfaceLine.Geometry); - int surfPoints = soilProfile2D.Geometry.SurfaceLine.Points.Count; Assert.Multiple(() => { Assert.That(soilProfile2D.Geometry.Surfaces, Has.Count.EqualTo(surfaceCount)); @@ -85,11 +84,15 @@ }); } - [Test] - public void GivenSoilProfileForDwp1FromTutorial_WhenCombiningWithSurfaceLineUsingAShiftOfGeometry_ThenExpectedSoilProfile2DIsCreated() + [Test, Category(Categories.WorkInProgress)] + [TestCase("DWP_1", 0, 1.248)] + [TestCase("DWP_6", 5, 1.000)] + [TestCase("DWP_7", 6, 1.000)] + [TestCase("DWP_20", 19, 1.000)] + public void GivenLocationFromDesignTutorialStability_WhenCalculating_ThenResultAvailable(string location, int segmentIndex, double safetyFactor) { string inputString = File.ReadAllText(tutorialStability2D); - string[] locations = ["DWP_1"]; + string[] locations = [location]; inputString = XmlAdapter.SelectLocations(inputString, locations); var engineInterface = new EngineInterface(inputString); double shift = engineInterface.DamProjectData.Dike.Locations[0].XSoilGeometry2DOrigin; @@ -98,12 +101,25 @@ Soil fillingMaterial = engineInterface.DamProjectData.Dike.SoilList.GetSoilByName(soilName); SoilProfile2D soilProfile2D = SoilProfile2DSurfaceLineHelper.CombineSurfaceLineWithSoilProfile2D(surfaceLine.Geometry, - engineInterface.DamProjectData.Segments[0].SoilProfileProbabilities[0].SoilProfile2D, fillingMaterial, shift); + engineInterface.DamProjectData.Segments[segmentIndex].SoilProfileProbabilities[0].SoilProfile2D, fillingMaterial, shift); + if (location == "DWP_1") + { + Assert.Multiple(() => + { + Assert.That(soilProfile2D.Geometry.Surfaces, Has.Count.EqualTo(20)); + Assert.That(soilProfile2D.Surfaces, Has.Count.EqualTo(20)); + Assert.That(soilProfile2D.Surfaces.Where(s => s.SoilName == fillingMaterial.Name).ToList(), Has.Count.EqualTo(3)); + }); + } + + var outputName = "OutputFor" + location + ".xml"; + GeneralHelper.RunAfterInputValidation(engineInterface, true, outputName); + int errorCount = GeneralHelper.DetermineNumberOfCalculationErrors(engineInterface.DamProjectData.CalculationMessages); Assert.Multiple(() => { - Assert.That(soilProfile2D.Geometry.Surfaces, Has.Count.EqualTo(20)); - Assert.That(soilProfile2D.Surfaces, Has.Count.EqualTo(20)); - Assert.That(soilProfile2D.Surfaces.Where(s => s.SoilName == fillingMaterial.Name).ToList(), Has.Count.EqualTo(3)); + Assert.That(errorCount, Is.EqualTo(0), "There should be no errors during the calculation."); + Assert.That(engineInterface.DamProjectData.DesignCalculations, Has.Count.EqualTo(1), "There should be one design calculation."); + Assert.That(engineInterface.DamProjectData.DesignCalculations[0].SafetyFactor, Is.EqualTo(safetyFactor).Within(0.001), "The safety factor is incorrect."); }); } } \ No newline at end of file