Index: src/Deltares.DSoilModel.Forms.Tests/DSoilModelGeometryEditorTests.cs =================================================================== diff -u -r239 -r240 --- src/Deltares.DSoilModel.Forms.Tests/DSoilModelGeometryEditorTests.cs (.../DSoilModelGeometryEditorTests.cs) (revision 239) +++ src/Deltares.DSoilModel.Forms.Tests/DSoilModelGeometryEditorTests.cs (.../DSoilModelGeometryEditorTests.cs) (revision 240) @@ -1,4 +1,8 @@ using Deltares.DSoilModel.Data; +using Deltares.Geometry; +using Deltares.Geotechnics; +using Deltares.Geotechnics.ConePenetrationTest; +using Deltares.Geotechnics.IO; using Deltares.Standard; using Deltares.Standard.Forms.DExpress; using NUnit.Framework; @@ -20,18 +24,50 @@ [TearDown] public void TearDown() { + geometryEditor = null; + } + private DSoilModelProject CreateProjectForSoilProfile2D(SoilProfile2D profile) + { + var p = new DSoilModelProject(); + + p.BoringLookup2Ds.Add(new BoringLookup2D {SoilProfile2D = profile}); + p.CptLookup2Ds.Add(new ConePenetrationTestLookup2D {SoilProfile2D = profile}); + p.SpecificMechanismPointLocations.Add(new SpecificMechanismPointLocation {SoilProfile2D = profile}); + p.Soilprofile1DLookup2Ds.Add(new SoilProfile1DLookup2D {SoilProfile2D = profile}); + + return p; } - private DSoilModelProject CreateProject() + private SoilProfile2D CreateSoilProfile2D() { - return null; + var profile = new SoilProfile2D(); + + profile.CenterCrestLocation = 55; + profile.Geometry.Points.Add(new GeometryPoint(1, 1, 1)); + profile.PreconsolidationStresses.Add(new PreConsolidationStress()); + profile.Surfaces.Add(new SoilLayer2D()); + + return profile; } [Test] public void ClearGeometryForSoilProfile2DTest() { - geometryEditor.Project = CreateProject(); + var soilProfile2D = CreateSoilProfile2D(); + geometryEditor.Project = CreateProjectForSoilProfile2D(soilProfile2D); + + geometryEditor.ClearGeometryForSoilProfile2D(soilProfile2D); + + Assert.IsEmpty(geometryEditor.Project.BoringLookup2Ds); + Assert.IsEmpty(geometryEditor.Project.CptLookup2Ds); + Assert.IsEmpty(geometryEditor.Project.SpecificMechanismPointLocations); + Assert.IsEmpty(geometryEditor.Project.Soilprofile1DLookup2Ds); + + Assert.IsNaN(soilProfile2D.CenterCrestLocation); + Assert.IsEmpty(soilProfile2D.Geometry.Points); + Assert.IsEmpty(soilProfile2D.PreconsolidationStresses); + Assert.IsEmpty(soilProfile2D.Surfaces); } } }