Index: src/Deltares.DSoilModel.Forms/DSoilModelGeometryEditor.cs
===================================================================
diff -u -r238 -r240
--- src/Deltares.DSoilModel.Forms/DSoilModelGeometryEditor.cs (.../DSoilModelGeometryEditor.cs) (revision 238)
+++ src/Deltares.DSoilModel.Forms/DSoilModelGeometryEditor.cs (.../DSoilModelGeometryEditor.cs) (revision 240)
@@ -571,7 +571,7 @@
DataEventPublisher.SelectionChanged(profile);
}
- private void ClearGeometryForSoilProfile2D(SoilProfile2D profile)
+ public void ClearGeometryForSoilProfile2D(SoilProfile2D profile)
{
foreach (var lookup in Project.BoringLookup2Ds.Where(b => b.SoilProfile2D == profile).ToList())
{
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);
}
}
}
Index: src/Deltares.DSoilModel.Forms.Tests/Deltares.DSoilModel.Forms.Tests.csproj
===================================================================
diff -u -r239 -r240
--- src/Deltares.DSoilModel.Forms.Tests/Deltares.DSoilModel.Forms.Tests.csproj (.../Deltares.DSoilModel.Forms.Tests.csproj) (revision 239)
+++ src/Deltares.DSoilModel.Forms.Tests/Deltares.DSoilModel.Forms.Tests.csproj (.../Deltares.DSoilModel.Forms.Tests.csproj) (revision 240)
@@ -24,6 +24,22 @@
false
+
+ False
+ ..\..\lib\Deltares\DslGeographic\Deltares.Geographic.dll
+
+
+ False
+ ..\..\lib\Deltares\DslGeo\Deltares.Geometry.dll
+
+
+ False
+ ..\..\lib\Deltares\DslGeo\Deltares.Geotechnics.dll
+
+
+ False
+ ..\..\lib\Deltares\DslGeoIo\Deltares.Geotechnics.IO.dll
+
False
..\..\lib\Deltares\DslCore\Deltares.Standard.dll