Index: DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/SoilProfile2DTests.cs =================================================================== diff -u -r6404 -r7060 --- DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/SoilProfile2DTests.cs (.../SoilProfile2DTests.cs) (revision 6404) +++ DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/SoilProfile2DTests.cs (.../SoilProfile2DTests.cs) (revision 7060) @@ -141,8 +141,31 @@ }); } - private static void CompareSoilProfile2D(SoilProfile2D sourceSoilProfile2D, SoilProfile2D targetSoilProfile2D) + [Test] + public void GivenSoilProfile2DWithHole_WhenDetermining1DProfileAlongTheHole_ReturnsHoleAsEmptySoil() { + // Given + SoilProfile2D soilProfile2D = FactoryForSoilProfiles.CreateSoilProfile2DWithHole(); + + // When + SoilProfile1D soilProfile1D = soilProfile2D.GetSoilProfile1D(25); + + // Then + Assert.That(soilProfile1D.Layers, Has.Count.EqualTo(3)); + Assert.Multiple(() => + { + Assert.That(soilProfile1D.Layers[0].TopLevel, Is.EqualTo(10).Within(precison10Decimals)); + Assert.That(soilProfile1D.Layers[0].Soil.Name, Is.EqualTo("Soil 1")); + Assert.That(soilProfile1D.Layers[1].TopLevel, Is.EqualTo(0).Within(precison10Decimals)); + Assert.That(soilProfile1D.Layers[1].Soil, Is.Null); + Assert.That(soilProfile1D.Layers[2].TopLevel, Is.EqualTo(-10).Within(precison10Decimals)); + Assert.That(soilProfile1D.Layers[2].Soil.Name, Is.EqualTo("Soil 3")); + Assert.That(soilProfile1D.BottomLevel, Is.EqualTo(-20).Within(precison10Decimals)); + }); + } + +private static void CompareSoilProfile2D(SoilProfile2D sourceSoilProfile2D, SoilProfile2D targetSoilProfile2D) + { Assert.That(targetSoilProfile2D, Is.Not.SameAs(sourceSoilProfile2D)); var compare = new CompareLogic {