Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs =================================================================== diff -u -r602479eb3666493485aee246d56b08958a6fc958 -rcfba2b11da9ac0bb1daf377b8dcb15f7c84e0cfb --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs (.../SoilProfileBuilder2DTest.cs) (revision 602479eb3666493485aee246d56b08958a6fc958) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs (.../SoilProfileBuilder2DTest.cs) (revision cfba2b11da9ac0bb1daf377b8dcb15f7c84e0cfb) @@ -39,6 +39,45 @@ } [Test] + public void Add_LayerWithVerticalLineOnXInXml_ThrowsSoilProfileBuilderException() + { + // Setup + var profileName = "SomeProfile"; + var atX = 0.0; + var builder = new SoilProfileBuilder2D(profileName, atX); + + SoilLayer2D soilLayer = new SoilLayer2D + { + OuterLoop = new List { + new Segment2D + ( + new Point2D(atX,0.0), + new Point2D(atX,1.0) + ), + new Segment2D( + + new Point2D(atX,1.0), + new Point2D(0.5,0.5) + ), + new Segment2D( + + new Point2D(0.5,0.5), + new Point2D(atX,0.0) + ) + } + }; + + // Call + TestDelegate test = () => builder.Add(soilLayer); + + // Assert + var exception = Assert.Throws(test); + Assert.IsInstanceOf(exception.InnerException); + var message = string.Format("Kan geen 1D profiel bepalen wanneer segmenten in een 2D laag verticaal lopen op de gekozen positie: x = {0}.", atX); + Assert.AreEqual(message, exception.Message); + } + + [Test] public void Build_WithOutLayers_ThrowsSoilProfileBuilderException() { // Setup