Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/IssuesTests.cs =================================================================== diff -u -r7057 -r7060 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/IssuesTests.cs (.../IssuesTests.cs) (revision 7057) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/IssuesTests.cs (.../IssuesTests.cs) (revision 7060) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.IO; using System.Linq; using Deltares.DamEngine.Calculators.KernelWrappers.MacroStabilityCommon; @@ -60,17 +61,18 @@ const string xmlInput = @"TestFiles\InputFileMWDAM-3266.xml"; TestGeometryAndResult(calcDir, xmlInput, location, segment, surfaceCount, curveCount, pointCount, surfaceLinePointCount, safetyFactor); } - - [Test, Category(Categories.WorkInProgress)] - [TestCase("DWP-SC0035+50m_88111_3", "Schermer_sectie_3",24, 248, 227, 177, 999)] - [TestCase("DWP-SC0200+50m_88111_11", "Schermer_sectie_11",15, 191, 177, 84, 0.831)] - [TestCase("DWP_SC0234_88111_13", "Schermer_sectie_13",20, 187, 169, 2, 999)] - [TestCase("DWP_SC0264+50m_88111_14", "Schermer_sectie_14",15, 206, 192, 20, 1.031)] - public void TestGeometryAndResultForIssueMWDAM_3279(string location, string segment, int surfaceCount, int curveCount, int pointCount, int surfaceLinePointCount, double safetyFactor) + + [SetUICulture("nl-NL")] + [Test] + [TestCase("DWP-SC0035+50m_88111_3", "Schermer_sectie_3")] + [TestCase("DWP-SC0200+50m_88111_11", "Schermer_sectie_11")] + [TestCase("DWP_SC0234_88111_13", "Schermer_sectie_13")] + [TestCase("DWP_SC0264+50m_88111_14", "Schermer_sectie_14")] + public void TestGeometryAndResultForIssueMWDAM_3279(string location, string segment) { const string calcDir = "TestGeometryAndResultForIssueMWDAM_3279"; const string xmlInput = @"TestFiles\InputFileMWDAM-3279.xml"; - TestGeometryAndResult(calcDir, xmlInput, location, segment, surfaceCount, curveCount, pointCount, surfaceLinePointCount, safetyFactor); + TestGeometryAndResult(calcDir, xmlInput, location, segment, 0, 0, 0, 0, 0); } private static void TestGeometryAndResult(string calcDirectory, string xmlInput, string location, string segment, int surfaceCount, int curveCount, int pointCount, int surfaceLinePointCount, double safetyFactor) @@ -101,26 +103,44 @@ Soil soil = engineInterface.DamProjectData.Dike.SoilList.GetSoilByName(soilName); // To be able to check the geometry, create it here. SoilGeometryProbability soilProfile2DOriginal = engineInterface.DamProjectData.Segments.First(s => s.Name == segment).SoilProfileProbabilities[0]; - SoilProfile2D soilProfile2D = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilProfile2DOriginal, surfaceLine, soil); - // For debugging purposes - //geometry = soilProfile2D.Geometry; - //GeometryExporter.ExportToFile(geometry, GeometryExporter.VisualizationFolder + location + "GeometryEnd.txt"); - //GeometryExporter.ExportWithSurfaceLineToJsonFile(GeometryExporter.VisualizationFolder + - // GeometryExporter.ExportJasonFile, geometry, surfaceLine.Geometry); - Assert.Multiple(() => + var expectedException = ""; + SoilProfile2D soilProfile2D = null; + try { - Assert.That(soilProfile2D.Geometry.Surfaces, Has.Count.EqualTo(surfaceCount)); - Assert.That(soilProfile2D.Geometry.Curves, Has.Count.EqualTo(curveCount)); - Assert.That(soilProfile2D.Geometry.Points, Has.Count.EqualTo(pointCount)); - Assert.That(soilProfile2D.Geometry.SurfaceLine.Points, Has.Count.EqualTo(surfaceLinePointCount)); - }); - GeneralHelper.RunAfterInputValidation(engineInterface, true, outputName); - int errorCount = GeneralHelper.DetermineNumberOfCalculationErrors(engineInterface.DamProjectData.CalculationMessages); - Assert.Multiple(() => + soilProfile2D = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilProfile2DOriginal, surfaceLine, soil); + // For debugging purposes + //geometry = soilProfile2D.Geometry; + //GeometryExporter.ExportToFile(geometry, GeometryExporter.VisualizationFolder + location + "GeometryEnd.txt"); + //GeometryExporter.ExportWithSurfaceLineToJsonFile(GeometryExporter.VisualizationFolder + + // GeometryExporter.ExportJasonFile, geometry, surfaceLine.Geometry); + } + catch (Exception exception) { - 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."); - }); + expectedException = exception.Message; + } + + if (surfaceCount == 0) + { + Assert.That(expectedException, Does.Contain("DAM kon geen geldig 2D‑grondprofiel genereren bij het " + + "combineren van de hoogtegeometrie uit het CSV‑bestand met het grondprofiel uit het STIX‑bestand.")); + } + else + { + Assert.Multiple(() => + { + Assert.That(soilProfile2D.Geometry.Surfaces, Has.Count.EqualTo(surfaceCount)); + Assert.That(soilProfile2D.Geometry.Curves, Has.Count.EqualTo(curveCount)); + Assert.That(soilProfile2D.Geometry.Points, Has.Count.EqualTo(pointCount)); + Assert.That(soilProfile2D.Geometry.SurfaceLine.Points, Has.Count.EqualTo(surfaceLinePointCount)); + }); + GeneralHelper.RunAfterInputValidation(engineInterface, true, outputName); + int errorCount = GeneralHelper.DetermineNumberOfCalculationErrors(engineInterface.DamProjectData.CalculationMessages); + Assert.Multiple(() => + { + 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