Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalStabilityProfile1DTests.cs =================================================================== diff -u -r5698 -r5761 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalStabilityProfile1DTests.cs (.../OperationalStabilityProfile1DTests.cs) (revision 5698) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalStabilityProfile1DTests.cs (.../OperationalStabilityProfile1DTests.cs) (revision 5761) @@ -19,12 +19,17 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections.Generic; using System.IO; +using System.Linq; +using Deltares.DamEngine.Data.Standard; using Deltares.DamEngine.Io; using Deltares.DamEngine.Io.XmlOutput; using Deltares.DamEngine.TestHelpers; +using Deltares.MacroStability.Io.XmlInput; using KellermanSoftware.CompareNetObjects; using NUnit.Framework; +using Point2DType = Deltares.DamEngine.Io.XmlOutput.Point2DType; namespace Deltares.DamEngine.IntegrationTests.IntegrationTests; @@ -38,7 +43,8 @@ [TestCase("CalculateStabilityInsideBishopGrid1")] // This tests if the sensor location data is used in the calculation by changing the source type of Pl1 offset below diketop to // use the specified location data - [TestCase("CalculateStabilityInsideBishopGrid1", true)] + [TestCase("CalculateStabilityInsideBishopGrid1", true, 22.562, -1.7)] + // TODO The correct value for Z-Value should be -1.2, but now it is -1.7. This is a known issue and will be fixed in the future (MWDAM-2649). // Following testcase based on the DamLive test Deltares.DamLive.Tests.StabilityInsideUpliftVanBeeSwarmTest // "Deltares.DamLive.Tests\TestData\IntegrationTests\StabilityInsideUpliftVanBeeSwarm\DAMLive.damx" // with DamLive rev.4860 @@ -47,7 +53,8 @@ // "Deltares.DamLive.Tests\TestData\IntegrationTests\StabilityInsideUpliftVanGrid\DAMLive.damx" // with DamLive rev.4860 [TestCase("CalculateStabilityInsideUpliftVanGrid1")] - public void GivenStabilityInsideProfile1DProject_WhenCalculatingWithSpecifiedModel_ThenExpectedResultIsGenerated(string baseName, bool isUseSensorLocationData = false) + public void GivenStabilityInsideProfile1DProject_WhenCalculatingWithSpecifiedModel_ThenExpectedResultIsGenerated( + string baseName, bool isUseSensorLocationData = false, double expectedPlLineXValue = 0.0, double expectedPlLineZValue = 0.0) { const string calcDir = "DAMLive.Calc"; const string testFilesLocation = @".\TestFiles\Operational\Profile1DTests\"; @@ -85,7 +92,21 @@ // When // Run calculation Output actualOutput = GeneralHelper.RunAfterInputValidation(inputString, true, outputFilename); - + if (isUseSensorLocationData) + { + // Read the kernel input data from the input file + string kernelInputFilename = $"{baseName}_UseLocationData\\DAMLive.Calc\\Stability\\Bishop\\Dik(dike)_Loc(Purmer_PU0042+00_K)_Stp(0)_Mdl(Bishop)_2016-03-02T03_10_00_Pro(Purmer_PU0042+00K).skx"; + FullInputModelType expectedMacrostabilityInput = MacroStability.Io.MacroStabilityXmlSerialization.LoadInputFromXmlFile(kernelInputFilename); + List phreaticLine = expectedMacrostabilityInput.StabilityModel.ConstructionStages[0].Waternet.PhreaticLine.WaternetLine.Points.ToList(); + var expectedPoint = new Point2DType() + { + X = expectedPlLineXValue, + Z = expectedPlLineZValue + }; + const double tolerance = 0.0005; + bool pointExists = phreaticLine.Any(p => p.X.IsNearEqual(expectedPoint.X, tolerance) && p.Z.IsNearEqual(expectedPoint.Z, tolerance)); + Assert.That(pointExists, Is.True, "The expected point was not found in the phreatic line."); + } // Then // Compare output Assert.Multiple(() =>