using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Deltares.DamEngine.Calculators.KernelWrappers.Common; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.PlLines; using Deltares.DamEngine.Data.Geometry; using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.TestHelpers; using NUnit.Framework; namespace Deltares.DamEngine.Calculators.Tests.KernelWrappers.Common { [TestFixture] public class PlLinesHelperTests { [Test] public void TestCreatePlLines() { // expected values retrieved from debugging Dam Classic (rev.663) // test CanCalculateThePipingFactorUsingSellmeijer4Forces var location = new Location(); location.SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); var soilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(); var riverLevel = 1.0; UpliftSituation upliftSituation; var plLines = PlLinesHelper.CreatePlLines(location, soilProfile1D, riverLevel, out upliftSituation); Assert.AreEqual(4, plLines.PLLineCount); Assert.AreEqual(8, plLines.Lines[PLLineType.PL1].Points.Count); Assert.IsTrue(new PLLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PLLineType.PL1].Points[0])); Assert.IsTrue(new PLLinePoint(14.900, 1.000).LocationEquals(plLines.Lines[PLLineType.PL1].Points[1])); Assert.IsTrue(new PLLinePoint(34.500, 0.500).LocationEquals(plLines.Lines[PLLineType.PL1].Points[2])); Assert.IsTrue(new PLLinePoint(40.500, 0.000).LocationEquals(plLines.Lines[PLLineType.PL1].Points[3])); Assert.IsTrue(new PLLinePoint(50.500, 0.000).LocationEquals(plLines.Lines[PLLineType.PL1].Points[4])); Assert.IsTrue(new PLLinePoint(58.500, 0.000).LocationEquals(plLines.Lines[PLLineType.PL1].Points[5])); Assert.IsTrue(new PLLinePoint(61.500, 0.000).LocationEquals(plLines.Lines[PLLineType.PL1].Points[6])); Assert.IsTrue(new PLLinePoint(75.000, 0.000).LocationEquals(plLines.Lines[PLLineType.PL1].Points[7])); Assert.AreEqual(0, plLines.Lines[PLLineType.PL2].Points.Count); Assert.AreEqual(2, plLines.Lines[PLLineType.PL3].Points.Count); Assert.IsTrue(new PLLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PLLineType.PL3].Points[0])); Assert.IsTrue(new PLLinePoint(75.000, 1.000).LocationEquals(plLines.Lines[PLLineType.PL3].Points[1])); Assert.AreEqual(0, plLines.Lines[PLLineType.PL4].Points.Count); } } }