Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/DikesDesign/SurfaceLineAdapterTest.cs =================================================================== diff -u -r4000 -r4052 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/DikesDesign/SurfaceLineAdapterTest.cs (.../SurfaceLineAdapterTest.cs) (revision 4000) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/DikesDesign/SurfaceLineAdapterTest.cs (.../SurfaceLineAdapterTest.cs) (revision 4052) @@ -26,132 +26,131 @@ using Deltares.DamEngine.Data.Geotechnics; using NUnit.Framework; -namespace Deltares.DamEngine.Calculators.Tests.DikesDesign +namespace Deltares.DamEngine.Calculators.Tests.DikesDesign; + +[TestFixture] +public class SurfaceLineAdapterTest { - [TestFixture] - public class SurfaceLineAdapterTest - { - private readonly Location location = new Location(); + private readonly Location location = new Location(); - [TearDown] - public void TestFixtureTearDown() {} + [TearDown] + public void TestFixtureTearDown() {} - [Test] - public void ThrowsAnExceptionWhenSurfaceLineIsNull() - { - Assert.That(() => new StubSurfaceLineAdapter(null, location, 0), Throws.InstanceOf()); - } + [Test] + public void ThrowsAnExceptionWhenSurfaceLineIsNull() + { + Assert.That(() => new StubSurfaceLineAdapter(null, location, 0), Throws.InstanceOf()); + } - [Test] - public void ThrowsAnExceptionWhenSurfaceLineHasNoDike() + [Test] + public void ThrowsAnExceptionWhenSurfaceLineHasNoDike() + { + var surfaceLine = new SurfaceLine2 { - var surfaceLine = new SurfaceLine2 + CharacteristicPoints = { - CharacteristicPoints = - { - GeometryMustContainPoint = true - }, - Geometry = new GeometryPointString() - }; - surfaceLine.EnsurePoint(0, 0); - surfaceLine.EnsurePoint(1, 0); - surfaceLine.EnsurePoint(2, 0); - surfaceLine.EnsurePoint(3, 0); - Assert.That(() => new StubSurfaceLineAdapter(surfaceLine, location, 0), Throws.InstanceOf()); - } + GeometryMustContainPoint = true + }, + Geometry = new GeometryPointString() + }; + surfaceLine.EnsurePoint(0, 0); + surfaceLine.EnsurePoint(1, 0); + surfaceLine.EnsurePoint(2, 0); + surfaceLine.EnsurePoint(3, 0); + Assert.That(() => new StubSurfaceLineAdapter(surfaceLine, location, 0), Throws.InstanceOf()); + } - [Test] - public void ThrowsAnExceptionWhenSurfaceLineDoesNotComplyToSpecificationUsingZeroCoordValues() + [Test] + public void ThrowsAnExceptionWhenSurfaceLineDoesNotComplyToSpecificationUsingZeroCoordValues() + { + var surfaceLine1 = new SurfaceLine2 { - var surfaceLine1 = new SurfaceLine2 + CharacteristicPoints = { - CharacteristicPoints = - { - GeometryMustContainPoint = true - }, - Geometry = new GeometryPointString() - }; - surfaceLine1.EnsurePointOfType(0, 0, CharacteristicPointType.DikeToeAtRiver); - surfaceLine1.EnsurePointOfType(0, 0, CharacteristicPointType.DikeTopAtRiver); - surfaceLine1.EnsurePointOfType(0, 0, CharacteristicPointType.DikeTopAtPolder); - surfaceLine1.EnsurePointOfType(0, 0, CharacteristicPointType.DikeToeAtPolder); - Assert.That(() => new StubSurfaceLineAdapter(surfaceLine1, location, 0), Throws.InstanceOf()); - } + GeometryMustContainPoint = true + }, + Geometry = new GeometryPointString() + }; + surfaceLine1.EnsurePointOfType(0, 0, CharacteristicPointType.DikeToeAtRiver); + surfaceLine1.EnsurePointOfType(0, 0, CharacteristicPointType.DikeTopAtRiver); + surfaceLine1.EnsurePointOfType(0, 0, CharacteristicPointType.DikeTopAtPolder); + surfaceLine1.EnsurePointOfType(0, 0, CharacteristicPointType.DikeToeAtPolder); + Assert.That(() => new StubSurfaceLineAdapter(surfaceLine1, location, 0), Throws.InstanceOf()); + } - [Test] - public void ThrowsAnExceptionWhenSurfaceLineDoesNotComplyToSpecificationUsingAskewDikeTop() + [Test] + public void ThrowsAnExceptionWhenSurfaceLineDoesNotComplyToSpecificationUsingAskewDikeTop() + { + var surfaceLine1 = new SurfaceLine2 { - var surfaceLine1 = new SurfaceLine2 + CharacteristicPoints = { - CharacteristicPoints = - { - GeometryMustContainPoint = true - }, - Geometry = new GeometryPointString() - }; - var p1 = new GeometryPoint(); - var p2 = new GeometryPoint - { - X = 10, - Z = 10 - }; - var p3 = new GeometryPoint - { - X = 15, - Z = 15 - }; - surfaceLine1.EnsurePointOfType(p1.X, p1.Z, CharacteristicPointType.DikeToeAtRiver); - surfaceLine1.EnsurePointOfType(p2.X, p2.Z, CharacteristicPointType.DikeTopAtRiver); - surfaceLine1.EnsurePointOfType(p3.X, p3.Z, CharacteristicPointType.DikeTopAtPolder); - surfaceLine1.EnsurePointOfType(p1.X, p1.Z, CharacteristicPointType.DikeToeAtPolder); - Assert.That(() => new StubSurfaceLineAdapter(surfaceLine1, location, 0), Throws.InstanceOf()); - } + GeometryMustContainPoint = true + }, + Geometry = new GeometryPointString() + }; + var p1 = new GeometryPoint(); + var p2 = new GeometryPoint + { + X = 10, + Z = 10 + }; + var p3 = new GeometryPoint + { + X = 15, + Z = 15 + }; + surfaceLine1.EnsurePointOfType(p1.X, p1.Z, CharacteristicPointType.DikeToeAtRiver); + surfaceLine1.EnsurePointOfType(p2.X, p2.Z, CharacteristicPointType.DikeTopAtRiver); + surfaceLine1.EnsurePointOfType(p3.X, p3.Z, CharacteristicPointType.DikeTopAtPolder); + surfaceLine1.EnsurePointOfType(p1.X, p1.Z, CharacteristicPointType.DikeToeAtPolder); + Assert.That(() => new StubSurfaceLineAdapter(surfaceLine1, location, 0), Throws.InstanceOf()); + } - [Test] - public void ThrowsAnExceptionWhenSurfaceLineDoesNotComplyToSpecificationUsingAskewTopShoulderInside() + [Test] + public void ThrowsAnExceptionWhenSurfaceLineDoesNotComplyToSpecificationUsingAskewTopShoulderInside() + { + var surfaceLine1 = new SurfaceLine2 { - var surfaceLine1 = new SurfaceLine2 + CharacteristicPoints = { - CharacteristicPoints = - { - GeometryMustContainPoint = true - }, - Geometry = new GeometryPointString() - }; - var p1 = new GeometryPoint(); - var p2 = new GeometryPoint - { - X = 10, - Z = 10 - }; - var p3 = new GeometryPoint - { - X = 15, - Z = 10 - }; - var p4 = new GeometryPoint - { - X = 17, - Z = 8 - }; - var p5 = new GeometryPoint - { - X = 18, - Z = 9 - }; - surfaceLine1.EnsurePointOfType(p1.X, p1.Z, CharacteristicPointType.DikeToeAtRiver); - surfaceLine1.EnsurePointOfType(p2.X, p2.Z, CharacteristicPointType.DikeTopAtRiver); - surfaceLine1.EnsurePointOfType(p3.X, p3.Z, CharacteristicPointType.DikeTopAtPolder); - surfaceLine1.EnsurePointOfType(p4.X, p4.Z, CharacteristicPointType.ShoulderBaseInside); - surfaceLine1.EnsurePointOfType(p5.X, p5.Z, CharacteristicPointType.ShoulderTopInside); - surfaceLine1.EnsurePointOfType(p1.X, p1.Z, CharacteristicPointType.DikeToeAtPolder); - Assert.That(() => new StubSurfaceLineAdapter(surfaceLine1, location, 0), Throws.InstanceOf()); - } - - class StubSurfaceLineAdapter : SurfaceLineAdapter + GeometryMustContainPoint = true + }, + Geometry = new GeometryPointString() + }; + var p1 = new GeometryPoint(); + var p2 = new GeometryPoint { - public StubSurfaceLineAdapter(SurfaceLine2 surfaceLine, Location location, double scenarioPolderLevel) - : base(surfaceLine, location, scenarioPolderLevel) {} - } + X = 10, + Z = 10 + }; + var p3 = new GeometryPoint + { + X = 15, + Z = 10 + }; + var p4 = new GeometryPoint + { + X = 17, + Z = 8 + }; + var p5 = new GeometryPoint + { + X = 18, + Z = 9 + }; + surfaceLine1.EnsurePointOfType(p1.X, p1.Z, CharacteristicPointType.DikeToeAtRiver); + surfaceLine1.EnsurePointOfType(p2.X, p2.Z, CharacteristicPointType.DikeTopAtRiver); + surfaceLine1.EnsurePointOfType(p3.X, p3.Z, CharacteristicPointType.DikeTopAtPolder); + surfaceLine1.EnsurePointOfType(p4.X, p4.Z, CharacteristicPointType.ShoulderBaseInside); + surfaceLine1.EnsurePointOfType(p5.X, p5.Z, CharacteristicPointType.ShoulderTopInside); + surfaceLine1.EnsurePointOfType(p1.X, p1.Z, CharacteristicPointType.DikeToeAtPolder); + Assert.That(() => new StubSurfaceLineAdapter(surfaceLine1, location, 0), Throws.InstanceOf()); } + + class StubSurfaceLineAdapter : SurfaceLineAdapter + { + public StubSurfaceLineAdapter(SurfaceLine2 surfaceLine, Location location, double scenarioPolderLevel) + : base(surfaceLine, location, scenarioPolderLevel) {} + } } \ No newline at end of file