Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/DikesDesign/SurfaceLineHeightAdapterTest.cs
===================================================================
diff -u -r971 -r1090
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/DikesDesign/SurfaceLineHeightAdapterTest.cs (.../SurfaceLineHeightAdapterTest.cs) (revision 971)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/DikesDesign/SurfaceLineHeightAdapterTest.cs (.../SurfaceLineHeightAdapterTest.cs) (revision 1090)
@@ -114,8 +114,8 @@
surfaceLine.EnsurePointOfType(pointAtToePolder.X, pointAtToePolder.Z, CharacteristicPointType.DikeToeAtPolder);
var surfaceLineAdapter = new SurfaceLineHeightAdapter(surfaceLine, location);
var newSurfaceLine = surfaceLineAdapter.ConstructNewSurfaceLine(newDikeHeight);
- double oldSlope = surfaceLine.TanSlopeInside();
- double newSlope = newSurfaceLine.TanSlopeInside();
+ double oldSlope = TanSlopeInside(surfaceLine);
+ double newSlope = TanSlopeInside(newSurfaceLine);
Assert.AreEqual(oldSlope, newSlope, cToleranceSlope);
}
@@ -259,8 +259,8 @@
var actualPoint = newSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder);
var expectedPoint = new GeometryPoint { X = 13 };
Assert.IsTrue(expectedPoint.LocationEquals(actualPoint));
- double oldSlope = surfaceLine.TanSlopeInside();
- double newSlope = newSurfaceLine.TanSlopeInside();
+ double oldSlope = TanSlopeInside(surfaceLine);
+ double newSlope = TanSlopeInside(newSurfaceLine);
Assert.AreEqual(oldSlope, newSlope, 0.001);
}
@@ -990,5 +990,17 @@
var newSurfaceLine = surfaceLineAdapter.ConstructNewSurfaceLine(newDikeHeight);
Assert.Null(newSurfaceLine);
}
+ ///
+ /// Determines the tan slope inside.
+ ///
+ /// tan slope inside
+ private static double TanSlopeInside(SurfaceLine2 line)
+ {
+ GeometryPoint dikeToeInward = line.GetDikeToeInward();
+ GeometryPoint dikeTopAtPolder = line.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder);
+ return (dikeTopAtPolder.Z - dikeToeInward.Z) /
+ (dikeToeInward.X - dikeTopAtPolder.X);
+ }
+
}
}