Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj =================================================================== diff -u -r4763 -r4768 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj (.../Deltares.DamEngine.IntegrationTests.csproj) (revision 4763) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj (.../Deltares.DamEngine.IntegrationTests.csproj) (revision 4768) @@ -339,6 +339,9 @@ PreserveNewest + + PreserveNewest + Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/TestFiles/2DGeometryNoFittingSurfaceLine.xml =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/TestFiles/2DGeometryNoFittingSurfaceLine.xml (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/TestFiles/2DGeometryNoFittingSurfaceLine.xml (revision 4768) @@ -0,0 +1,650 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2DSurfaceLineHelper.cs =================================================================== diff -u -r4764 -r4768 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2DSurfaceLineHelper.cs (.../SoilProfile2DSurfaceLineHelper.cs) (revision 4764) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2DSurfaceLineHelper.cs (.../SoilProfile2DSurfaceLineHelper.cs) (revision 4768) @@ -44,13 +44,13 @@ } if (Math.Round(surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.SurfaceLevelOutside).X, precisionDecimals) < - Math.Round(soilProfile2D.Geometry.SurfaceLine.Points.First().X, precisionDecimals)) + Math.Round(soilProfile2D.Geometry.SurfaceLine.Points[0].X, precisionDecimals)) { return false; } if (Math.Round(surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.SurfaceLevelInside).X, precisionDecimals) > - Math.Round(soilProfile2D.Geometry.SurfaceLine.Points.Last().X, precisionDecimals)) + Math.Round(soilProfile2D.Geometry.SurfaceLine.Points[soilProfile2D.Geometry.SurfaceLine.Points.Count - 1].X, precisionDecimals)) { return false; } Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityInwardsTests.cs =================================================================== diff -u -r4764 -r4768 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityInwardsTests.cs (.../MacroStabilityInwardsTests.cs) (revision 4764) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityInwardsTests.cs (.../MacroStabilityInwardsTests.cs) (revision 4768) @@ -50,6 +50,7 @@ public void TearDown() { // Ensure clearing directories at end. + RemoveUsedDirectoryAfterTests("2DGeometryNoFittingSurfaceLine"); RemoveUsedDirectoryAfterTests("TestStabInwardsBishop2DStix"); RemoveUsedDirectoryAfterTests("TestStabInwardsBishop"); RemoveUsedDirectoryAfterTests("TestStabInwardsUpliftVan"); @@ -68,6 +69,29 @@ RemoveUsedDirectoryAfterTests("TestStabInwardsBishopUpliftVanWithoutUpliftWithStixFiles"); } + [Test] + public void GivenBishopNoAdaptionWith2DGeometryAndNotFittingSurfaceLineThenCalculationFails() + { + const string calcDir = "2DGeometryNoFittingSurfaceLine"; + if (Directory.Exists(calcDir)) + { + Directory.Delete(calcDir, true); // delete previous results + } + + Directory.CreateDirectory(calcDir); + + const string fileName = @"TestFiles\2DGeometryNoFittingSurfaceLine.xml"; + string inputString = File.ReadAllText(fileName); + inputString = XmlAdapter.ChangeValueInXml(inputString, "ProjectPath", ""); // Current directory will be used + inputString = XmlAdapter.ChangeValueInXml(inputString, "CalculationMap", calcDir); // Current directory will be used + var engineInterface = new EngineInterface(inputString); + Assert.That(engineInterface.DamProjectData, Is.Not.Null); + + Output output = GeneralHelper.RunAfterInputValidation(inputString, false); + + Assert.That(output.Results.CalculationMessages[1].Message1, Is.EqualTo("SurfaceLine dijkring10_dwp09_0 does not fit within the boundaries of soil profile 10Y_090_STBI.stix")); + } + [Test, Category("Slow"), Ignore("This test is not yet implemented, waits on stix implementation")] [Category(Categories.WorkInProgress)] public void TestBishopNoAdaptionWith2DGeometriesBasedOnStixFiles()