Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/DikesDesign/SurfaceLineShoulderAdapterTest.cs =================================================================== diff -u -r3520 -r3875 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/DikesDesign/SurfaceLineShoulderAdapterTest.cs (.../SurfaceLineShoulderAdapterTest.cs) (revision 3520) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/DikesDesign/SurfaceLineShoulderAdapterTest.cs (.../SurfaceLineShoulderAdapterTest.cs) (revision 3875) @@ -35,7 +35,6 @@ const double pointCoordinateTolerance = 0.001; [Test] - [ExpectedException(typeof(SurfaceLineAdapterException))] public void ThrowsAnExceptionWhenNoSurfaceLevelPointExist() { var surfaceLine = new SurfaceLine2 @@ -55,7 +54,7 @@ surfaceLine.EnsurePointOfType(pointAtTopRiver.X, pointAtTopRiver.Z, CharacteristicPointType.DikeTopAtRiver); surfaceLine.EnsurePointOfType(pointAtTopPolder.X, pointAtTopPolder.Z, CharacteristicPointType.DikeTopAtPolder); surfaceLine.EnsurePointOfType(pointAtToePolder.X, pointAtToePolder.Z, CharacteristicPointType.DikeToeAtPolder); - var surfaceLineAdapter = new SurfaceLineShoulderAdapter(surfaceLine, location, 0); + Assert.That(() => new SurfaceLineShoulderAdapter(surfaceLine, location, 0), Throws.InstanceOf()); } /// @@ -962,7 +961,6 @@ } [Test] - [ExpectedException(typeof(SurfaceLineAdapterException))] public void ThrowsAnExceptionWhenNewShoulderDoesNotFit() { var surfaceLine = new SurfaceLine2 @@ -987,11 +985,10 @@ surfaceLine.EnsurePointOfType(pointAtToePolder.X, pointAtToePolder.Z, CharacteristicPointType.DikeToeAtPolder); surfaceLine.EnsurePointOfType(pointAtSurfaceLevelInside.X, pointAtSurfaceLevelInside.Z, CharacteristicPointType.SurfaceLevelInside); var surfaceLineAdapter = new SurfaceLineShoulderAdapter(surfaceLine, location, 0); - var line = surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false); + Assert.That(() => surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false), Throws.InstanceOf()); } [Test] - [ExpectedException(typeof(SurfaceLineAdapterException))] public void ThrowsAnExceptionWhenNewShoulderDoesJustNotFit() { var surfaceLine = new SurfaceLine2 @@ -1017,11 +1014,10 @@ surfaceLine.EnsurePointOfType(pointAtSurfaceLevelInside.X, pointAtSurfaceLevelInside.Z, CharacteristicPointType.SurfaceLevelInside); var surfaceLineAdapter = new SurfaceLineShoulderAdapter(surfaceLine, location, 0); - var line = surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false); + Assert.That(() => surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false), Throws.InstanceOf()); } [Test] - [ExpectedException(typeof(SurfaceLineAdapterException))] public void ThrowsAnExceptionWhenNewShoulderDoesJustNotFitWithDitch() { var surfaceLine = new SurfaceLine2 @@ -1060,7 +1056,7 @@ surfaceLine.EnsurePointOfType(apoint3.X, apoint3.Z, null); surfaceLine.EnsurePointOfType(pointAtSurfaceLevelInside.X, pointAtSurfaceLevelInside.Z, CharacteristicPointType.SurfaceLevelInside); var surfaceLineAdapter = new SurfaceLineShoulderAdapter(surfaceLine, location, 0); - var line = surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false); + Assert.That(() => surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false), Throws.InstanceOf()); } [Test] @@ -1213,7 +1209,6 @@ } [Test] - [ExpectedException(typeof(SurfaceLineAdapterException))] public void AdaptedSurfaceLineWithNewVerySteepTopSlopeAngle() { var surfaceLine = new SurfaceLine2 @@ -1242,7 +1237,7 @@ var surfaceLineAdapter = new SurfaceLineShoulderAdapter(surfaceLine, location, 0); surfaceLineAdapter.MaxShoulderLevel = 0.5 * (surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Z - surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z) + surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z; - var adaptedSurfaceLine = surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false); + Assert.That(() => surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false), Throws.InstanceOf()); // TODO (The) what to do with the outcommented code? // Dike top polder now coincides with the shoulder base. // var expectedBasePoint = GeometryPoint.CreateNewXZPoint(2, 1); @@ -1342,7 +1337,6 @@ } [Test] - [ExpectedException(typeof(SurfaceLineAdapterException))] public void AdaptedSurfaceLineWithNewBaseSlopeAngleFarTooShallow() { var surfaceLine = new SurfaceLine2 @@ -1371,7 +1365,7 @@ var surfaceLineAdapter = new SurfaceLineShoulderAdapter(surfaceLine, location, 0); surfaceLineAdapter.MaxShoulderLevel = 0.5 * (surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Z - surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z) + surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z; - var adaptedSurfaceLine = surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false); + Assert.That(() => surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false), Throws.InstanceOf()); } [Test] @@ -1505,7 +1499,6 @@ } [Test] - [ExpectedException(typeof(SurfaceLineAdapterException))] public void AdaptedSurfaceLineWithTooLargeNewMinDistanceFromToe() { var surfaceLine = new SurfaceLine2 @@ -1544,7 +1537,7 @@ surfaceLine.EnsurePointOfType(apoint2.X, apoint2.Z, null); surfaceLine.EnsurePointOfType(pointAtSurfaceLevelInside.X, pointAtSurfaceLevelInside.Z, CharacteristicPointType.SurfaceLevelInside); var surfaceLineAdapter = new SurfaceLineShoulderAdapter(surfaceLine, location, 0) { SlopeOfNewShoulder = 2 }; - var adaptedSurfaceLine = surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false); + Assert.That(() => surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false), Throws.InstanceOf()); } [Test] @@ -1618,7 +1611,6 @@ } [Test] - [ExpectedException(typeof(SurfaceLineAdapterException))] public void AdaptedSurfaceLineWithNewMinDistanceFromToeAndNewDefinitionFailsBecausePolderLevelIsTooHigh() { var surfaceLine = new SurfaceLine2 @@ -1662,7 +1654,7 @@ surfaceLine.EnsurePointOfType(apoint2.X, apoint2.Z, null); surfaceLine.EnsurePointOfType(pointAtSurfaceLevelInside.X, pointAtSurfaceLevelInside.Z, CharacteristicPointType.SurfaceLevelInside); var surfaceLineAdapter = new SurfaceLineShoulderAdapter(surfaceLine, location, polderLevel) { SlopeOfNewShoulder = 2 }; - var adaptedSurfaceLine = surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false); + Assert.That(() => surfaceLineAdapter.ConstructNewSurfaceLine(shoulderLength, shoulderHeight, false), Throws.InstanceOf()); } } } \ No newline at end of file