Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingSoilProfile.cs =================================================================== diff -u -ra483049c20ef6d26addd0718d0f31ae1922e6f49 -rd73739bed38c7aaf880d1c57c8904f9667ee2329 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingSoilProfile.cs (.../PipingSoilProfile.cs) (revision a483049c20ef6d26addd0718d0f31ae1922e6f49) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingSoilProfile.cs (.../PipingSoilProfile.cs) (revision d73739bed38c7aaf880d1c57c8904f9667ee2329) @@ -52,10 +52,6 @@ { throw new ArgumentException(string.Format(Resources.Error_CannotConstructPipingSoilProfileWithoutLayers)); } - if (!value.Any(l => l.IsAquifer)) - { - throw new ArgumentException(string.Format(Resources.Error_CannotConstructPipingSoilProfileWithoutAquiferLayer)); - } layers = value.OrderByDescending(l => l.Top).ToArray(); } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingSoilProfileTest.cs =================================================================== diff -u -ra483049c20ef6d26addd0718d0f31ae1922e6f49 -rd73739bed38c7aaf880d1c57c8904f9667ee2329 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingSoilProfileTest.cs (.../PipingSoilProfileTest.cs) (revision a483049c20ef6d26addd0718d0f31ae1922e6f49) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingSoilProfileTest.cs (.../PipingSoilProfileTest.cs) (revision d73739bed38c7aaf880d1c57c8904f9667ee2329) @@ -33,30 +33,7 @@ Assert.AreEqual(name, profile.Name); Assert.AreEqual(bottom, profile.Bottom); } - [Test] - [TestCase(1)] - [TestCase(5)] - public void Constructor_WithNameBottomLayersNoAquifer_ThrowsArgumentException(int layerCount) - { - // Setup - var name = "Profile"; - var bottom = new Random(22).NextDouble(); - var equivalentLayers = new Collection(); - for (var i = 0; i < layerCount; i++) - { - equivalentLayers.Add(new PipingSoilLayer(0.0)); - } - - // Call - TestDelegate test = () => new PipingSoilProfile(name, bottom, equivalentLayers); - - // Assert - var message = Assert.Throws(test).Message; - Assert.AreEqual(Properties.Resources.Error_CannotConstructPipingSoilProfileWithoutAquiferLayer, message); - } - - [Test] public void Constructor_WithNameBottomLayersEmpty_ThrowsArgumentException() { // Call Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder1DTest.cs =================================================================== diff -u -ra483049c20ef6d26addd0718d0f31ae1922e6f49 -rd73739bed38c7aaf880d1c57c8904f9667ee2329 --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder1DTest.cs (.../SoilProfileBuilder1DTest.cs) (revision a483049c20ef6d26addd0718d0f31ae1922e6f49) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder1DTest.cs (.../SoilProfileBuilder1DTest.cs) (revision d73739bed38c7aaf880d1c57c8904f9667ee2329) @@ -23,24 +23,6 @@ } [Test] - public void Build_WithoutAquiferLayer_ThrowsArgumentException() - { - // Setup - var profileName = "SomeProfile"; - var random = new Random(22); - var bottom = random.NextDouble(); - var top = random.NextDouble(); - var builder = new SoilProfileBuilder1D(profileName, bottom); - builder.Add(new PipingSoilLayer(top)); - - // Call - TestDelegate test = () => builder.Build(); - - // Assert - Assert.Throws(test); - } - - [Test] public void Build_WithSingleLayer_ReturnsProfileWithBottomAndALayer() { // Setup Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs =================================================================== diff -u -ra483049c20ef6d26addd0718d0f31ae1922e6f49 -rd73739bed38c7aaf880d1c57c8904f9667ee2329 --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs (.../SoilProfileBuilder2DTest.cs) (revision a483049c20ef6d26addd0718d0f31ae1922e6f49) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs (.../SoilProfileBuilder2DTest.cs) (revision d73739bed38c7aaf880d1c57c8904f9667ee2329) @@ -26,46 +26,7 @@ Assert.AreEqual(Resources.Error_SoilProfileBuilderCantDetermineIntersectAtDoubleNaN, exception.Message); } - [Test] - public void Build_WithoutAquiferLayer_ThrowsArgumentException() - { - // Setup - var profileName = "SomeProfile"; - var random = new Random(22); - var bottom = random.NextDouble(); - var builder = new SoilProfileBuilder2D(profileName, bottom); - builder.Add(new SoilLayer2D - { - OuterLoop = new HashSet - { - new Point3D - { - X = -0.5, Z = 1.0 - }, - new Point3D - { - X = 0.5, Z = 1.0 - }, - new Point3D - { - X = 0.5, Z = -1.0 - }, - new Point3D - { - X = -0.5, Z = -1.0 - } - } - }); - - // Call - TestDelegate test = () => builder.Build(); - - // Assert - Assert.Throws(test); - } - - [Test] [TestCase(null)] [TestCase("name")] public void Constructor_WithNameValidX_ReturnsNewInstance(string name) Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/PipingSoilProfileReaderTest.cs =================================================================== diff -u -ra483049c20ef6d26addd0718d0f31ae1922e6f49 -rd73739bed38c7aaf880d1c57c8904f9667ee2329 --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/PipingSoilProfileReaderTest.cs (.../PipingSoilProfileReaderTest.cs) (revision a483049c20ef6d26addd0718d0f31ae1922e6f49) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/PipingSoilProfileReaderTest.cs (.../PipingSoilProfileReaderTest.cs) (revision d73739bed38c7aaf880d1c57c8904f9667ee2329) @@ -315,25 +315,41 @@ } // Assert - Assert.AreEqual(15, skipped); - Assert.AreEqual(11, result.Count); + Assert.AreEqual(0, skipped); + Assert.AreEqual(26, result.Count); CollectionAssert.AreEquivalent(new[] { + "AD640M00_Segment_36005_1D1", "AD640M00_Segment_36005_1D2", - "Segment_36005_1D10", + "Segment_36005_1D1", "Segment_36005_1D2", "Segment_36005_1D3", + "Segment_36005_1D4", "Segment_36005_1D5", "Segment_36005_1D6", "Segment_36005_1D7", "Segment_36005_1D8", "Segment_36005_1D9", + "Segment_36005_1D10", + "Segment_36006_1D1", + "Segment_36006_1D2", + "Segment_36006_1D3", + "Segment_36006_1D4", "Segment_36006_1D5", - "Segment_36006_1D6" + "Segment_36006_1D6", + "Segment_36007_1D1", + "Segment_36007_1D2", + "Segment_36007_1D3", + "Segment_36007_1D4", + "Segment_36007_1D5", + "Segment_36007_1D6", + "Segment_36007_1D7", + "Segment_36007_1D8" }, result.Select(p => p.Name)); CollectionAssert.AreEquivalent(new[] { + -39.999943172545208, -45, -45, -45, @@ -344,26 +360,47 @@ -45, -45, -45, - -45 + -45, + -45, + -45, + -45, + -45, + -45, + -45, + -52, + -52, + -52, + -52, + -24, + -21.25, + -21, + -21 }, result.Select(p => p.Bottom)); CollectionAssert.AreEquivalent(new[] { - 8, - 3, - 6, - 6, - 5, - 6, - 4, - 4, - 3, - 5, - 5 + 9,8,8,6,6,5,5,6,4,4,3,3,7,7,7,5,5,5,6,6,4,5,4,4,2,3 }, result.Select(p => p.Layers.Count())); - var profile2D = result.FirstOrDefault(l => l.Name == "AD640M00_Segment_36005_1D2"); - Assert.NotNull(profile2D); + var firstProfile = result.FirstOrDefault(l => l.Name == "AD640M00_Segment_36005_1D1"); + Assert.NotNull(firstProfile); + var expectedFirstProfileLayersTops = new[] + { + 5.9075002357930027, + 3.12499857931363, + 2.3749957379408912, + 1.1874992896568151, + 0.12499005519541202, + -5.1250298344137661, + -14.000011365490959, + -19.000022730981915, + -30.000056827454785, + }; + CollectionAssert.AllItemsAreUnique(firstProfile.Layers.Select(l => l.Top)); + CollectionAssert.AreEqual(expectedFirstProfileLayersTops, firstProfile.Layers.Select(l => l.Top)); + + var secondProfile = result.FirstOrDefault(l => l.Name == "AD640M00_Segment_36005_1D2"); + Assert.NotNull(secondProfile); var expectedSecondProfileLayersTops = new[] { 5.9075002357930053, @@ -375,8 +412,8 @@ -17, -25, }; - CollectionAssert.AllItemsAreUnique(profile2D.Layers.Select(l => l.Top)); - CollectionAssert.AreEqual(expectedSecondProfileLayersTops, profile2D.Layers.Select(l => l.Top)); + CollectionAssert.AllItemsAreUnique(secondProfile.Layers.Select(l => l.Top)); + CollectionAssert.AreEqual(expectedSecondProfileLayersTops, secondProfile.Layers.Select(l => l.Top)); } } }