Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverterTests.cs =================================================================== diff -u -r2979 -r2980 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverterTests.cs (.../PlLinesToWaternetConverterTests.cs) (revision 2979) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverterTests.cs (.../PlLinesToWaternetConverterTests.cs) (revision 2980) @@ -341,9 +341,9 @@ var expectedBottomAquiferCoordinates = new [] { - new GeometryPoint(leftCoordinate, -25), - new GeometryPoint(rightCoordinate / 2, -25), - new GeometryPoint(rightCoordinate, -25), + bottomLeftInBetweenLayer, + new Point2D(rightCoordinate / 2, -25), + topRightBottomAquiferLayer }; WaternetLine pl2WaternetLine = waternet.WaternetLineList[0]; @@ -360,9 +360,9 @@ Assert.AreSame(waternet.HeadLineList[2], pl4WaternetLine.HeadLine); AssertGeometry(new[] { - new GeometryPoint(leftCoordinate, -10), - new GeometryPoint(rightCoordinate / 2, -10), - new GeometryPoint(rightCoordinate, -10) + bottomLeftUpperLayer, + topRightInBetweenAquiferLayerLeft, + topRightInBetweenAquiferLayerRight }, pl4WaternetLine.Points); } @@ -381,21 +381,19 @@ var bottomLeftUpperLayer = new Point2D(leftCoordinate, -10); SoilLayer2D soilLayer = CreateSoilLayer2D(topLeftUpperLayer, topRightUpperLayer, bottomRightUpperLayer, bottomLeftUpperLayer); - var topRightInBetweenAquiferLayer = new Point2D(rightCoordinate, -10); var bottomRightInBetweenAquiferLayer = new Point2D(rightCoordinate, -20); var bottomLeftInBetweenAquiferLayer = new Point2D(leftCoordinate, -20); - SoilLayer2D soilLayerAquiferInBetween = CreateSoilLayer2D(bottomLeftUpperLayer, topRightInBetweenAquiferLayer, bottomRightInBetweenAquiferLayer, bottomLeftInBetweenAquiferLayer); + SoilLayer2D soilLayerAquiferInBetween = CreateSoilLayer2D(bottomLeftUpperLayer, bottomRightUpperLayer, bottomRightInBetweenAquiferLayer, bottomLeftInBetweenAquiferLayer); soilLayerAquiferInBetween.IsAquifer = true; var topRightInBetweenLayer = new Point2D(rightCoordinate, -20); var bottomRightInBetweenLayer = new Point2D(rightCoordinate, -25); var bottomLeftInBetweenLayer = new Point2D(leftCoordinate, -25); SoilLayer2D soilLayerInBetween = CreateSoilLayer2D(bottomLeftInBetweenAquiferLayer, topRightInBetweenLayer, bottomRightInBetweenLayer, bottomLeftInBetweenLayer); - var topRightBottomAquiferLayer = new Point2D(rightCoordinate, -25); var bottomRightBottomAquiferLayer = new Point2D(rightCoordinate, -30); var bottomleftBottomAquiferLayer = new Point2D(leftCoordinate, -30); - SoilLayer2D soilLayerAquiferBottom = CreateSoilLayer2D(bottomLeftInBetweenLayer, topRightBottomAquiferLayer, bottomRightBottomAquiferLayer, bottomleftBottomAquiferLayer); + SoilLayer2D soilLayerAquiferBottom = CreateSoilLayer2D(bottomLeftInBetweenLayer, bottomRightInBetweenLayer, bottomRightBottomAquiferLayer, bottomleftBottomAquiferLayer); soilLayerAquiferBottom.IsAquifer = true; var soilProfile = new SoilProfile2D @@ -444,8 +442,8 @@ var expectedBottomAquiferCoordinates = new[] { - new GeometryPoint(leftCoordinate, -25), - new GeometryPoint(rightCoordinate, -25) + bottomLeftInBetweenLayer, + bottomRightInBetweenLayer }; WaternetLine pl2WaternetLine = waternet.WaternetLineList[0]; @@ -462,8 +460,8 @@ Assert.AreSame(waternet.HeadLineList[2], pl4WaternetLine.HeadLine); AssertGeometry(new[] { - new GeometryPoint(leftCoordinate, -10), - new GeometryPoint(rightCoordinate, -10) + bottomLeftUpperLayer, + bottomRightUpperLayer }, pl4WaternetLine.Points); } @@ -572,9 +570,9 @@ var expectedBottomAquiferCoordinates = new[] { - new GeometryPoint(leftCoordinate, -25), - new GeometryPoint(rightCoordinate / 2, -25), - new GeometryPoint(rightCoordinate, -25) + bottomLeftInBetweenLayer, + new Point2D(rightCoordinate / 2, -25), + bottomRightInBetweenLayer }; WaternetLine pl2WaternetLine = waternet.WaternetLineList[0]; @@ -698,9 +696,9 @@ var expectedBottomAquiferCoordinates = new[] { - new GeometryPoint(leftCoordinate, -25), - new GeometryPoint(rightCoordinate / 2, -25), - new GeometryPoint(rightCoordinate, -25) + bottomLeftInBetweenLayer, + new Point2D(rightCoordinate / 2, -25), + bottomRightInBetweenLayer }; WaternetLine pl2WaternetLine = waternet.WaternetLineList[0]; @@ -717,9 +715,9 @@ Assert.AreSame(waternet.HeadLineList[2], pl4WaternetLine.HeadLine); AssertGeometry(new[] { - new GeometryPoint(leftCoordinate, -10), - new GeometryPoint(rightCoordinate / 2, -5), - new GeometryPoint(rightCoordinate, -5) + bottomLeftUpperLayer, + bottomIntermediateUpperUpperLayer, + bottomRightUpperLayer }, pl4WaternetLine.Points); } @@ -841,9 +839,9 @@ var expectedBottomAquiferCoordinates = new[] { - new GeometryPoint(leftCoordinate, -25), - new GeometryPoint(rightCoordinate / 2, -25), - new GeometryPoint(rightCoordinate, -25) + bottomLeftInBetweenLayer, + new Point2D(rightCoordinate / 2, -25), + bottomRightInBetweenLayer }; WaternetLine pl2WaternetLine = waternet.WaternetLineList[0]; @@ -860,9 +858,9 @@ Assert.AreSame(waternet.HeadLineList[2], pl4WaternetLine.HeadLine); AssertGeometry(new[] { - new GeometryPoint(leftCoordinate, -10), - new GeometryPoint(rightCoordinate / 2, -10), - new GeometryPoint(rightCoordinate, -15) + bottomLeftUpperLayer, + bottomIntermediateUpperUpperLayer, + bottomRightUpperLayer }, pl4WaternetLine.Points); } @@ -985,9 +983,9 @@ var expectedBottomAquiferCoordinates = new[] { - new GeometryPoint(leftCoordinate, -25), - new GeometryPoint(rightCoordinate / 2, -25), - new GeometryPoint(rightCoordinate, -25) + bottomLeftInBetweenLayer, + new Point2D(rightCoordinate / 2, -25), + bottomRightInBetweenLayer }; WaternetLine pl2WaternetLine = waternet.WaternetLineList[0]; @@ -1004,9 +1002,9 @@ Assert.AreSame(waternet.HeadLineList[2], pl4WaternetLine.HeadLine); AssertGeometry(new[] { - new GeometryPoint(leftCoordinate, -10), - new GeometryPoint(rightCoordinate / 2, -5), - new GeometryPoint(rightCoordinate, -5) + bottomLeftUpperLayer, + bottomIntermediateLowerUpperLayer, + bottomRightUpperLayer }, pl4WaternetLine.Points); } @@ -1098,9 +1096,9 @@ var expectedBottomAquiferCoordinates = new[] { - new GeometryPoint(leftCoordinate, -25), - new GeometryPoint(rightCoordinate / 2, -25), - new GeometryPoint(rightCoordinate, -25) + bottomLeftInBetweenLayer, + new Point2D(rightCoordinate / 2, -25), + bottomRightInBetweenLayer }; WaternetLine pl2WaternetLine = waternet.WaternetLineList[0]; @@ -1414,10 +1412,10 @@ var bottomLeftLeftBottomLayer = new Point2D(leftCoordinate, -20); SoilLayer2D soilLayerAquiferPartOne = CreateSoilLayer2D(bottomLeftUpperLayer, topRightLeftBottomLayer, bottomRightLeftBottomLayer, bottomLeftLeftBottomLayer); soilLayerAquiferPartOne.IsAquifer = true; - + var topRightRightBottomLayer = new Point2D(rightCoordinate, -10); var bottomRightRightBottomLayer = new Point2D(rightCoordinate, -20); - SoilLayer2D soilLayerAquiferPartTwo = CreateSoilLayer2D(topRightLeftBottomLayer, topRightRightBottomLayer, bottomRightRightBottomLayer, bottomRightLeftBottomLayer); + SoilLayer2D soilLayerAquiferPartTwo = CreateSoilLayer2D(topRightLeftBottomLayer, bottomRightUpperLayer, bottomRightRightBottomLayer, bottomRightLeftBottomLayer); soilLayerAquiferPartTwo.IsAquifer = true; var soilProfileFullAdjoin = new SoilProfile2D @@ -1598,6 +1596,12 @@ }; } + private static void AssertGeometry(IEnumerable expectedPoints, IEnumerable actualPoints) + { + var convertedPoints = expectedPoints.Select(p => new GeometryPoint(p.X, p.Z)).ToArray(); + AssertGeometry(convertedPoints, actualPoints); + } + private static void AssertGeometry(IEnumerable expectedPoints, IEnumerable actualPoints) { int expectedNrOfPoints = expectedPoints.Count();