Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLine.cs =================================================================== diff -u -r9f936b0b29f490a024df02345df182133b1c041a -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLine.cs (.../MacroStabilityInwardsSoilProfileUnderSurfaceLine.cs) (revision 9f936b0b29f490a024df02345df182133b1c041a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLine.cs (.../MacroStabilityInwardsSoilProfileUnderSurfaceLine.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -32,12 +32,18 @@ /// /// Creates a new instance of . /// + /// The name of the profile. /// The layers in the profile. /// The preconsolidation stresses defined for the profile. /// Thrown when any parameter is null. - public MacroStabilityInwardsSoilProfileUnderSurfaceLine(IEnumerable layers, + public MacroStabilityInwardsSoilProfileUnderSurfaceLine(string name, + IEnumerable layers, IEnumerable preconsolidationStresses) { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } if (layers == null) { throw new ArgumentNullException(nameof(layers)); @@ -46,11 +52,18 @@ { throw new ArgumentNullException(nameof(preconsolidationStresses)); } + + Name = name; Layers = layers; PreconsolidationStresses = preconsolidationStresses; } /// + /// Gets the name of the profile. + /// + public string Name { get; } + + /// /// Gets the layers in the profile. /// public IEnumerable Layers { get; } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLineFactory.cs =================================================================== diff -u -r6d704f970fe97f343fe3b567661a9789a4f44fd9 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLineFactory.cs (.../MacroStabilityInwardsSoilProfileUnderSurfaceLineFactory.cs) (revision 6d704f970fe97f343fe3b567661a9789a4f44fd9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLineFactory.cs (.../MacroStabilityInwardsSoilProfileUnderSurfaceLineFactory.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -83,7 +83,7 @@ localizedSurfaceLine.First().X, localizedSurfaceLine.Last().X)); - return GeometriesToIntersections(layerGeometries, surfaceLineGeometry); + return GeometriesToIntersections(soilProfile.Name, layerGeometries, surfaceLineGeometry); } private static MacroStabilityInwardsSoilProfileUnderSurfaceLine Create(MacroStabilityInwardsSoilProfile2D soilProfile) @@ -94,15 +94,17 @@ layer.Holes.Select(RingToPoints).ToArray(), layer.Data)).ToArray(); - return new MacroStabilityInwardsSoilProfileUnderSurfaceLine(layersUnderSurfaceLine, soilProfile.PreconsolidationStresses); + return new MacroStabilityInwardsSoilProfileUnderSurfaceLine(soilProfile.Name, layersUnderSurfaceLine, soilProfile.PreconsolidationStresses); } private static Point2D[] RingToPoints(Ring ring) { return ring.Points.ToArray(); } - private static MacroStabilityInwardsSoilProfileUnderSurfaceLine GeometriesToIntersections(IEnumerable layerGeometries, IEnumerable surfaceLineGeometry) + private static MacroStabilityInwardsSoilProfileUnderSurfaceLine GeometriesToIntersections(string name, + IEnumerable layerGeometries, + IEnumerable surfaceLineGeometry) { var collection = new Collection(); @@ -116,7 +118,7 @@ } } - return new MacroStabilityInwardsSoilProfileUnderSurfaceLine(collection, Enumerable.Empty()); + return new MacroStabilityInwardsSoilProfileUnderSurfaceLine(name, collection, Enumerable.Empty()); } private static TempSoilLayerGeometry As2DGeometry(MacroStabilityInwardsSoilLayer1D layer, MacroStabilityInwardsSoilProfile1D soilProfile, double minX, double maxX) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/SoilProfile.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/SoilProfile.cs (.../SoilProfile.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/SoilProfile.cs (.../SoilProfile.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -32,11 +32,18 @@ /// /// Creates a new instance of . /// + /// The name of the profile. /// The layers in the profile. /// The preconsolidation stresses in the profile. /// Thrown when any parameter is null. - public SoilProfile(IEnumerable layers, IEnumerable preconsolidationStresses) + public SoilProfile(string name, + IEnumerable layers, + IEnumerable preconsolidationStresses) { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } if (layers == null) { throw new ArgumentNullException(nameof(layers)); @@ -46,11 +53,17 @@ throw new ArgumentNullException(nameof(preconsolidationStresses)); } + Name = name; Layers = layers; PreconsolidationStresses = preconsolidationStresses; } /// + /// The name of the profile. + /// + public string Name { get; } + + /// /// Gets the layers in the profile. /// public IEnumerable Layers { get; } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs =================================================================== diff -u -r9f35261205f8f664dc06e652f6d264ad9fee7bd9 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs (.../SoilProfileCreator.cs) (revision 9f35261205f8f664dc06e652f6d264ad9fee7bd9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs (.../SoilProfileCreator.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -64,13 +64,17 @@ throw new ArgumentNullException(nameof(layersWithSoils)); } - var profile = new SoilProfile2D(); + var profile = new SoilProfile2D + { + Name = soilProfile.Name + }; profile.PreconsolidationStresses.AddRange(CreatePreconsolidationStresses(soilProfile)); foreach (KeyValuePair layerWithSoil in layersWithSoils) { profile.Surfaces.Add(new SoilLayer2D { + Name = layerWithSoil.Key.MaterialName, IsAquifer = layerWithSoil.Key.IsAquifer, Soil = layerWithSoil.Value, GeometrySurface = CreateGeometrySurface(layerWithSoil.Key), Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/UpliftVanKernelWrapper.cs =================================================================== diff -u -rcf7e0b124334ae558a5d8dee4fc515577d5f6f25 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/UpliftVanKernelWrapper.cs (.../UpliftVanKernelWrapper.cs) (revision cf7e0b124334ae558a5d8dee4fc515577d5f6f25) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/UpliftVanKernelWrapper.cs (.../UpliftVanKernelWrapper.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -27,6 +27,7 @@ using Deltares.WTIStability.Data.Geo; using Deltares.WTIStability.Data.Standard; using Deltares.WTIStability.IO; +using WtiStabilityWaternet = Deltares.WTIStability.Data.Geo.Waternet; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan { @@ -48,7 +49,14 @@ GridOrientation = GridOrientation.Inwards, SlipCircle = new SlipCircle(), SearchAlgorithm = SearchAlgorithm.Grid, - ModelOption = ModelOptions.UpliftVan + ModelOption = ModelOptions.UpliftVan, + GeotechnicsData = + { + CurrentWaternetDaily = new WtiStabilityWaternet + { + Name = "WaternetDaily" + } + } }; FactorOfStability = double.NaN; Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/SoilProfileConverter.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/SoilProfileConverter.cs (.../SoilProfileConverter.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/SoilProfileConverter.cs (.../SoilProfileConverter.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -59,7 +59,7 @@ IEnumerable layers = ConvertLayers(soilProfile.Layers); IEnumerable preconsolidationStresses = ConvertPreconsolidationStresses(soilProfile.PreconsolidationStresses); - return new SoilProfile(layers, preconsolidationStresses); + return new SoilProfile(soilProfile.Name, layers, preconsolidationStresses); } /// Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLineTest.cs =================================================================== diff -u -r9f936b0b29f490a024df02345df182133b1c041a -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLineTest.cs (.../MacroStabilityInwardsSoilProfileUnderSurfaceLineTest.cs) (revision 9f936b0b29f490a024df02345df182133b1c041a) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLineTest.cs (.../MacroStabilityInwardsSoilProfileUnderSurfaceLineTest.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -31,22 +31,37 @@ public class MacroStabilityInwardsSoilProfileUnderSurfaceLineTest { [Test] - public void Constructor_LayersNull_ThrowsArgumentNullException() + public void Constructor_NameNull_ThrowsArgumentNullException() { // Call TestDelegate test = () => new MacroStabilityInwardsSoilProfileUnderSurfaceLine(null, + Enumerable.Empty(), Enumerable.Empty()); // Assert var exception = Assert.Throws(test); + Assert.AreEqual("name", exception.ParamName); + } + + [Test] + public void Constructor_LayersNull_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => new MacroStabilityInwardsSoilProfileUnderSurfaceLine("name", + null, + Enumerable.Empty()); + + // Assert + var exception = Assert.Throws(test); Assert.AreEqual("layers", exception.ParamName); } [Test] public void Constructor_PreconsolidationStressesNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new MacroStabilityInwardsSoilProfileUnderSurfaceLine(Enumerable.Empty(), + TestDelegate call = () => new MacroStabilityInwardsSoilProfileUnderSurfaceLine("name", + Enumerable.Empty(), null); // Assert @@ -58,14 +73,16 @@ public void Constructor_WithValidParameters_NewInstanceWithPropertiesSet() { // Call + const string name = "Profile Name"; IEnumerable layers = Enumerable.Empty(); IEnumerable preconsolidationStresses = Enumerable.Empty(); // Setup - var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine(layers, preconsolidationStresses); + var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine(name, layers, preconsolidationStresses); // Assert + Assert.AreEqual(name, profile.Name); Assert.AreSame(layers, profile.Layers); Assert.AreSame(preconsolidationStresses, profile.PreconsolidationStresses); } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/SoilProfileTest.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/SoilProfileTest.cs (.../SoilProfileTest.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/SoilProfileTest.cs (.../SoilProfileTest.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -23,18 +23,28 @@ using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; -using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Calculators.Input { [TestFixture] public class SoilProfileTest { [Test] + public void Constructor_NameNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new SoilProfile(null, new SoilLayer[0], new PreconsolidationStress[0]); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("name", exception.ParamName); + } + + [Test] public void Constructor_LayersNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new SoilProfile(null, new PreconsolidationStress[0]); + TestDelegate call = () => new SoilProfile("name", null, new PreconsolidationStress[0]); // Assert var exception = Assert.Throws(call); @@ -45,7 +55,7 @@ public void Constructor_PreconsolidationStressesNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new SoilProfile(new SoilLayer[0], null); + TestDelegate call = () => new SoilProfile("name", new SoilLayer[0], null); // Assert var exception = Assert.Throws(call); @@ -56,6 +66,7 @@ public void Constructor_ExpectedValues() { // Setup + const string name = "Soil Profile Name"; var layers = new[] { new SoilLayer(new Point2D[0], new Point2D[0][], new SoilLayer.ConstructionProperties()) @@ -66,9 +77,10 @@ }; // Call - var profile = new SoilProfile(layers, preconsolidationStresses); + var profile = new SoilProfile(name, layers, preconsolidationStresses); // Assert + Assert.AreEqual(name, profile.Name); Assert.AreSame(layers, profile.Layers); Assert.AreSame(preconsolidationStresses, profile.PreconsolidationStresses); } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs =================================================================== diff -u -r177a86fe2d7c3390004138070a95e52b6e3b13ae -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs (.../UpliftVanCalculatorTest.cs) (revision 177a86fe2d7c3390004138070a95e52b6e3b13ae) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs (.../UpliftVanCalculatorTest.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -325,47 +325,48 @@ private static SoilProfile CreateValidSoilProfile(MacroStabilityInwardsSurfaceLine surfaceLine) { - return new SoilProfile(new[] - { - new SoilLayer( - new[] - { - surfaceLine.LocalGeometry.First(), - surfaceLine.LocalGeometry.Last() - }, - Enumerable.Empty(), - new SoilLayer.ConstructionProperties()), - new SoilLayer( - new[] - { - surfaceLine.LocalGeometry.First(), - surfaceLine.LocalGeometry.Last() - }, - Enumerable.Empty(), - new SoilLayer.ConstructionProperties - { - IsAquifer = true - }), - new SoilLayer( - new[] - { - surfaceLine.LocalGeometry.First(), - surfaceLine.LocalGeometry.Last() - }, - Enumerable.Empty(), - new SoilLayer.ConstructionProperties()), - new SoilLayer( - new[] - { - surfaceLine.LocalGeometry.First(), - surfaceLine.LocalGeometry.Last() - }, - Enumerable.Empty(), - new SoilLayer.ConstructionProperties()) - }, new[] - { - new PreconsolidationStress(new Point2D(0, 0), 1.1) - }); + return new SoilProfile("Valid 2D profile", + new[] + { + new SoilLayer( + new[] + { + surfaceLine.LocalGeometry.First(), + surfaceLine.LocalGeometry.Last() + }, + Enumerable.Empty(), + new SoilLayer.ConstructionProperties()), + new SoilLayer( + new[] + { + surfaceLine.LocalGeometry.First(), + surfaceLine.LocalGeometry.Last() + }, + Enumerable.Empty(), + new SoilLayer.ConstructionProperties + { + IsAquifer = true + }), + new SoilLayer( + new[] + { + surfaceLine.LocalGeometry.First(), + surfaceLine.LocalGeometry.Last() + }, + Enumerable.Empty(), + new SoilLayer.ConstructionProperties()), + new SoilLayer( + new[] + { + surfaceLine.LocalGeometry.First(), + surfaceLine.LocalGeometry.Last() + }, + Enumerable.Empty(), + new SoilLayer.ConstructionProperties()) + }, new[] + { + new PreconsolidationStress(new Point2D(0, 0), 1.1) + }); } private static MacroStabilityInwardsSurfaceLine CreateValidSurfaceLine() Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetCalculatorTest.cs =================================================================== diff -u -re2fce8d8e6cf66d649e62ca10b22536f44c266c2 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetCalculatorTest.cs (.../WaternetCalculatorTest.cs) (revision e2fce8d8e6cf66d649e62ca10b22536f44c266c2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetCalculatorTest.cs (.../WaternetCalculatorTest.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -208,7 +208,7 @@ private static SoilProfile CreateValidSoilProfile(MacroStabilityInwardsSurfaceLine surfaceLine) { - return new SoilProfile(new[] + return new SoilProfile("Valid Profile", new[] { new SoilLayer( new[] Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilCreatorTest.cs =================================================================== diff -u -r9f35261205f8f664dc06e652f6d264ad9fee7bd9 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilCreatorTest.cs (.../SoilCreatorTest.cs) (revision 9f35261205f8f664dc06e652f6d264ad9fee7bd9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilCreatorTest.cs (.../SoilCreatorTest.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -56,8 +56,9 @@ { // Setup var random = new Random(11); + const string name = "Profile Name"; - var profile = new SoilProfile(new[] + var profile = new SoilProfile(name, new[] { new SoilLayer( new[] @@ -128,6 +129,7 @@ Soil[] soils = SoilCreator.Create(profile); // Assert + Assert.AreEqual(name, profile.Name); Assert.AreEqual(3, soils.Length); CollectionAssert.AreEqual(profile.Layers.Select(l => l.UsePop), soils.Select(s => s.UsePop)); @@ -161,7 +163,7 @@ public void Create_InvalidShearStrengthModel_ThrowInvalidEnumArgumentException() { // Setup - var profile = new SoilProfile(new[] + var profile = new SoilProfile("name", new[] { new SoilLayer( new[] @@ -187,7 +189,7 @@ public void Create_InvalidDilatancyType_ThrowInvalidEnumArgumentException() { // Setup - var profile = new SoilProfile(new[] + var profile = new SoilProfile("name", new[] { new SoilLayer( new[] Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilProfileCreatorTest.cs =================================================================== diff -u -r9f35261205f8f664dc06e652f6d264ad9fee7bd9 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilProfileCreatorTest.cs (.../SoilProfileCreatorTest.cs) (revision 9f35261205f8f664dc06e652f6d264ad9fee7bd9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilProfileCreatorTest.cs (.../SoilProfileCreatorTest.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -55,9 +55,9 @@ public void Create_SoilDictionaryNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => SoilProfileCreator.Create(new SoilProfile( - Enumerable.Empty(), - Enumerable.Empty()), + TestDelegate call = () => SoilProfileCreator.Create(new SoilProfile(string.Empty, + Enumerable.Empty(), + Enumerable.Empty()), null); // Assert @@ -80,10 +80,11 @@ WaterPressureInterpolationModel = (WaterPressureInterpolationModel) 99 }); - var soilProfile = new SoilProfile(new[] - { - layer - }, Enumerable.Empty()); + var soilProfile = new SoilProfile(string.Empty, + new[] + { + layer + }, Enumerable.Empty()); // Call TestDelegate test = () => SoilProfileCreator.Create(soilProfile, new Dictionary @@ -107,6 +108,7 @@ double preconsolidationStressXCoordinate = random.Next(); double preconsolidationStressZCoordinate = random.Next(); RoundedDouble preconsolidationStressDesignValue = random.NextRoundedDouble(); + const string name = "Profile Name Test"; var outerRing = new[] { @@ -134,13 +136,17 @@ outerRing, holes, new SoilLayer.ConstructionProperties { + MaterialName = "Sand", IsAquifer = true, WaterPressureInterpolationModel = waterPressureInterpolationModel }); - var soil = new Soil(); + var soil = new Soil + { + Name = layer.MaterialName + }; - var soilProfile = new SoilProfile(new[] + var soilProfile = new SoilProfile(name, new[] { layer }, new[] @@ -157,6 +163,7 @@ }); // Assert + Assert.AreEqual(name, profile.Name); Assert.AreEqual(1, profile.PreconsolidationStresses.Count); PreConsolidationStress preconsolidationStress = profile.PreconsolidationStresses.First(); @@ -168,7 +175,7 @@ Assert.AreEqual(1, profile.Surfaces.Count); SoilLayer2D surface = profile.Surfaces.First(); Assert.AreSame(soil, surface.Soil); - Assert.IsFalse(string.IsNullOrEmpty(surface.Name)); // Unused property + Assert.AreEqual(layer.MaterialName, surface.Name); Assert.AreEqual(layer.IsAquifer, surface.IsAquifer); Assert.AreEqual(waterpressureInterpolationModel, surface.WaterpressureInterpolationModel); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Kernels/UpliftVan/UpliftVanKernelWrapperTest.cs =================================================================== diff -u -re2978d1198c3af45bda6e6ec14e26561fc992d71 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Kernels/UpliftVan/UpliftVanKernelWrapperTest.cs (.../UpliftVanKernelWrapperTest.cs) (revision e2978d1198c3af45bda6e6ec14e26561fc992d71) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Kernels/UpliftVan/UpliftVanKernelWrapperTest.cs (.../UpliftVanKernelWrapperTest.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -92,6 +92,8 @@ Assert.IsNotNull(stabilityModel.SlipPlaneConstraints); Assert.AreEqual(GridOrientation.Inwards, stabilityModel.GridOrientation); Assert.IsNotNull(stabilityModel.SlipCircle); + Assert.IsNotNull(stabilityModel.GeotechnicsData.CurrentWaternetDaily); + Assert.AreEqual("WaternetDaily", stabilityModel.GeotechnicsData.CurrentWaternetDaily.Name); Assert.AreEqual(SearchAlgorithm.Grid, stabilityModel.SearchAlgorithm); Assert.AreEqual(ModelOptions.UpliftVan, stabilityModel.ModelOption); Assert.AreSame(surfaceLine, stabilityModel.SurfaceLine2); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Calculators/Input/TestSoilProfileTest.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Calculators/Input/TestSoilProfileTest.cs (.../TestSoilProfileTest.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Calculators/Input/TestSoilProfileTest.cs (.../TestSoilProfileTest.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -39,6 +39,7 @@ Assert.IsInstanceOf(profile); Assert.AreEqual(1, profile.Layers.Count()); SoilLayer layer = profile.Layers.First(); + Assert.AreEqual(string.Empty, profile.Name); CollectionAssert.IsEmpty(layer.OuterRing); CollectionAssert.IsEmpty(layer.Holes); CollectionAssert.IsEmpty(profile.PreconsolidationStresses); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/Input/TestSoilProfile.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/Input/TestSoilProfile.cs (.../TestSoilProfile.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/Input/TestSoilProfile.cs (.../TestSoilProfile.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -32,7 +32,7 @@ /// /// Creates a new instance of . /// - public TestSoilProfile() : base(new[] + public TestSoilProfile() : base(string.Empty, new[] { new SoilLayer(new Point2D[0], new Point2D[0][], new SoilLayer.ConstructionProperties()) }, new PreconsolidationStress[0]) {} Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/UpliftVan/Input/KernelInputAssert.cs =================================================================== diff -u -r5b9f582b5c7815a95c306d624a11c2d771840f91 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/UpliftVan/Input/KernelInputAssert.cs (.../KernelInputAssert.cs) (revision 5b9f582b5c7815a95c306d624a11c2d771840f91) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/UpliftVan/Input/KernelInputAssert.cs (.../KernelInputAssert.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -57,6 +57,7 @@ /// is not equal to . public static void AssertSoilProfiles(SoilProfile2D expected, SoilProfile2D actual) { + Assert.AreEqual(expected.Name, actual.Name); AssertSoilLayers(expected.Surfaces.ToArray(), actual.Surfaces.ToArray()); AssertPreconsolidationStresses(expected.PreconsolidationStresses.ToArray(), actual.PreconsolidationStresses.ToArray()); AssertGeometryDatas(expected.Geometry, actual.Geometry); @@ -129,6 +130,7 @@ SoilLayer2D expectedSurface = expected[i]; SoilLayer2D actualSurface = actual[i]; + Assert.AreEqual(expectedSurface.Name, actualSurface.Name); Assert.AreEqual(expectedSurface.IsAquifer, actualSurface.IsAquifer); AssertGeometrySurfaces(expectedSurface.GeometrySurface, actualSurface.GeometrySurface); AssertSoils(expectedSurface.Soil, actualSurface.Soil); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/SoilProfileConverterTest.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r00e2b17f81b30dfe4b71e3535424256d7cd02895 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/SoilProfileConverterTest.cs (.../SoilProfileConverterTest.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/SoilProfileConverterTest.cs (.../SoilProfileConverterTest.cs) (revision 00e2b17f81b30dfe4b71e3535424256d7cd02895) @@ -56,64 +56,67 @@ // Setup var random = new Random(22); - var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine(new[] - { - new MacroStabilityInwardsSoilLayerUnderSurfaceLine(CreateRing(21), new List + var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine( + "Profile Test", + new[] { - CreateRing(11), - CreateRing(22) - }, new MacroStabilityInwardsSoilLayerData + new MacroStabilityInwardsSoilLayerUnderSurfaceLine(CreateRing(21), + new List + { + CreateRing(11), + CreateRing(22) + }, new MacroStabilityInwardsSoilLayerData + { + UsePop = random.NextBoolean(), + IsAquifer = random.NextBoolean(), + MaterialName = "Test", + AbovePhreaticLevel = + { + Mean = (RoundedDouble) 10, + CoefficientOfVariation = (RoundedDouble) 0.3, + Shift = (RoundedDouble) 0.1 + }, + BelowPhreaticLevel = + { + Mean = (RoundedDouble) 5, + CoefficientOfVariation = (RoundedDouble) 0.8, + Shift = (RoundedDouble) 0.3 + }, + Cohesion = + { + Mean = random.NextRoundedDouble(), + CoefficientOfVariation = random.NextRoundedDouble() + }, + FrictionAngle = + { + Mean = random.NextRoundedDouble(), + CoefficientOfVariation = random.NextRoundedDouble() + }, + StrengthIncreaseExponent = + { + Mean = random.NextRoundedDouble(), + CoefficientOfVariation = random.NextRoundedDouble() + }, + ShearStrengthRatio = + { + Mean = random.NextRoundedDouble(), + CoefficientOfVariation = random.NextRoundedDouble() + }, + Pop = + { + Mean = random.NextRoundedDouble(), + CoefficientOfVariation = random.NextRoundedDouble() + } + }) + }, new[] { - UsePop = random.NextBoolean(), - IsAquifer = random.NextBoolean(), - MaterialName = "Test", - AbovePhreaticLevel = - { - Mean = (RoundedDouble) 10, - CoefficientOfVariation = (RoundedDouble) 0.3, - Shift = (RoundedDouble) 0.1 - }, - BelowPhreaticLevel = - { - Mean = (RoundedDouble) 5, - CoefficientOfVariation = (RoundedDouble) 0.8, - Shift = (RoundedDouble) 0.3 - }, - Cohesion = - { - Mean = random.NextRoundedDouble(), - CoefficientOfVariation = random.NextRoundedDouble() - }, - FrictionAngle = - { - Mean = random.NextRoundedDouble(), - CoefficientOfVariation = random.NextRoundedDouble() - }, - StrengthIncreaseExponent = - { - Mean = random.NextRoundedDouble(), - CoefficientOfVariation = random.NextRoundedDouble() - }, - ShearStrengthRatio = - { - Mean = random.NextRoundedDouble(), - CoefficientOfVariation = random.NextRoundedDouble() - }, - Pop = - { - Mean = random.NextRoundedDouble(), - CoefficientOfVariation = random.NextRoundedDouble() - } - }) - }, new[] - { - new MacroStabilityInwardsPreconsolidationStress(new Point2D(random.NextDouble(), random.NextDouble()), - new VariationCoefficientLogNormalDistribution - { - Mean = (RoundedDouble) 0.05, - CoefficientOfVariation = random.NextRoundedDouble() - }) - }); + new MacroStabilityInwardsPreconsolidationStress(new Point2D(random.NextDouble(), random.NextDouble()), + new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) 0.05, + CoefficientOfVariation = random.NextRoundedDouble() + }) + }); // Call SoilProfile soilProfile = SoilProfileConverter.Convert(profile); @@ -126,7 +129,7 @@ public void Convert_InvalidShearStrengthModel_ThrowInvalidEnumArgumentException() { // Setup - var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine(new[] + var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine("name", new[] { new MacroStabilityInwardsSoilLayerUnderSurfaceLine(CreateRing(21), new Point2D[0][], new MacroStabilityInwardsSoilLayerData @@ -151,7 +154,7 @@ ShearStrengthModel expectedShearStrengthModel) { // Setup - var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine(new[] + var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine("name", new[] { new MacroStabilityInwardsSoilLayerUnderSurfaceLine(CreateRing(21), new Point2D[0][], new MacroStabilityInwardsSoilLayerData