Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/PlLinesCreator/PlLinesCreatorTest.cs =================================================================== diff -u -r5224 -r5227 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/PlLinesCreator/PlLinesCreatorTest.cs (.../PlLinesCreatorTest.cs) (revision 5224) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/PlLinesCreator/PlLinesCreatorTest.cs (.../PlLinesCreatorTest.cs) (revision 5227) @@ -34,7 +34,7 @@ [TestFixture] public class PlLinesCreatorTest { - private const double tolerance = 0.001; + private const double tolerance4Decimals = 0.000051; [SetUp] public void TestFixtureSetup() {} @@ -48,7 +48,6 @@ [Test] public void CreatePl1WithPolderLevelHigherDikeToeAtPolder() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineSimpleDike = FactoryForSurfaceLines.CreateSurfacelineSimpleDike(); var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator @@ -70,14 +69,14 @@ Assert.That(plLine.Points, Has.Count.EqualTo(4)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(9.25).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(9.25).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); }); plLineCreator.ModelParametersForPlLines.PlLineCreationMethod = PlLineCreationMethod.ExpertKnowledgeRRD; @@ -87,18 +86,18 @@ Assert.That(plLine.Points, Has.Count.EqualTo(6)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(3.5).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(2.5).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(9.25).Within(cTolerance)); // this point and following points are raised to match polderlevel - Assert.That(plLine.Points[4].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(3.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(2.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(9.25).Within(tolerance4Decimals)); // this point and following points are raised to match polderlevel + Assert.That(plLine.Points[4].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); }); } @@ -109,7 +108,6 @@ [Test] public void CreatePL1WithPolderLevelBetweenShoulderBaseInsideAndShoulderTopInside() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineDikeWithSlopingShoulder = FactoryForSurfaceLines.CreateSurfacelineDikeWithSlopingShoulder(); var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator { @@ -132,20 +130,20 @@ Assert.That(plLine.Points, Has.Count.EqualTo(7)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(3.5).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(9.0).Within(cTolerance)); // This point has offset below surface level of PlLineOffsetBelowShoulderBaseInside - Assert.That(plLine.Points[4].Z, Is.EqualTo(2.9).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(10.0).Within(cTolerance)); // This point and following points are raised to match polder level - Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[6].X, Is.EqualTo(15).Within(cTolerance)); - Assert.That(plLine.Points[6].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(3.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(9.0).Within(tolerance4Decimals)); // This point has offset below surface level of PlLineOffsetBelowShoulderBaseInside + Assert.That(plLine.Points[4].Z, Is.EqualTo(2.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); // This point and following points are raised to match polder level + Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[6].X, Is.EqualTo(15).Within(tolerance4Decimals)); + Assert.That(plLine.Points[6].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); }); } @@ -155,7 +153,6 @@ [Test] public void CreatePL1WithPolderLevelHigherShoulderBaseInside() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineDikeWithSlopingShoulder = FactoryForSurfaceLines.CreateSurfacelineDikeWithSlopingShoulder(); var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator { @@ -178,56 +175,56 @@ Assert.That(plLine.Points, Has.Count.EqualTo(6)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.5).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(3.5).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.5).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(3.5).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(8.75).Within(cTolerance)); // This point and following points are raised to match polderlevel - Assert.That(plLine.Points[4].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(15).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(3.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(3.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(8.75).Within(tolerance4Decimals)); // This point and following points are raised to match polderlevel + Assert.That(plLine.Points[4].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(15).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); }); plLineCreator.WaterLevelPolder = 3.75; // CharacteristicPointType.ShoulderBaseInside.Z = 3.0); Higher than PlLineOffsetBelowDikeTopAtPolder plLine = plLineCreator.CreatePlLineByExpertKnowledge(PlLineType.Pl1, 0.02); Assert.That(plLine.Points, Has.Count.EqualTo(6)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.5).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(3.5).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.5).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); // This point and following points are raised to match polderlevel - Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(8.25).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(15).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(3.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); // This point and following points are raised to match polderlevel + Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(8.25).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(15).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); }); plLineCreator.WaterLevelPolder = 4.25; // CharacteristicPointType.ShoulderBaseInside.Z = 3.0); Higher than PlLineOffsetBelowDikeTopAtRiver plLine = plLineCreator.CreatePlLineByExpertKnowledge(PlLineType.Pl1, 0.02); Assert.That(plLine.Points, Has.Count.EqualTo(6)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.5).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(3.5).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.5).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); // This point and following points are raised to match polderlevel - Assert.That(plLine.Points[2].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(7.75).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(15).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(3.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); // This point and following points are raised to match polderlevel + Assert.That(plLine.Points[2].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(7.75).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(15).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); }); } @@ -261,7 +258,6 @@ [Test] public void CreatePL1For1DGeometryWithExpertKnowledgeLinearInDike() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineSimpleDike = FactoryForSurfaceLines.CreateSurfacelineSimpleDike(); var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator @@ -283,14 +279,14 @@ Assert.That(plLine.Points, Has.Count.EqualTo(4)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(10).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(0.9).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(0.9).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(10).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); }); } @@ -300,7 +296,6 @@ [Test] public void CreatePL1For1DGeometryWithExpertKnowledgeLinearInDikeWithShoulder() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineSimpleDike = FactoryForSurfaceLines.CreateSurfacelineSimpleDike(); // Add shoulder; this should not affect the creation of the phreatic line surfaceLineSimpleDike.EnsurePointOfType(8.0, 4.0, CharacteristicPointType.ShoulderBaseInside); @@ -327,14 +322,14 @@ Assert.That(plLine.Points, Has.Count.EqualTo(4)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(10).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(0.9).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(0.9).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(10).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); }); } @@ -344,7 +339,6 @@ [Test] public void CreatePL1LowMidFor1DGeometryWithExpertKnowledgeLinearInDike() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineSimpleDike = FactoryForSurfaceLines.CreateSurfacelineSimpleDike(); var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator { @@ -367,16 +361,16 @@ Assert.That(plLine.Points, Has.Count.EqualTo(5)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(2.0).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(3.9).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(10).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(0.9).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(2.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(3.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(10).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); }); } @@ -412,7 +406,6 @@ [Test] public void CreatePL1LowMidFor1DGeometryWithExpertKnowledgeLinearInDikeWithMultiSegmentTalud() { - const double cTolerance = 0.0001; var surfaceLine = new SurfaceLine2 { Geometry = new GeometryPointString(), @@ -453,16 +446,16 @@ Assert.That(plLine.Points, Has.Count.EqualTo(5)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(2.5).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(3.9).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(10).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(0.9).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(2.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(3.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(10).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); }); } @@ -516,7 +509,6 @@ [Test] public void CreatePL1For1DGeometryWithExpertKnowledgeRRD() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineSimpleDike = FactoryForSurfaceLines.CreateSurfacelineSimpleDike(); var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator @@ -538,18 +530,18 @@ Assert.That(plLine.Points, Has.Count.EqualTo(6)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh - plLineCreator.PlLineOffsetBelowDikeTopAtRiver).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh - plLineCreator.PlLineOffsetBelowDikeTopAtPolder).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(10.0).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(0.9).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh - plLineCreator.PlLineOffsetBelowDikeTopAtRiver).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh - plLineCreator.PlLineOffsetBelowDikeTopAtPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); }); } @@ -560,7 +552,6 @@ [Test] public void CreatePl1For1DGeometryWithExpertKnowledgeRrdIfRiverLevelEqualsTopOfDike() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineSimpleDike = FactoryForSurfaceLines.CreateSurfacelineSimpleDike(); { var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator @@ -582,18 +573,18 @@ Assert.That(plLine.Points, Has.Count.EqualTo(6)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(plLineCreator.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh - plLineCreator.PlLineOffsetBelowDikeTopAtRiver).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh - plLineCreator.PlLineOffsetBelowDikeTopAtPolder).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(10.0).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(0.9).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(plLineCreator.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh - plLineCreator.PlLineOffsetBelowDikeTopAtRiver).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelRiverHigh - plLineCreator.PlLineOffsetBelowDikeTopAtPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); }); } } @@ -604,7 +595,6 @@ [Test] public void CreatePL1_WithPointBelowDikeTopAtPolderLowerPolderLevel_ReturnsPointAtPolderLevel() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineSimpleDike = FactoryForSurfaceLines.CreateSurfacelineSimpleDike(); { var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator @@ -624,16 +614,16 @@ Assert.That(plLine.Points, Has.Count.EqualTo(6)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(2.5).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(2.0).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(10).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(2.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(2.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(10).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(plLineCreator.WaterLevelPolder).Within(tolerance4Decimals)); }); } } @@ -645,7 +635,6 @@ [Test] public void CreatePL1_WithPointBelowShoulderAndPointBelowToeDefined_ReturnsCorrectPl1() { - const double cTolerance = 0.0001; var surfaceLine = new SurfaceLine2 { Geometry = new GeometryPointString(), @@ -685,25 +674,24 @@ Assert.That(plLine.Points, Has.Count.EqualTo(7)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(2.5).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(2.0).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(8.0).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(1.8).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(10.0).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(0.7).Within(cTolerance)); - Assert.That(plLine.Points[6].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[6].Z, Is.EqualTo(0.7).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(2.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(2.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(8.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(1.8).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(0.7).Within(tolerance4Decimals)); + Assert.That(plLine.Points[6].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[6].Z, Is.EqualTo(0.7).Within(tolerance4Decimals)); }); } [Test] public void CreatePL1_WithPointBelowShoulderAndPointBelowToeDefinedWithSlopingSurfaceAtPolderSide_ReturnsCorrectPl1() { - const double cTolerance = 0.0001; var surfaceLine = new SurfaceLine2 { Geometry = new GeometryPointString(), @@ -746,29 +734,28 @@ Assert.That(plLine.Points, Has.Count.EqualTo(9)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(2.5).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(2.0).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(8.0).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(1.8).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(10.0).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(0.7).Within(cTolerance)); - Assert.That(plLine.Points[6].X, Is.EqualTo(11).Within(cTolerance)); - Assert.That(plLine.Points[6].Z, Is.EqualTo(0.2).Within(cTolerance)); - Assert.That(plLine.Points[7].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[7].Z, Is.EqualTo(0.1).Within(cTolerance)); - Assert.That(plLine.Points[8].X, Is.EqualTo(13).Within(cTolerance)); - Assert.That(plLine.Points[8].Z, Is.EqualTo(0.0).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(2.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(2.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(8.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(1.8).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(0.7).Within(tolerance4Decimals)); + Assert.That(plLine.Points[6].X, Is.EqualTo(11).Within(tolerance4Decimals)); + Assert.That(plLine.Points[6].Z, Is.EqualTo(0.2).Within(tolerance4Decimals)); + Assert.That(plLine.Points[7].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[7].Z, Is.EqualTo(0.1).Within(tolerance4Decimals)); + Assert.That(plLine.Points[8].X, Is.EqualTo(13).Within(tolerance4Decimals)); + Assert.That(plLine.Points[8].Z, Is.EqualTo(0.0).Within(tolerance4Decimals)); }); } [Test] public void CreatePL1_WithPointBelowShoulderAndPointBelowToeDefinedWithSlopingSurfaceAtPolderSidePartBelowPolderLevel_ReturnsCorrectPl1() { - const double cTolerance = 0.0001; var surfaceLine = new SurfaceLine2 { Geometry = new GeometryPointString(), @@ -811,29 +798,28 @@ Assert.That(plLine.Points, Has.Count.EqualTo(9)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(2.5).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(2.0).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(8.0).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(1.8).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(10.0).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(0.7).Within(cTolerance)); - Assert.That(plLine.Points[6].X, Is.EqualTo(11).Within(cTolerance)); - Assert.That(plLine.Points[6].Z, Is.EqualTo(0.2).Within(cTolerance)); - Assert.That(plLine.Points[7].X, Is.EqualTo(11.5).Within(cTolerance)); - Assert.That(plLine.Points[7].Z, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[8].X, Is.EqualTo(15).Within(cTolerance)); - Assert.That(plLine.Points[8].Z, Is.EqualTo(0.0).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(2.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(2.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(8.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(1.8).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(0.7).Within(tolerance4Decimals)); + Assert.That(plLine.Points[6].X, Is.EqualTo(11).Within(tolerance4Decimals)); + Assert.That(plLine.Points[6].Z, Is.EqualTo(0.2).Within(tolerance4Decimals)); + Assert.That(plLine.Points[7].X, Is.EqualTo(11.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[7].Z, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[8].X, Is.EqualTo(15).Within(tolerance4Decimals)); + Assert.That(plLine.Points[8].Z, Is.EqualTo(0.0).Within(tolerance4Decimals)); }); } [Test] public void CreatePL1_WithPointBelowShoulderAndPointBelowToeDefinedWithSlopingSurfaceAtPolderSideAllBelowPolderLevel_ReturnsCorrectPl1() { - const double cTolerance = 0.0001; var surfaceLine = new SurfaceLine2 { Geometry = new GeometryPointString(), @@ -874,18 +860,18 @@ Assert.That(plLine.Points, Has.Count.EqualTo(7)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(2.5).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(2.0).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(8.0).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(1.8).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(10.0).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(1.0).Within(cTolerance)); - Assert.That(plLine.Points[6].X, Is.EqualTo(13).Within(cTolerance)); - Assert.That(plLine.Points[6].Z, Is.EqualTo(1.0).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(2.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(2.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(8.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(1.8).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(1.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[6].X, Is.EqualTo(13).Within(tolerance4Decimals)); + Assert.That(plLine.Points[6].Z, Is.EqualTo(1.0).Within(tolerance4Decimals)); }); } @@ -895,7 +881,6 @@ [Test] public void CreatePL1LowFor1DGeometryWithExpertKnowledgeRRD() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineSimpleDike = FactoryForSurfaceLines.CreateSurfacelineSimpleDike(); { var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator @@ -918,18 +903,18 @@ Assert.That(plLine.Points, Has.Count.EqualTo(6)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(2.0).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(3.0).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(3.5).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(2.5).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(10).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(0.9).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(2.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(3.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(3.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(2.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(10).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); }); } } @@ -940,7 +925,6 @@ [Test] public void CreatePL1LowJustAboveToeFor1DGeometryWithExpertKnowledgeRRD() { - const double cTolerance = 0.0001; SurfaceLine2 surfaceLineSimpleDike = FactoryForSurfaceLines.CreateSurfacelineSimpleDike(); // Add voorland to dike surfaceLineSimpleDike.EnsurePointOfType(-2.0, 0.0, CharacteristicPointType.SurfaceLevelOutside); @@ -968,18 +952,18 @@ Assert.That(plLine.Points, Has.Count.EqualTo(6)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(-2.0).Within(cTolerance)); - Assert.That(plLine.Points[0].Z, Is.EqualTo(2.1).Within(cTolerance)); - Assert.That(plLine.Points[1].X, Is.EqualTo(1.1).Within(cTolerance)); - Assert.That(plLine.Points[1].Z, Is.EqualTo(2.1).Within(cTolerance)); - Assert.That(plLine.Points[2].X, Is.EqualTo(4).Within(cTolerance)); - Assert.That(plLine.Points[2].Z, Is.EqualTo(3.5).Within(cTolerance)); - Assert.That(plLine.Points[3].X, Is.EqualTo(7).Within(cTolerance)); - Assert.That(plLine.Points[3].Z, Is.EqualTo(2.5).Within(cTolerance)); - Assert.That(plLine.Points[4].X, Is.EqualTo(10).Within(cTolerance)); - Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(cTolerance)); - Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(cTolerance)); - Assert.That(plLine.Points[5].Z, Is.EqualTo(0.9).Within(cTolerance)); + Assert.That(plLine.Points[0].X, Is.EqualTo(-2.0).Within(tolerance4Decimals)); + Assert.That(plLine.Points[0].Z, Is.EqualTo(2.1).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].X, Is.EqualTo(1.1).Within(tolerance4Decimals)); + Assert.That(plLine.Points[1].Z, Is.EqualTo(2.1).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].X, Is.EqualTo(4).Within(tolerance4Decimals)); + Assert.That(plLine.Points[2].Z, Is.EqualTo(3.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].X, Is.EqualTo(7).Within(tolerance4Decimals)); + Assert.That(plLine.Points[3].Z, Is.EqualTo(2.5).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].X, Is.EqualTo(10).Within(tolerance4Decimals)); + Assert.That(plLine.Points[4].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].X, Is.EqualTo(12).Within(tolerance4Decimals)); + Assert.That(plLine.Points[5].Z, Is.EqualTo(0.9).Within(tolerance4Decimals)); }); } @@ -1661,16 +1645,16 @@ Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance)); // start - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance)); // entry point - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[2].X, Is.EqualTo(50.5).Within(tolerance)); // dike toe polder - Assert.That(plLine.Points[2].Z, Is.EqualTo(2.65).Within(tolerance)); // head dike toe polder - Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance)); // dike toe polder - Assert.That(plLine.Points[3].Z, Is.EqualTo(2.16).Within(tolerance)); // head dike toe polder + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); // start + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); // entry point + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[2].X, Is.EqualTo(50.5).Within(tolerance4Decimals)); // dike toe polder + Assert.That(plLine.Points[2].Z, Is.EqualTo(2.65).Within(tolerance4Decimals)); // head dike toe polder + Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance4Decimals)); // dike toe polder + Assert.That(plLine.Points[3].Z, Is.EqualTo(2.16).Within(tolerance4Decimals)); // head dike toe polder - Assert.That(plLine.ZFromX(plLineCreator.SurfaceLine.GetDikeToeInward().X), Is.EqualTo(2.65).Within(tolerance)); // headAtDikeToe + Assert.That(plLine.ZFromX(plLineCreator.SurfaceLine.GetDikeToeInward().X), Is.EqualTo(2.65).Within(tolerance4Decimals)); // headAtDikeToe }); } @@ -1715,14 +1699,14 @@ Assert.That(plLine.Points, Has.Count.EqualTo(4)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance)); // start - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance)); // entry point - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[2].X, Is.EqualTo(50.5).Within(tolerance)); // end - Assert.That(plLine.Points[2].Z, Is.EqualTo(-0.5).Within(tolerance)); // water level at polder - Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance)); // end - Assert.That(plLine.Points[3].Z, Is.EqualTo(-0.5).Within(tolerance)); // water level at polder + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); // start + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); // entry point + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[2].X, Is.EqualTo(50.5).Within(tolerance4Decimals)); // end + Assert.That(plLine.Points[2].Z, Is.EqualTo(-0.5).Within(tolerance4Decimals)); // water level at polder + Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance4Decimals)); // end + Assert.That(plLine.Points[3].Z, Is.EqualTo(-0.5).Within(tolerance4Decimals)); // water level at polder }); } @@ -2150,14 +2134,14 @@ Assert.That(plLine.Points, Has.Count.EqualTo(4)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance)); // start - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance)); // entry point - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[2].X, Is.EqualTo(59.5).Within(tolerance)); // ditch due to adjustment for uplift - Assert.That(plLine.Points[2].Z, Is.EqualTo(1.637).Within(tolerance)); // head ditch - Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance)); // end - Assert.That(plLine.Points[3].Z, Is.EqualTo(1.3276).Within(tolerance)); // headAtDikeEnd + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); // start + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); // entry point + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[2].X, Is.EqualTo(59.5).Within(tolerance4Decimals)); // ditch due to adjustment for uplift + Assert.That(plLine.Points[2].Z, Is.EqualTo(1.6376).Within(tolerance4Decimals)); // head ditch + Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance4Decimals)); // end + Assert.That(plLine.Points[3].Z, Is.EqualTo(1.3276).Within(tolerance4Decimals)); // headAtDikeEnd }); } @@ -2167,14 +2151,14 @@ Assert.That(plLine.Points, Has.Count.EqualTo(4)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance)); // start - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance)); // entry point - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[2].X, Is.EqualTo(50.5).Within(tolerance)); // ditch due to adjustment for uplift - Assert.That(plLine.Points[2].Z, Is.EqualTo(1.3).Within(tolerance)); // head ditch - Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance)); // end - Assert.That(plLine.Points[3].Z, Is.EqualTo(0.81).Within(tolerance)); // headAtDikeEnd + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); // start + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); // entry point + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[2].X, Is.EqualTo(50.5).Within(tolerance4Decimals)); // ditch due to adjustment for uplift + Assert.That(plLine.Points[2].Z, Is.EqualTo(1.3).Within(tolerance4Decimals)); // head ditch + Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance4Decimals)); // end + Assert.That(plLine.Points[3].Z, Is.EqualTo(0.81).Within(tolerance4Decimals)); // headAtDikeEnd }); } @@ -2183,14 +2167,14 @@ Assert.That(plLine.Points, Has.Count.EqualTo(4)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance)); // start - Assert.That(plLine.Points[0].Z, Is.EqualTo(1.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance)); // toe of dike - Assert.That(plLine.Points[1].Z, Is.EqualTo(1.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[2].X, Is.EqualTo(50.5).Within(tolerance)); // end - Assert.That(plLine.Points[2].Z, Is.EqualTo(0.55).Within(tolerance)); // headAtDikeEnd - Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance)); // end - Assert.That(plLine.Points[3].Z, Is.EqualTo(0.06).Within(tolerance)); // headAtDikeEnd + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); // start + Assert.That(plLine.Points[0].Z, Is.EqualTo(1.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); // toe of dike + Assert.That(plLine.Points[1].Z, Is.EqualTo(1.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[2].X, Is.EqualTo(50.5).Within(tolerance4Decimals)); // end + Assert.That(plLine.Points[2].Z, Is.EqualTo(0.55).Within(tolerance4Decimals)); // headAtDikeEnd + Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance4Decimals)); // end + Assert.That(plLine.Points[3].Z, Is.EqualTo(0.06).Within(tolerance4Decimals)); // headAtDikeEnd }); } @@ -2200,14 +2184,14 @@ Assert.That(plLine.Points, Has.Count.EqualTo(4)); Assert.Multiple(() => { - Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance)); // start - Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance)); // entry point - Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance)); // water level at river - Assert.That(plLine.Points[2].X, Is.EqualTo(50.5).Within(tolerance)); // dike toe - Assert.That(plLine.Points[2].Z, Is.EqualTo(2.2).Within(tolerance)); // head dike toe - Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance)); // end - Assert.That(plLine.Points[3].Z, Is.EqualTo(1.71).Within(tolerance)); // head end + Assert.That(plLine.Points[0].X, Is.EqualTo(0.0).Within(tolerance4Decimals)); // start + Assert.That(plLine.Points[0].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[1].X, Is.EqualTo(10.0).Within(tolerance4Decimals)); // entry point + Assert.That(plLine.Points[1].Z, Is.EqualTo(4.0).Within(tolerance4Decimals)); // water level at river + Assert.That(plLine.Points[2].X, Is.EqualTo(50.5).Within(tolerance4Decimals)); // dike toe + Assert.That(plLine.Points[2].Z, Is.EqualTo(2.2).Within(tolerance4Decimals)); // head dike toe + Assert.That(plLine.Points[3].X, Is.EqualTo(75.0).Within(tolerance4Decimals)); // end + Assert.That(plLine.Points[3].Z, Is.EqualTo(1.71).Within(tolerance4Decimals)); // head end }); } @@ -2242,24 +2226,24 @@ //[Test] //public void CreatePL1For2DGeometryWithExpertKnowledgeRRD() //{ - // const double cTolerance = 0.0001; + // const double tolerance = 0.0001; // var surfacelineSimpleDike = FactoryForSurfaceLines.CreateSurfacelineSimpleDike(); // { // PLLinesCreator plLineCreator = DefinePLLineCreatorFor2DGeometry(surfacelineSimpleDike); // PLLine plLine = plLineCreator.CreatePLLineByExpertKnowledge(PLLineType.PL1, 0.02); // Assert.AreEqual(6, plLine.Points.Count); - // Assert.AreEqual(0.0, plLine.Points[0].X, cTolerance); - // Assert.AreEqual(4.0, plLine.Points[0].Z, cTolerance); - // Assert.AreEqual(3.0, plLine.Points[1].X, cTolerance); - // Assert.AreEqual(4.0, plLine.Points[1].Z, cTolerance); - // Assert.AreEqual(4, plLine.Points[2].X, cTolerance); - // Assert.AreEqual(3.5, plLine.Points[2].Z, cTolerance); - // Assert.AreEqual(7, plLine.Points[3].X, cTolerance); - // Assert.AreEqual(2.5, plLine.Points[3].Z, cTolerance); - // Assert.AreEqual(10, plLine.Points[4].X, cTolerance); - // Assert.AreEqual(0.9, plLine.Points[4].Z, cTolerance); - // Assert.AreEqual(12, plLine.Points[5].X, cTolerance); - // Assert.AreEqual(0.9, plLine.Points[5].Z, cTolerance); + // Assert.AreEqual(0.0, plLine.Points[0].X, tolerance); + // Assert.AreEqual(4.0, plLine.Points[0].Z, tolerance); + // Assert.AreEqual(3.0, plLine.Points[1].X, tolerance); + // Assert.AreEqual(4.0, plLine.Points[1].Z, tolerance); + // Assert.AreEqual(4, plLine.Points[2].X, tolerance); + // Assert.AreEqual(3.5, plLine.Points[2].Z, tolerance); + // Assert.AreEqual(7, plLine.Points[3].X, tolerance); + // Assert.AreEqual(2.5, plLine.Points[3].Z, tolerance); + // Assert.AreEqual(10, plLine.Points[4].X, tolerance); + // Assert.AreEqual(0.9, plLine.Points[4].Z, tolerance); + // Assert.AreEqual(12, plLine.Points[5].X, tolerance); + // Assert.AreEqual(0.9, plLine.Points[5].Z, tolerance); // } //} } \ No newline at end of file