Index: DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/GeometryHelperTests.cs =================================================================== diff -u -r5004 -r5028 --- DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/GeometryHelperTests.cs (.../GeometryHelperTests.cs) (revision 5004) +++ DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/GeometryHelperTests.cs (.../GeometryHelperTests.cs) (revision 5028) @@ -32,7 +32,8 @@ public class GeometryHelperTests { // For debugging purposes - private const string visualizationFolder = @"D:\src\dam\DamTools\GeometryVisualizer\"; + //private const string visualizationFolder = @"C:\Dam\DamTools\GeometryVisualizer\"; //#John + //private const string visualizationFolder = @"D:\src\dam\DamTools\GeometryVisualizer\"; //#Tom // Use the following code to export the geometry to a file // GeometryExporter.ExportToFile(soilProfile2D.Geometry, visualizationFolder + "Geometry.txt"); // GeometryExporter.ExportToJsonFile(soilProfile2D.Geometry, visualizationFolder + "Geometry.json"); @@ -61,11 +62,11 @@ Assert.That(geometryBounds.Left, Is.EqualTo(-2).Within(cTolerance)); Assert.That(soilProfile2D.Geometry.Left, Is.EqualTo(-2).Within(cTolerance)); // At first there are 3 surfaces, but after extending the right boundary, there are 6 surfaces - Assert.That(soilProfile2D.Geometry.Surfaces, Has.Count.EqualTo(6)); + Assert.That(soilProfile2D.Geometry.Surfaces.Count, Is.EqualTo(6)); // the number of points should now be 12 + 4 = 16 - Assert.That(soilProfile2D.Geometry.Points, Has.Count.EqualTo(16)); + Assert.That(soilProfile2D.Geometry.Points.Count, Is.EqualTo(16)); // the number of curves should now be 14 + 7 = 21 - Assert.That(soilProfile2D.Geometry.Curves, Has.Count.EqualTo(21)); + Assert.That(soilProfile2D.Geometry.Curves.Count, Is.EqualTo(21)); }); } @@ -96,11 +97,11 @@ { Assert.That(soilProfile2D.Geometry.Right, Is.EqualTo(12).Within(cTolerance)); // At first there are 3 surfaces, but after extending the right boundary, there are 6 surfaces - Assert.That(soilProfile2D.Geometry.Surfaces, Has.Count.EqualTo(6)); + Assert.That(soilProfile2D.Geometry.Surfaces.Count, Is.EqualTo(6)); // the number of points should now be 12 + 4 = 16 - Assert.That(soilProfile2D.Geometry.Points, Has.Count.EqualTo(16)); + Assert.That(soilProfile2D.Geometry.Points.Count, Is.EqualTo(16)); // the number of curves should now be 14 + 7 = 21 - Assert.That(soilProfile2D.Geometry.Curves, Has.Count.EqualTo(21)); + Assert.That(soilProfile2D.Geometry.Curves.Count, Is.EqualTo(21)); }); } @@ -126,20 +127,25 @@ // When GeometryHelper.CutGeometryLeft(soilProfile2D.Geometry, 2); // For debugging purposes - // GeometryExporter.ExportToFile(soilProfile2D.Geometry, visualizationFolder + "Geometry.txt"); - // GeometryExporter.ExportToJsonFile(soilProfile2D.Geometry, visualizationFolder + "Geometry.json"); + //GeometryExporter.ExportToFile(soilProfile2D.Geometry, visualizationFolder + "Geometry.txt"); + //GeometryExporter.ExportToJsonFile(soilProfile2D.Geometry, visualizationFolder + "Geometry.json"); // Then GeometryBounds geometryBounds = soilProfile2D.Geometry.GetGeometryBounds(); Assert.Multiple(() => { Assert.That(geometryBounds.Left, Is.EqualTo(2).Within(cTolerance)); Assert.That(soilProfile2D.Geometry.Left, Is.EqualTo(2).Within(cTolerance)); - Assert.That(soilProfile2D.Geometry.Surfaces, Has.Count.EqualTo(3)); + // At first there are 3 surfaces, after cutting the boundary, there still must be 3 surfaces + Assert.That(soilProfile2D.Geometry.Surfaces.Count, Is.EqualTo(3)); + // At first there are 12 points, after cutting the boundary, there still must be 12 points + Assert.That(soilProfile2D.Geometry.Points.Count, Is.EqualTo(12)); + // At first there are 14 curves, after cutting the boundary, there still must be 14 curves + Assert.That(soilProfile2D.Geometry.Curves.Count, Is.EqualTo(14)); }); } - [Test, Ignore("This test is failing")] + [Test] public void GivenTwoLayerGeometryWhenCuttingRightThenRightBoundaryIsChanged() { // Given @@ -151,16 +157,21 @@ // When GeometryHelper.CutGeometryRight(soilProfile2D.Geometry, 8); // For debugging purposes - // GeometryExporter.ExportToFile(soilProfile2D.Geometry, visualizationFolder + "Geometry.txt"); - // GeometryExporter.ExportToJsonFile(soilProfile2D.Geometry, visualizationFolder + "Geometry.json"); + //GeometryExporter.ExportToFile(soilProfile2D.Geometry, visualizationFolder + "Geometry.txt"); + //GeometryExporter.ExportToJsonFile(soilProfile2D.Geometry, visualizationFolder + "Geometry.json"); // Then GeometryBounds geometryBounds = soilProfile2D.Geometry.GetGeometryBounds(); Assert.Multiple(() => { Assert.That(geometryBounds.Right, Is.EqualTo(8).Within(cTolerance)); Assert.That(soilProfile2D.Geometry.Right, Is.EqualTo(8).Within(cTolerance)); - Assert.That(soilProfile2D.Geometry.Surfaces, Has.Count.EqualTo(3)); + // At first there are 3 surfaces, after cutting the boundary, there still must be 3 surfaces + Assert.That(soilProfile2D.Geometry.Surfaces.Count, Is.EqualTo(3)); + // At first there are 12 points, after cutting the boundary, there still must be 12 points + Assert.That(soilProfile2D.Geometry.Points.Count, Is.EqualTo(12)); + // At first there are 14 curves, after cutting the boundary, there still must be 14 curves + Assert.That(soilProfile2D.Geometry.Curves.Count, Is.EqualTo(14)); }); } } \ No newline at end of file