Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj
===================================================================
diff -u -rcbe303fbc7bcf3a77b34d511eb2b41f49b48e67c -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision cbe303fbc7bcf3a77b34d511eb2b41f49b48e67c)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -80,7 +80,6 @@
Resources.resx
-
Fisheye: Tag bf334f50530164badedba45a78f3aab857ae1bf6 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfileType.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilProfileProperties.cs
===================================================================
diff -u -r0ebf7ee0c2ee3cefb8f3d0eed09e702780e85c4b -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilProfileProperties.cs (.../StochasticSoilProfileProperties.cs) (revision 0ebf7ee0c2ee3cefb8f3d0eed09e702780e85c4b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilProfileProperties.cs (.../StochasticSoilProfileProperties.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -30,6 +30,7 @@
using Core.Common.Utils.Attributes;
using Ringtoets.Piping.Data;
using Ringtoets.Piping.Forms.Properties;
+using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.Forms.PropertyClasses
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilDatabaseQueryBuilder.cs
===================================================================
diff -u -r045bb1ffbe520f780522bd6b4f6afe06c096d34c -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilDatabaseQueryBuilder.cs (.../SoilDatabaseQueryBuilder.cs) (revision 045bb1ffbe520f780522bd6b4f6afe06c096d34c)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilDatabaseQueryBuilder.cs (.../SoilDatabaseQueryBuilder.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+
using Ringtoets.Piping.IO.SoilProfile;
namespace Ringtoets.Piping.IO.Builders
@@ -112,19 +113,26 @@
/// that can be read from the database.
public static string GetPipingSoilProfileCountQuery()
{
- return String.Format("SELECT (" +
- "SELECT COUNT(DISTINCT s2.SP2D_ID) " +
- "FROM Mechanism AS m " +
- "JOIN MechanismPointLocation AS mpl USING(ME_ID) " +
- "JOIN SoilProfile2D AS p2 USING(SP2D_ID) " +
- "JOIN SoilLayer2D AS s2 USING(SP2D_ID) " +
- "WHERE m.{0} = @{0} " +
- ") + ( " +
- "SELECT COUNT(DISTINCT p1.SP1D_ID) " +
- "FROM SoilProfile1D AS p1 " +
- "JOIN SoilLayer1D AS s1 " +
- "USING(SP1D_ID)" +
- ") AS {1};", MechanismDatabaseColumns.MechanismName, SoilProfileDatabaseColumns.ProfileCount);
+ return String.Format(
+ "SELECT (" +
+ "SELECT COUNT(DISTINCT sl1D.SP1D_ID) " +
+ "FROM Mechanism AS m " +
+ "JOIN Segment AS segment USING(ME_ID) " +
+ "JOIN StochasticSoilProfile ssp USING(SSM_ID) " +
+ "JOIN SoilLayer1D sl1D USING(SP1D_ID) " +
+ "WHERE m.ME_Name = @{0}" +
+ ") + (" +
+ "SELECT COUNT(DISTINCT sl2D.SP2D_ID) " +
+ "FROM Mechanism AS m " +
+ "JOIN Segment AS segment USING(ME_ID) " +
+ "JOIN StochasticSoilProfile ssp USING(SSM_ID) " +
+ "JOIN SoilLayer2D sl2D USING(SP2D_ID) " +
+ "JOIN MechanismPointLocation mpl USING(ME_ID) " +
+ "WHERE m.ME_Name = @{0}" +
+ ") " +
+ "AS {1};",
+ MechanismDatabaseColumns.MechanismName,
+ SoilProfileDatabaseColumns.ProfileCount);
}
///
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilProfileBuilder1D.cs
===================================================================
diff -u -rd82fa09fe9ae053ce7702ba89ef23ae029640d1b -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilProfileBuilder1D.cs (.../SoilProfileBuilder1D.cs) (revision d82fa09fe9ae053ce7702ba89ef23ae029640d1b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilProfileBuilder1D.cs (.../SoilProfileBuilder1D.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -52,7 +52,7 @@
{
try
{
- return new PipingSoilProfile(name, bottom, layers, soilProfileId);
+ return new PipingSoilProfile(name, bottom, layers, SoilProfileType.SoilProfile1D, soilProfileId);
}
catch (ArgumentException e)
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilProfileBuilder2D.cs
===================================================================
diff -u -rd82fa09fe9ae053ce7702ba89ef23ae029640d1b -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilProfileBuilder2D.cs (.../SoilProfileBuilder2D.cs) (revision d82fa09fe9ae053ce7702ba89ef23ae029640d1b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilProfileBuilder2D.cs (.../SoilProfileBuilder2D.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -72,7 +72,7 @@
{
try
{
- return new PipingSoilProfile(profileName, bottom, layers, soilProfileId);
+ return new PipingSoilProfile(profileName, bottom, layers, SoilProfileType.SoilProfile2D, soilProfileId);
}
catch (ArgumentException e)
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/PipingSoilProfileReader.cs
===================================================================
diff -u -r220a073b3d2066d57af048325e3ba37bb1340d0d -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/PipingSoilProfileReader.cs (.../PipingSoilProfileReader.cs) (revision 220a073b3d2066d57af048325e3ba37bb1340d0d)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/PipingSoilProfileReader.cs (.../PipingSoilProfileReader.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -22,13 +22,16 @@
using System;
using System.Data;
using System.Data.SQLite;
+
using Core.Common.IO.Exceptions;
using Core.Common.IO.Readers;
using Core.Common.Utils.Builders;
+
using Ringtoets.Piping.IO.Builders;
using Ringtoets.Piping.IO.Exceptions;
using Ringtoets.Piping.IO.Properties;
using Ringtoets.Piping.Primitives;
+
using UtilsResources = Core.Common.Utils.Properties.Resources;
namespace Ringtoets.Piping.IO.SoilProfile
@@ -130,7 +133,7 @@
{
return null;
}
- return (T) valueObject;
+ return (T)valueObject;
}
///
@@ -142,7 +145,7 @@
/// Thrown when the value in the column was not of type .
public T Read(string columnName)
{
- return (T) dataReader[columnName];
+ return (T)dataReader[columnName];
}
private void VerifyVersion(string databaseFilePath)
@@ -225,71 +228,76 @@
{
string countQuery = SoilDatabaseQueryBuilder.GetPipingSoilProfileCountQuery();
- string materialPropertiesQuery = string.Format(
- string.Join(" ",
- "(SELECT",
- "m.MA_ID,",
- "max(case when pn.PN_Name = 'AbovePhreaticLevel' then pv.PV_Value end) {0},",
- "max(case when pn.PN_Name = 'BelowPhreaticLevel' then pv.PV_Value end) {1},",
- "max(case when pn.PN_Name = 'DryUnitWeight' then pv.PV_Value end) {2}",
- "FROM ParameterNames as pn",
- "JOIN ParameterValues as pv USING(PN_ID)",
- "JOIN Materials as m USING(MA_ID)",
- "GROUP BY m.MA_ID) as mat USING(MA_ID)"),
- SoilProfileDatabaseColumns.AbovePhreaticLevel,
- SoilProfileDatabaseColumns.BelowPhreaticLevel,
- SoilProfileDatabaseColumns.DryUnitWeight);
+ string subQueryGetNumberOfLayerProfile1D =
+ string.Format("SELECT SP1D_ID, COUNT(*) as {0} " +
+ "FROM SoilLayer1D " +
+ "GROUP BY SP1D_ID",
+ SoilProfileDatabaseColumns.LayerCount);
+ string subQueryGetNumberOfLayerProfile2D =
+ string.Format("SELECT SP2D_ID, COUNT(*) as {0} " +
+ "FROM SoilLayer2D " +
+ "GROUP BY SP2D_ID",
+ SoilProfileDatabaseColumns.LayerCount);
+ string subQueryGetMaterialPropertiesOfLayer =
+ String.Format(
+ "SELECT " +
+ "mat.MA_ID, " +
+ "MAX(case when pn.PN_NAME = '{0}' then pv.PV_Value end) {0}, " +
+ "MAX(case when pn.PN_NAME = '{1}' then pv.PV_Value end) {1}, " +
+ "MAX(case when pn.PN_NAME = '{2}' then pv.PV_Value end) {2} " +
+ "FROM ParameterNames as pn " +
+ "JOIN ParameterValues as pv USING(PN_ID) " +
+ "JOIN Materials as mat USING(MA_ID) " +
+ "GROUP BY mat.MA_ID",
+ SoilProfileDatabaseColumns.AbovePhreaticLevel,
+ SoilProfileDatabaseColumns.BelowPhreaticLevel,
+ SoilProfileDatabaseColumns.DryUnitWeight);
+ string subQueryGetLayerPropertiesOfLayer1D =
+ String.Format(
+ "SELECT " +
+ "SL1D_ID, " +
+ "MAX(case when pn.PN_NAME = '{0}' then pv.PV_Value end) {0} " +
+ "FROM ParameterNames as pn " +
+ "JOIN LayerParameterValues as pv USING(PN_ID) " +
+ "GROUP BY pv.SL1D_ID",
+ SoilProfileDatabaseColumns.IsAquifer);
+ string subQueryGetLayerPropertiesOfLayer2D =
+ String.Format(
+ "SELECT " +
+ "SL2D_ID, " +
+ "MAX(case when pn.PN_NAME = '{0}' then pv.PV_Value end) {0} " +
+ "FROM ParameterNames as pn " +
+ "JOIN LayerParameterValues as pv USING(PN_ID) " +
+ "GROUP BY pv.SL2D_ID",
+ SoilProfileDatabaseColumns.IsAquifer);
- string layer1DCountQuery = string.Format(
- string.Join(" ",
- "(SELECT SP1D_ID, COUNT(*) as {0}",
- "FROM SoilLayer1D",
- "GROUP BY SP1D_ID) lc USING(SP1D_ID)"), SoilProfileDatabaseColumns.LayerCount);
-
- string layer2DCountQuery = string.Format(
- string.Join(" ",
- "(SELECT SP2D_ID, COUNT(*) as {0}",
- "FROM SoilLayer2D",
- "GROUP BY SP2D_ID) lc USING(SP2D_ID)"), SoilProfileDatabaseColumns.LayerCount);
-
- string layer1DPropertiesQuery = string.Format(
- string.Join(" ",
- "(SELECT",
- "pv.SL1D_ID,",
- "max(case when pn.PN_Name = 'IsAquifer' then pv.PV_Value end) {0}",
- "FROM ParameterNames as pn",
- "JOIN LayerParameterValues as pv USING(PN_ID)",
- "GROUP BY pv.SL1D_ID) as lpv USING(SL1D_ID)"
- ), SoilProfileDatabaseColumns.IsAquifer);
-
- string layer2DPropertiesQuery = string.Format(
- string.Join(" ",
- "(SELECT",
- "pv.SL2D_ID,",
- "max(case when pn.PN_Name = 'IsAquifer' then pv.PV_Value end) {0}",
- "FROM ParameterNames as pn",
- "JOIN LayerParameterValues as pv USING(PN_ID)",
- "GROUP BY pv.SL2D_ID) as lpv USING(SL2D_ID)"
- ), SoilProfileDatabaseColumns.IsAquifer);
-
var query1D = string.Format(
- string.Join(" ", "SELECT",
- "1 as {0},",
- "p.SP1D_Name as {1},",
- "lc.{2},",
- "p.BottomLevel as {3},",
- "l.TopLevel as {4},",
- "{5},",
- "{6},",
- "{7},",
- "{8},",
- "p.SP1D_ID as {9}",
- "FROM SoilProfile1D as p",
- "JOIN {10}",
- "JOIN SoilLayer1D as l USING(SP1D_ID)",
- "LEFT JOIN {11}",
- "LEFT JOIN {12}",
- "ORDER BY ProfileName;"),
+ "SELECT " +
+ "1 AS {0}, " +
+ "sp1d.SP1D_Name AS {1}, " +
+ "layerCount.{2}, " +
+ "sp1d.BottomLevel AS {3}, " +
+ "sl1d.TopLevel AS {4}, " +
+ "{5}, " +
+ "{6}, " +
+ "{7}, " +
+ "{8}, " +
+ "sp1d.SP1D_ID AS {9} " +
+ "FROM Mechanism AS m " +
+ "JOIN Segment AS segment USING(ME_ID) " +
+ "JOIN StochasticSoilProfile ssp USING(SSM_ID) " +
+ "JOIN SoilProfile1D sp1d USING (SP1D_ID) " +
+ "JOIN (" +
+ subQueryGetNumberOfLayerProfile1D +
+ ") layerCount USING (SP1D_ID) " +
+ "JOIN SoilLayer1D sl1d USING (SP1D_ID) " +
+ "LEFT JOIN (" +
+ subQueryGetMaterialPropertiesOfLayer +
+ ") materialProperties USING(MA_ID) " +
+ "LEFT JOIN (" +
+ subQueryGetLayerPropertiesOfLayer1D +
+ ") layerProperties USING(SL1D_ID) " +
+ "WHERE m.{10} = @{10};",
SoilProfileDatabaseColumns.Dimension,
SoilProfileDatabaseColumns.ProfileName,
SoilProfileDatabaseColumns.LayerCount,
@@ -300,32 +308,36 @@
SoilProfileDatabaseColumns.DryUnitWeight,
SoilProfileDatabaseColumns.IsAquifer,
SoilProfileDatabaseColumns.SoilProfileId,
- layer1DCountQuery,
- materialPropertiesQuery,
- layer1DPropertiesQuery);
+ MechanismDatabaseColumns.MechanismName);
var query2D = string.Format(
- string.Join(" ",
- "SELECT",
- "2 as {0},",
- "p.SP2D_Name as {1},",
- "lc.{2},",
- "l.GeometrySurface as {3}, ",
- "mpl.X as {4},",
- "{5},",
- "{6},",
- "{7},",
- "{8},",
- "p.SP2D_ID as {9}",
- "FROM Mechanism as m",
- "JOIN MechanismPointLocation as mpl USING(ME_ID)",
- "JOIN SoilProfile2D as p USING(SP2D_ID)",
- "JOIN {10}",
- "JOIN SoilLayer2D as l USING(SP2D_ID)",
- "LEFT JOIN {11}",
- "LEFT JOIN {12}",
- "WHERE m.{13} = @{13}",
- "ORDER BY ProfileName;"),
+ "Select " +
+ "2 as {0}, " +
+ "sp2d.SP2D_Name as {1}, " +
+ "layerCount.{2}, " +
+ "sl2d.GeometrySurface as {3}, " +
+ "mpl.X as {4}, " +
+ "{5}, " +
+ "{6}, " +
+ "{7}, " +
+ "{8}, " +
+ "sp2d.SP2D_ID as {9} " +
+ "FROM Mechanism AS m " +
+ "JOIN Segment AS segment USING(ME_ID) " +
+ "JOIN StochasticSoilProfile ssp USING(SSM_ID) " +
+ "JOIN SoilProfile2D sp2d USING (SP2D_ID) " +
+ "JOIN (" +
+ subQueryGetNumberOfLayerProfile2D +
+ ") layerCount USING (SP2D_ID) " +
+ "JOIN SoilLayer2D sl2d USING (SP2D_ID) " +
+ "JOIN MechanismPointLocation mpl USING(ME_ID, SP2D_ID) " +
+ "LEFT JOIN (" +
+ subQueryGetMaterialPropertiesOfLayer +
+ ") materialProperties USING(MA_ID) " +
+ "LEFT JOIN (" +
+ subQueryGetLayerPropertiesOfLayer2D +
+ ") layerProperties USING(SL2D_ID) " +
+ "WHERE m.{10} = @{10};",
SoilProfileDatabaseColumns.Dimension,
SoilProfileDatabaseColumns.ProfileName,
SoilProfileDatabaseColumns.LayerCount,
@@ -336,9 +348,6 @@
SoilProfileDatabaseColumns.DryUnitWeight,
SoilProfileDatabaseColumns.IsAquifer,
SoilProfileDatabaseColumns.SoilProfileId,
- layer2DCountQuery,
- materialPropertiesQuery,
- layer2DPropertiesQuery,
MechanismDatabaseColumns.MechanismName);
dataReader = CreateDataReader(countQuery + query2D + query1D, new SQLiteParameter
@@ -357,7 +366,7 @@
private void GetCount()
{
dataReader.Read();
- Count = (int) Read(SoilProfileDatabaseColumns.ProfileCount);
+ Count = (int)Read(SoilProfileDatabaseColumns.ProfileCount);
dataReader.NextResult();
}
}
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilProfileReader.cs
===================================================================
diff -u -r64c21c2c91a3cef9df279e58efda8e45a9d598f7 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilProfileReader.cs (.../StochasticSoilProfileReader.cs) (revision 64c21c2c91a3cef9df279e58efda8e45a9d598f7)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilProfileReader.cs (.../StochasticSoilProfileReader.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -28,6 +28,7 @@
using Ringtoets.Piping.IO.Builders;
using Ringtoets.Piping.IO.Exceptions;
using Ringtoets.Piping.IO.Properties;
+using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.IO.SoilProfile
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs
===================================================================
diff -u -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs (.../PipingSoilProfilesImporter.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs (.../PipingSoilProfilesImporter.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -139,7 +139,7 @@
{
foreach (var stochasticSoilProfile in stochasticSoilModel.StochasticSoilProfiles)
{
- var soilProfile = soilProfiles.FirstOrDefault(s => s.PipingSoilProfileId == stochasticSoilProfile.SoilProfileId);
+ var soilProfile = soilProfiles.FirstOrDefault(s => s.SoilProfileType == stochasticSoilProfile.SoilProfileType && s.PipingSoilProfileId == stochasticSoilProfile.SoilProfileId);
if (soilProfile != null)
{
stochasticSoilProfile.SoilProfile = soilProfile;
@@ -185,18 +185,28 @@
private bool ValidateStochasticSoilModel(StochasticSoilModel stochasticSoilModel)
{
- if (stochasticSoilModel.StochasticSoilProfiles.Count(s => s.SoilProfile == null) > 0)
+ if (stochasticSoilModel.StochasticSoilProfiles.Any(s => s.SoilProfile == null))
{
- log.WarnFormat(RingtoetsPluginResources.PipingSoilProfilesImporter_ValidateStochasticSoilModel_No_profiles_found_in_stochastic_soil_model_0, stochasticSoilModel.Name);
+ log.WarnFormat(RingtoetsPluginResources.PipingSoilProfilesImporter_ValidateStochasticSoilModel_No_profiles_found_in_stochastic_soil_model_0,
+ stochasticSoilModel.Name);
return false;
}
- if (!stochasticSoilModel.StochasticSoilProfiles.Where(s => s.SoilProfile != null).Sum(s => s.Probability).Equals(1.0))
+ if (!IsSumOfAllProbabilitiesEqualToOne(stochasticSoilModel))
{
- log.WarnFormat(RingtoetsPluginResources.PipingSoilProfilesImporter_ValidateStochasticSoilModel_Sum_of_probabilities_of_stochastic_soil_model_0_is_not_correct, stochasticSoilModel.Name);
+ log.WarnFormat(RingtoetsPluginResources.PipingSoilProfilesImporter_ValidateStochasticSoilModel_Sum_of_probabilities_of_stochastic_soil_model_0_is_not_correct,
+ stochasticSoilModel.Name);
}
return true;
}
+ private static bool IsSumOfAllProbabilitiesEqualToOne(StochasticSoilModel stochasticSoilModel)
+ {
+ double sumOfAllScenarioProbabilities = stochasticSoilModel.StochasticSoilProfiles
+ .Where(s => s.SoilProfile != null)
+ .Sum(s => s.Probability);
+ return Math.Abs(sumOfAllScenarioProbabilities - 1.0) < 1e-6;
+ }
+
private static bool IsReferenceLineAvailable(object targetItem)
{
return ((StochasticSoilModelContext) targetItem).AssessmentSection.ReferenceLine != null;
Index: Ringtoets/Piping/src/Ringtoets.Piping.Primitives/PipingSoilProfile.cs
===================================================================
diff -u -rd82fa09fe9ae053ce7702ba89ef23ae029640d1b -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/src/Ringtoets.Piping.Primitives/PipingSoilProfile.cs (.../PipingSoilProfile.cs) (revision d82fa09fe9ae053ce7702ba89ef23ae029640d1b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Primitives/PipingSoilProfile.cs (.../PipingSoilProfile.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -40,14 +40,17 @@
/// The name of the profile.
/// The bottom level of the profile.
/// The collection of layers that should be part of the profile.
+ /// The type of soil profile used as data source
+ /// to build this instance.
/// Identifier of the profile.
/// Thrown when contains no layers.
/// Thrown when is null.
- public PipingSoilProfile(string name, double bottom, IEnumerable layers, long pipingSoilProfileId)
+ public PipingSoilProfile(string name, double bottom, IEnumerable layers, SoilProfileType sourceProfileType, long pipingSoilProfileId)
{
Name = name;
Bottom = bottom;
Layers = layers;
+ SoilProfileType = sourceProfileType;
PipingSoilProfileId = pipingSoilProfileId;
}
@@ -86,6 +89,11 @@
}
///
+ /// Gets the type of soil profile used as data source to build this instance.
+ ///
+ public SoilProfileType SoilProfileType { get; private set; }
+
+ ///
/// Gets the thickness of the given layer in the .
/// Thickness of a layer is determined by its top and the top of the layer below it.
///
Index: Ringtoets/Piping/src/Ringtoets.Piping.Primitives/Ringtoets.Piping.Primitives.csproj
===================================================================
diff -u -r44055100aa3c3f382227becdaeae7d97c75d386c -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/src/Ringtoets.Piping.Primitives/Ringtoets.Piping.Primitives.csproj (.../Ringtoets.Piping.Primitives.csproj) (revision 44055100aa3c3f382227becdaeae7d97c75d386c)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Primitives/Ringtoets.Piping.Primitives.csproj (.../Ringtoets.Piping.Primitives.csproj) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -62,6 +62,7 @@
True
+
Index: Ringtoets/Piping/src/Ringtoets.Piping.Primitives/SoilProfileType.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Primitives/SoilProfileType.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Primitives/SoilProfileType.cs (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -0,0 +1,39 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+namespace Ringtoets.Piping.Primitives
+{
+ ///
+ /// Defines the various types of soil profiles.
+ ///
+ public enum SoilProfileType
+ {
+ ///
+ /// One dimensional soil profile.
+ ///
+ SoilProfile1D,
+
+ ///
+ /// One dimensional soil profile.
+ ///
+ SoilProfile2D
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs
===================================================================
diff -u -r5b63cfab474523f97be999403eb4906a0c376a3d -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs (.../DerivedPipingInputTest.cs) (revision 5b63cfab474523f97be999403eb4906a0c376a3d)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs (.../DerivedPipingInputTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -370,7 +370,7 @@
{
IsAquifer = false
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
LognormalDistribution thicknessCoverageLayer = derivedInput.ThicknessCoverageLayer;
@@ -391,7 +391,7 @@
{
IsAquifer = false
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
LognormalDistribution thicknessAquiferLayer = derivedInput.ThicknessAquiferLayer;
@@ -461,7 +461,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
LognormalDistribution thicknessAquiferLayer = derivedInput.ThicknessAquiferLayer;
@@ -486,7 +486,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
LognormalDistribution thicknessCoverageLayer = derivedInput.ThicknessCoverageLayer;
@@ -511,7 +511,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
var thicknessAquiferLayer = derivedInput.ThicknessAquiferLayer;
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs
===================================================================
diff -u -r5b63cfab474523f97be999403eb4906a0c376a3d -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision 5b63cfab474523f97be999403eb4906a0c376a3d)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -588,7 +588,7 @@
{
IsAquifer = false
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
LognormalDistribution thicknessCoverageLayer = input.ThicknessCoverageLayer;
@@ -608,7 +608,7 @@
{
IsAquifer = false
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
LognormalDistribution thicknessAquiferLayer = input.ThicknessAquiferLayer;
@@ -674,7 +674,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
LognormalDistribution thicknessAquiferLayer = input.ThicknessAquiferLayer;
@@ -698,7 +698,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
LognormalDistribution thicknessCoverageLayer = input.ThicknessCoverageLayer;
@@ -722,7 +722,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
var thicknessAquiferLayer = input.ThicknessAquiferLayer;
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingSoilProfileTest.cs
===================================================================
diff -u -r5b63cfab474523f97be999403eb4906a0c376a3d -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingSoilProfileTest.cs (.../PipingSoilProfileTest.cs) (revision 5b63cfab474523f97be999403eb4906a0c376a3d)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingSoilProfileTest.cs (.../PipingSoilProfileTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -12,7 +12,9 @@
public class PipingSoilProfileTest
{
[Test]
- public void Constructor_WithNameBottomLayersAndAquifer_ReturnsInstanceWithPropsAndEquivalentLayerCollection()
+ [TestCase(SoilProfileType.SoilProfile1D)]
+ [TestCase(SoilProfileType.SoilProfile2D)]
+ public void Constructor_WithNameBottomLayersAndAquifer_ReturnsInstanceWithPropsAndEquivalentLayerCollection(SoilProfileType type)
{
// Setup
var name = "Profile";
@@ -25,20 +27,21 @@
const long pipingSoilProfileId = 1234L;
// Call
- var profile = new PipingSoilProfile(name, bottom, layers, pipingSoilProfileId);
+ var profile = new PipingSoilProfile(name, bottom, layers, type, pipingSoilProfileId);
// Assert
Assert.AreNotSame(layers, profile.Layers);
Assert.AreEqual(name, profile.Name);
Assert.AreEqual(bottom, profile.Bottom);
+ Assert.AreEqual(type, profile.SoilProfileType);
Assert.AreEqual(pipingSoilProfileId, profile.PipingSoilProfileId);
}
[Test]
public void Constructor_WithNameBottomLayersEmpty_ThrowsArgumentException()
{
// Call
- TestDelegate test = () => new PipingSoilProfile(String.Empty, Double.NaN, new Collection(), 0);
+ TestDelegate test = () => new PipingSoilProfile(String.Empty, Double.NaN, new Collection(), SoilProfileType.SoilProfile1D, 0);
// Assert
TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, Resources.Error_Cannot_Construct_PipingSoilProfile_Without_Layers);
@@ -48,7 +51,7 @@
public void Constructor_WithNameBottomLayersNull_ThrowsArgumentNullException()
{
// Call
- TestDelegate test = () => new PipingSoilProfile(String.Empty, Double.NaN, null, 0);
+ TestDelegate test = () => new PipingSoilProfile(String.Empty, Double.NaN, null, SoilProfileType.SoilProfile1D, 0);
// Assert
TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, Resources.Error_Cannot_Construct_PipingSoilProfile_Without_Layers);
@@ -72,7 +75,7 @@
});
}
- var profile = new PipingSoilProfile(string.Empty, bottom, equivalentLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, bottom, equivalentLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.Layers.ToArray();
@@ -96,7 +99,7 @@
};
// Call
- TestDelegate test = () => new PipingSoilProfile(String.Empty, bottom, pipingSoilLayers, 0);
+ TestDelegate test = () => new PipingSoilProfile(String.Empty, bottom, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Assert
TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, "Eén of meerdere lagen hebben een top onder de bodem van het profiel.");
@@ -113,7 +116,7 @@
new PipingSoilLayer(0.0),
new PipingSoilLayer(1.1)
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var thickness = profile.GetLayerThickness(pipingSoilLayers[layerIndex]);
@@ -131,7 +134,7 @@
new PipingSoilLayer(0.0),
new PipingSoilLayer(1.1)
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
TestDelegate test = () => profile.GetLayerThickness(new PipingSoilLayer(1.1));
@@ -149,7 +152,7 @@
new PipingSoilLayer(2.1),
new PipingSoilLayer(1.1)
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(1.0);
@@ -170,7 +173,7 @@
},
new PipingSoilLayer(1.1)
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(1.0);
@@ -190,7 +193,7 @@
IsAquifer = true
},
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(2.2);
@@ -210,7 +213,7 @@
IsAquifer = true
},
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(1.6);
@@ -230,7 +233,7 @@
IsAquifer = true
},
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(1.6);
@@ -254,7 +257,7 @@
IsAquifer = true
}
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(2.2);
@@ -278,7 +281,7 @@
IsAquifer = true
}
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(2.1);
@@ -306,7 +309,7 @@
IsAquifer = true
}
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(1.3);
@@ -330,7 +333,7 @@
IsAquifer = true
}
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(1.5);
@@ -358,7 +361,7 @@
IsAquifer = false
}
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(0.5);
@@ -382,7 +385,7 @@
IsAquifer = true
},
};
- var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.0, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
var result = profile.GetTopAquiferLayerThicknessBelowLevel(1.1);
@@ -402,7 +405,7 @@
IsAquifer = true
}
};
- var profile = new PipingSoilProfile(string.Empty, 0.5, pipingSoilLayers, 0);
+ var profile = new PipingSoilProfile(string.Empty, 0.5, pipingSoilLayers, SoilProfileType.SoilProfile1D, 0);
// Call
TestDelegate call = () => profile.GetTopAquiferLayerThicknessBelowLevel(0.0);
@@ -422,7 +425,7 @@
var profile = new PipingSoilProfile(name, 0.0, new[]
{
new PipingSoilLayer(0.0)
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call & Assert
Assert.AreEqual(name, profile.ToString());
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilProfileTest.cs
===================================================================
diff -u -r3bf7e84ac84de7dd0be38be7e9f2372878e733f6 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilProfileTest.cs (.../StochasticSoilProfileTest.cs) (revision 3bf7e84ac84de7dd0be38be7e9f2372878e733f6)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilProfileTest.cs (.../StochasticSoilProfileTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -21,6 +21,8 @@
using NUnit.Framework;
+using Ringtoets.Piping.Primitives;
+
namespace Ringtoets.Piping.Data.Test
{
[TestFixture]
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingCalculationFactory.cs
===================================================================
diff -u -r3721b5bb1ae327907884a90d1a9bd300042e0540 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingCalculationFactory.cs (.../PipingCalculationFactory.cs) (revision 3721b5bb1ae327907884a90d1a9bd300042e0540)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingCalculationFactory.cs (.../PipingCalculationFactory.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -27,7 +27,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
var surfaceLine = new RingtoetsPipingSurfaceLine();
var firstCharacteristicPointLocation = new Point3D(0.2, 0.0, bottom + 3 * top/ 4);
var secondCharacteristicPointLocation = new Point3D(0.3, 0.0, bottom + 2 * top / 4);
@@ -111,7 +111,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
return new PipingInput(new GeneralPipingInput())
{
@@ -144,7 +144,7 @@
{
IsAquifer = false
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
var input = new PipingInput(new GeneralPipingInput())
{
SurfaceLine = surfaceLine,
@@ -176,7 +176,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
var input = new PipingInput(new GeneralPipingInput())
{
SurfaceLine = surfaceLine,
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/TestStochasticSoilModel.cs
===================================================================
diff -u -r43fb77c51a8d1c0af128a2da0c3d51bbea6e25bb -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/TestStochasticSoilModel.cs (.../TestStochasticSoilModel.cs) (revision 43fb77c51a8d1c0af128a2da0c3d51bbea6e25bb)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/TestStochasticSoilModel.cs (.../TestStochasticSoilModel.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -1,5 +1,6 @@
using System;
using Ringtoets.Piping.KernelWrapper.TestUtil;
+using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.Data.TestUtil
{
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PipingCalculationConfigurationHelperTest.cs
===================================================================
diff -u -re7923e041dfeb751cc6fe3b795f914f13734b19d -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PipingCalculationConfigurationHelperTest.cs (.../PipingCalculationConfigurationHelperTest.cs) (revision e7923e041dfeb751cc6fe3b795f914f13734b19d)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PipingCalculationConfigurationHelperTest.cs (.../PipingCalculationConfigurationHelperTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -21,13 +21,13 @@
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1);
+ }, SoilProfileType.SoilProfile1D, 1);
var soilProfile2 = new PipingSoilProfile("Profile 2", -8.0, new[]
{
new PipingSoilLayer(-4.0),
new PipingSoilLayer(0.0),
new PipingSoilLayer(4.0)
- }, 2);
+ }, SoilProfileType.SoilProfile1D, 2);
var soilModel = new StochasticSoilModel(1, "A", "B");
soilModel.Geometry.AddRange(new[]
@@ -80,13 +80,13 @@
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1);
+ }, SoilProfileType.SoilProfile1D, 1);
var soilProfile2 = new PipingSoilProfile("Profile 2", -8.0, new[]
{
new PipingSoilLayer(-4.0),
new PipingSoilLayer(0.0),
new PipingSoilLayer(4.0)
- }, 2);
+ }, SoilProfileType.SoilProfile1D, 2);
var soilModel = new StochasticSoilModel(1, "A", "B");
soilModel.Geometry.AddRange(new[]
@@ -176,13 +176,13 @@
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1);
+ }, SoilProfileType.SoilProfile1D, 1);
var soilProfile2 = new PipingSoilProfile("Profile 2", -8.0, new[]
{
new PipingSoilLayer(-4.0),
new PipingSoilLayer(0.0),
new PipingSoilLayer(4.0)
- }, 2);
+ }, SoilProfileType.SoilProfile1D, 2);
var soilModel = new StochasticSoilModel(1, "A", "B");
soilModel.Geometry.AddRange(new[]
@@ -230,13 +230,13 @@
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1);
+ }, SoilProfileType.SoilProfile1D, 1);
var soilProfile2 = new PipingSoilProfile("Profile 2", -8.0, new[]
{
new PipingSoilLayer(-4.0),
new PipingSoilLayer(0.0),
new PipingSoilLayer(4.0)
- }, 2);
+ }, SoilProfileType.SoilProfile1D, 2);
const double y = 1.1;
var soilModel1 = new StochasticSoilModel(1, "A", "B");
@@ -427,13 +427,13 @@
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1);
+ }, SoilProfileType.SoilProfile1D, 1);
var soilProfile2 = new PipingSoilProfile("Profile 2", -8.0, new[]
{
new PipingSoilLayer(-4.0),
new PipingSoilLayer(0.0),
new PipingSoilLayer(4.0)
- }, 2);
+ }, SoilProfileType.SoilProfile1D, 2);
var soilModel = new StochasticSoilModel(1, "A", "B");
soilModel.Geometry.AddRange(new[]
@@ -539,13 +539,13 @@
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1);
+ }, SoilProfileType.SoilProfile1D, 1);
var soilProfile2 = new PipingSoilProfile("Profile 2", -8.0, new[]
{
new PipingSoilLayer(-4.0),
new PipingSoilLayer(0.0),
new PipingSoilLayer(4.0)
- }, 2);
+ }, SoilProfileType.SoilProfile1D, 2);
var soilModel = new StochasticSoilModel(1, "A", "B");
soilModel.Geometry.AddRange(new[]
@@ -602,13 +602,13 @@
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1);
+ }, SoilProfileType.SoilProfile1D, 1);
var soilProfile2 = new PipingSoilProfile("Profile 2", -8.0, new[]
{
new PipingSoilLayer(-4.0),
new PipingSoilLayer(0.0),
new PipingSoilLayer(4.0)
- }, 2);
+ }, SoilProfileType.SoilProfile1D, 2);
const double y = 1.1;
var soilModel1 = new StochasticSoilModel(1, "A", "B");
@@ -686,13 +686,13 @@
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1);
+ }, SoilProfileType.SoilProfile1D, 1);
var soilProfile2 = new PipingSoilProfile("Profile 2", -8.0, new[]
{
new PipingSoilLayer(-4.0),
new PipingSoilLayer(0.0),
new PipingSoilLayer(4.0)
- }, 2);
+ }, SoilProfileType.SoilProfile1D, 2);
const double y = 1.1;
var soilModel1 = new StochasticSoilModel(1, "A", "B");
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs
===================================================================
diff -u -r16b01f208966fa77f73b7977db23da94786f08d1 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 16b01f208966fa77f73b7977db23da94786f08d1)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -51,7 +51,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
var testHydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(0.0);
var inputParameters = new PipingInput(new GeneralPipingInput())
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilModelPropertiesTest.cs
===================================================================
diff -u -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilModelPropertiesTest.cs (.../StochasticSoilModelPropertiesTest.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilModelPropertiesTest.cs (.../StochasticSoilModelPropertiesTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -52,7 +52,7 @@
var pipingSoilProfile = new PipingSoilProfile("PipingSoilProfile", 0, new List
{
new PipingSoilLayer(10)
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
var stochasticSoilProfile = new StochasticSoilProfile(1.0, SoilProfileType.SoilProfile1D, 1)
{
SoilProfile = pipingSoilProfile
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilProfilePropertiesTest.cs
===================================================================
diff -u -r026b524685096af08e8adfd99406eab049506c3b -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilProfilePropertiesTest.cs (.../StochasticSoilProfilePropertiesTest.cs) (revision 026b524685096af08e8adfd99406eab049506c3b)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilProfilePropertiesTest.cs (.../StochasticSoilProfilePropertiesTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -76,7 +76,7 @@
}
};
- var soilProfile = new PipingSoilProfile(expectedName, -5.0, layers, 0);
+ var soilProfile = new PipingSoilProfile(expectedName, -5.0, layers, SoilProfileType.SoilProfile1D, 0);
var stochasticSoilProfile = new StochasticSoilProfile(probability, SoilProfileType.SoilProfile1D, 1234L)
{
SoilProfile = soilProfile
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilModelContextTreeNodeInfoTest.cs
===================================================================
diff -u -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilModelContextTreeNodeInfoTest.cs (.../StochasticSoilModelContextTreeNodeInfoTest.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilModelContextTreeNodeInfoTest.cs (.../StochasticSoilModelContextTreeNodeInfoTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -151,11 +151,11 @@
var pipingSoilProfile1 = new PipingSoilProfile("pipingSoilProfile1", 0, new List
{
new PipingSoilLayer(10)
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
var pipingSoilProfile2 = new PipingSoilProfile("pipingSoilProfile2", 0, new List
{
new PipingSoilLayer(10)
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
var stochasticSoilProfile1 = new StochasticSoilProfile(1.0, SoilProfileType.SoilProfile1D, 1)
{
SoilProfile = pipingSoilProfile1
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilProfileTreeNodeInfoTest.cs
===================================================================
diff -u -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilProfileTreeNodeInfoTest.cs (.../StochasticSoilProfileTreeNodeInfoTest.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/StochasticSoilProfileTreeNodeInfoTest.cs (.../StochasticSoilProfileTreeNodeInfoTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -57,7 +57,7 @@
var pipingSoilProfile = mocks.StrictMock(testName, 0, new[]
{
pipingSoilLayer
- }, 0);
+ }, SoilProfileType.SoilProfile2D, 0);
var stochasticSoilProfile = mocks.StrictMock(10.0, SoilProfileType.SoilProfile1D, 1234L);
stochasticSoilProfile.SoilProfile = pipingSoilProfile;
mocks.ReplayAll();
@@ -79,7 +79,7 @@
var pipingSoilProfile = mocks.StrictMock("", 0, new[]
{
pipingSoilLayer
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
var stochasticSoilProfile = mocks.StrictMock(10.0, SoilProfileType.SoilProfile1D, 1234L);
stochasticSoilProfile.SoilProfile = pipingSoilProfile;
mocks.ReplayAll();
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs
===================================================================
diff -u -r8b241983c8cf5bce0ef6c1251c426d5fb695c06b -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs (.../PipingCalculationsViewTest.cs) (revision 8b241983c8cf5bce0ef6c1251c426d5fb695c06b)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs (.../PipingCalculationsViewTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -453,14 +453,14 @@
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1);
+ }, SoilProfileType.SoilProfile1D, 1);
var pipingSoilProfile5 = new PipingSoilProfile("Profile 5", -10.0, new[]
{
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1);
+ }, SoilProfileType.SoilProfile1D, 1);
pipingFailureMechanism.StochasticSoilModels.Add(new StochasticSoilModel(1, "A", "B")
{
@@ -481,7 +481,7 @@
new PipingSoilLayer(-4.0),
new PipingSoilLayer(0.0),
new PipingSoilLayer(4.0)
- }, 2)
+ }, SoilProfileType.SoilProfile1D, 2)
}
}
});
@@ -501,7 +501,7 @@
new PipingSoilLayer(-5.0),
new PipingSoilLayer(-2.0),
new PipingSoilLayer(1.0)
- }, 1)
+ }, SoilProfileType.SoilProfile1D, 1)
},
new StochasticSoilProfile(0.7, SoilProfileType.SoilProfile1D, 2)
{
@@ -510,7 +510,7 @@
new PipingSoilLayer(-4.0),
new PipingSoilLayer(0.0),
new PipingSoilLayer(4.0)
- }, 2)
+ }, SoilProfileType.SoilProfile1D, 2)
}
}
});
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilDatabaseQueryBuilderTest.cs
===================================================================
diff -u -r045bb1ffbe520f780522bd6b4f6afe06c096d34c -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilDatabaseQueryBuilderTest.cs (.../SoilDatabaseQueryBuilderTest.cs) (revision 045bb1ffbe520f780522bd6b4f6afe06c096d34c)
+++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilDatabaseQueryBuilderTest.cs (.../SoilDatabaseQueryBuilderTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -65,17 +65,20 @@
{
// Setup
const string expectedQuery = "SELECT (" +
- "SELECT COUNT(DISTINCT s2.SP2D_ID) " +
+ "SELECT COUNT(DISTINCT sl1D.SP1D_ID) " +
"FROM Mechanism AS m " +
- "JOIN MechanismPointLocation AS mpl USING(ME_ID) " +
- "JOIN SoilProfile2D AS p2 USING(SP2D_ID) " +
- "JOIN SoilLayer2D AS s2 USING(SP2D_ID) " +
- "WHERE m.ME_Name = @ME_Name " +
- ") + ( " +
- "SELECT COUNT(DISTINCT p1.SP1D_ID) " +
- "FROM SoilProfile1D AS p1 " +
- "JOIN SoilLayer1D AS s1 " +
- "USING(SP1D_ID)" +
+ "JOIN Segment AS segment USING(ME_ID) "+
+ "JOIN StochasticSoilProfile ssp USING(SSM_ID) " +
+ "JOIN SoilLayer1D sl1D USING(SP1D_ID) " +
+ "WHERE m.ME_Name = @ME_Name" +
+ ") + (" +
+ "SELECT COUNT(DISTINCT sl2D.SP2D_ID) " +
+ "FROM Mechanism AS m " +
+ "JOIN Segment AS segment USING(ME_ID) " +
+ "JOIN StochasticSoilProfile ssp USING(SSM_ID) " +
+ "JOIN SoilLayer2D sl2D USING(SP2D_ID) " +
+ "JOIN MechanismPointLocation mpl USING(ME_ID) " +
+ "WHERE m.ME_Name = @ME_Name" +
") AS nrOfRows;";
// Call
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder1DTest.cs
===================================================================
diff -u -r10779bb6a6db2d00f4627b2bc190e7e35e1fee3e -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder1DTest.cs (.../SoilProfileBuilder1DTest.cs) (revision 10779bb6a6db2d00f4627b2bc190e7e35e1fee3e)
+++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder1DTest.cs (.../SoilProfileBuilder1DTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -44,6 +44,7 @@
// Assert
Assert.AreEqual(profileName, soilProfile.Name);
Assert.AreEqual(1, soilProfile.Layers.Count());
+ Assert.AreEqual(SoilProfileType.SoilProfile1D, soilProfile.SoilProfileType);
Assert.AreEqual(pipingSoilProfileId, soilProfile.PipingSoilProfileId);
Assert.AreEqual(top, soilProfile.Layers.ToArray()[0].Top);
Assert.AreEqual(bottom, soilProfile.Bottom);
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs
===================================================================
diff -u -r10779bb6a6db2d00f4627b2bc190e7e35e1fee3e -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs (.../SoilProfileBuilder2DTest.cs) (revision 10779bb6a6db2d00f4627b2bc190e7e35e1fee3e)
+++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs (.../SoilProfileBuilder2DTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -122,6 +122,7 @@
Assert.AreEqual(1, soilProfile.Layers.Count());
Assert.AreEqual(1.0, soilProfile.Layers.ToArray()[0].Top);
Assert.AreEqual(-1.0, soilProfile.Bottom);
+ Assert.AreEqual(SoilProfileType.SoilProfile2D, soilProfile.SoilProfileType);
Assert.AreEqual(pipingSoilProfileId, soilProfile.PipingSoilProfileId);
}
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/PipingSoilProfileReaderTest.cs
===================================================================
diff -u -r220a073b3d2066d57af048325e3ba37bb1340d0d -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/PipingSoilProfileReaderTest.cs (.../PipingSoilProfileReaderTest.cs) (revision 220a073b3d2066d57af048325e3ba37bb1340d0d)
+++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/PipingSoilProfileReaderTest.cs (.../PipingSoilProfileReaderTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -283,11 +283,13 @@
// Assert
Assert.AreEqual("Profile", profile.Name);
- Assert.AreEqual(3, profile.Layers.Count());
- CollectionAssert.AreEqual(Enumerable.Repeat(false, 3), profile.Layers.Select(l => l.IsAquifer));
- CollectionAssert.AreEqual(Enumerable.Repeat((double?) null, 3), profile.Layers.Select(l => l.AbovePhreaticLevel));
- CollectionAssert.AreEqual(Enumerable.Repeat((double?) null, 3), profile.Layers.Select(l => l.BelowPhreaticLevel));
- CollectionAssert.AreEqual(Enumerable.Repeat((double?) null, 3), profile.Layers.Select(l => l.DryUnitWeight));
+ const int expectedNumberOfLayers = 3;
+ Assert.AreEqual(expectedNumberOfLayers, profile.Layers.Count());
+ CollectionAssert.AreEqual(Enumerable.Repeat(false, expectedNumberOfLayers), profile.Layers.Select(l => l.IsAquifer));
+ IEnumerable nullValues = Enumerable.Repeat((double?) null, expectedNumberOfLayers).ToArray();
+ CollectionAssert.AreEqual(nullValues, profile.Layers.Select(l => l.AbovePhreaticLevel));
+ CollectionAssert.AreEqual(nullValues, profile.Layers.Select(l => l.BelowPhreaticLevel));
+ CollectionAssert.AreEqual(nullValues, profile.Layers.Select(l => l.DryUnitWeight));
}
}
@@ -526,14 +528,11 @@
// Assert
Assert.AreEqual(0, skipped);
- Assert.AreEqual(26, pipingSoilProfilesReader.Count);
- Assert.AreEqual(26, result.Count);
+ Assert.AreEqual(24, pipingSoilProfilesReader.Count);
+ Assert.AreEqual(24, result.Count);
CollectionAssert.AreEqual(new[]
{
- "AD640M00_Segment_36005_1D1",
- "AD640M00_Segment_36005_1D2",
"Segment_36005_1D1",
- "Segment_36005_1D10",
"Segment_36005_1D2",
"Segment_36005_1D3",
"Segment_36005_1D4",
@@ -542,6 +541,7 @@
"Segment_36005_1D7",
"Segment_36005_1D8",
"Segment_36005_1D9",
+ "Segment_36005_1D10",
"Segment_36006_1D1",
"Segment_36006_1D2",
"Segment_36006_1D3",
@@ -556,7 +556,7 @@
"Segment_36007_1D6",
"Segment_36007_1D7",
"Segment_36007_1D8"
- }, result.Select(p => p.Name));
+ }, result.Select(p => p.Name).ToArray());
CollectionAssert.AreEqual(new[]
{
@@ -576,8 +576,6 @@
-45,
-45,
-45,
- -45,
- -45,
-52,
-52,
-52,
@@ -586,14 +584,11 @@
-21.25,
-21,
-21
- }, result.Select(p => p.Bottom));
+ }, result.Select(p => p.Bottom).ToArray());
CollectionAssert.AreEqual(new[]
{
- 9,
- 7,
8,
- 3,
6,
6,
5,
@@ -602,6 +597,7 @@
4,
4,
3,
+ 3,
7,
7,
7,
@@ -616,39 +612,39 @@
4,
2,
3
- }, result.Select(p => p.Layers.Count()));
+ }, result.Select(p => p.Layers.Count()).ToArray());
- var firstProfile = result.FirstOrDefault(l => l.Name == "AD640M00_Segment_36005_1D1");
+ var firstProfile = result.FirstOrDefault(l => l.Name == "Segment_36005_1D1");
Assert.NotNull(firstProfile);
var expectedFirstProfileLayersTops = new[]
{
- 5.9075,
- 3.250,
- 2.750,
- 1.250,
+ 3.25,
+ 2.75,
+ 1.25,
1.0,
-2.5,
- -13,
- -17,
- -25,
+ -13.0,
+ -17.0,
+ -25.0
};
- CollectionAssert.AllItemsAreUnique(firstProfile.Layers.Select(l => l.Top));
- CollectionAssert.AreEqual(expectedFirstProfileLayersTops, firstProfile.Layers.Select(l => l.Top), new DoubleWithToleranceComparer(1e-6));
+ var layerTops = firstProfile.Layers.Select(l => l.Top).ToArray();
+ CollectionAssert.AllItemsAreUnique(layerTops);
+ CollectionAssert.AreEqual(expectedFirstProfileLayersTops, layerTops, new DoubleWithToleranceComparer(1e-6));
- var secondProfile = result.FirstOrDefault(l => l.Name == "AD640M00_Segment_36005_1D2");
+ var secondProfile = result.FirstOrDefault(l => l.Name == "Segment_36005_1D2");
Assert.NotNull(secondProfile);
var expectedSecondProfileLayersTops = new[]
{
- 5.9075,
3.25,
-0.5,
-0.75,
-13,
-17,
-25,
};
- CollectionAssert.AllItemsAreUnique(secondProfile.Layers.Select(l => l.Top));
- CollectionAssert.AreEqual(expectedSecondProfileLayersTops, secondProfile.Layers.Select(l => l.Top), new DoubleWithToleranceComparer(1e-6));
+ var layer2Tops = secondProfile.Layers.Select(l => l.Top).ToArray();
+ CollectionAssert.AllItemsAreUnique(layer2Tops);
+ CollectionAssert.AreEqual(expectedSecondProfileLayersTops, layer2Tops, new DoubleWithToleranceComparer(1e-6));
}
}
}
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/StochasticSoilProfileProbabilityTest.cs
===================================================================
diff -u -r3bf7e84ac84de7dd0be38be7e9f2372878e733f6 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/StochasticSoilProfileProbabilityTest.cs (.../StochasticSoilProfileProbabilityTest.cs) (revision 3bf7e84ac84de7dd0be38be7e9f2372878e733f6)
+++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/StochasticSoilProfileProbabilityTest.cs (.../StochasticSoilProfileProbabilityTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -21,7 +21,7 @@
using NUnit.Framework;
using Ringtoets.Piping.Data;
-using Ringtoets.Piping.IO.SoilProfile;
+using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.IO.Test.SoilProfile
{
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/StochasticSoilProfileReaderTest.cs
===================================================================
diff -u -rcdc41931db8cd6fbebe910c08d315d1b7066a6d2 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/StochasticSoilProfileReaderTest.cs (.../StochasticSoilProfileReaderTest.cs) (revision cdc41931db8cd6fbebe910c08d315d1b7066a6d2)
+++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/StochasticSoilProfileReaderTest.cs (.../StochasticSoilProfileReaderTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -9,6 +9,8 @@
using Ringtoets.Piping.IO.Exceptions;
using Ringtoets.Piping.IO.Properties;
using Ringtoets.Piping.IO.SoilProfile;
+using Ringtoets.Piping.Primitives;
+
using UtilsResources = Core.Common.Utils.Properties.Resources;
namespace Ringtoets.Piping.IO.Test.SoilProfile
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/test-data/PipingSoilProfilesReader/combined1d2d.soil
===================================================================
diff -u -rd514ce187a1ce571355fd92ca1edf822d943ba39 -rbf334f50530164badedba45a78f3aab857ae1bf6
Binary files differ
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/test-data/PipingSoilProfilesReader/incorrectValue2dProperty.soil
===================================================================
diff -u -r41d06d91a2ef710ad07b3f474f190400751e09b8 -rbf334f50530164badedba45a78f3aab857ae1bf6
Binary files differ
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/test-data/PipingSoilProfilesReader/invalidBottom1dProfile.soil
===================================================================
diff -u -r2da851fd63f93a1e0684874c0011b69c97506472 -rbf334f50530164badedba45a78f3aab857ae1bf6
Binary files differ
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/test-data/PipingSoilProfilesReader/invalidTop1dProfile.soil
===================================================================
diff -u -r2da851fd63f93a1e0684874c0011b69c97506472 -rbf334f50530164badedba45a78f3aab857ae1bf6
Binary files differ
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/test-data/PipingSoilProfilesReader/vertical2dGeometry.soil
===================================================================
diff -u -r41d06d91a2ef710ad07b3f474f190400751e09b8 -rbf334f50530164badedba45a78f3aab857ae1bf6
Binary files differ
Index: Ringtoets/Piping/test/Ringtoets.Piping.InputParameterCalculation.Test/InputParameterCalculationServiceTest.cs
===================================================================
diff -u -r3721b5bb1ae327907884a90d1a9bd300042e0540 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.InputParameterCalculation.Test/InputParameterCalculationServiceTest.cs (.../InputParameterCalculationServiceTest.cs) (revision 3721b5bb1ae327907884a90d1a9bd300042e0540)
+++ Ringtoets/Piping/test/Ringtoets.Piping.InputParameterCalculation.Test/InputParameterCalculationServiceTest.cs (.../InputParameterCalculationServiceTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -33,7 +33,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
// Call
PipingInput input = invalidPipingCalculation.InputParameters;
@@ -64,7 +64,7 @@
{
IsAquifer = false
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
PipingInput input = new PipingInput(new GeneralPipingInput())
{
Index: Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/PipingCalculatorInputTest.cs
===================================================================
diff -u -r10779bb6a6db2d00f4627b2bc190e7e35e1fee3e -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/PipingCalculatorInputTest.cs (.../PipingCalculatorInputTest.cs) (revision 10779bb6a6db2d00f4627b2bc190e7e35e1fee3e)
+++ Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/PipingCalculatorInputTest.cs (.../PipingCalculatorInputTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -41,7 +41,7 @@
{
IsAquifer = true
}
- }, 0);
+ }, SoilProfileType.SoilProfile1D, 0);
var input = new PipingCalculatorInput(
volumetricWeightOfWaterValue,
Index: Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/PipingCalculatorTest.cs
===================================================================
diff -u -r5b63cfab474523f97be999403eb4906a0c376a3d -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/PipingCalculatorTest.cs (.../PipingCalculatorTest.cs) (revision 5b63cfab474523f97be999403eb4906a0c376a3d)
+++ Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/PipingCalculatorTest.cs (.../PipingCalculatorTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -308,7 +308,7 @@
SoilProfile = new PipingSoilProfile(String.Empty, bottom, new[]
{
new PipingSoilLayer(top)
- }, 0)
+ }, SoilProfileType.SoilProfile1D, 0)
}.AsRealInput();
var calculation = new PipingCalculator(input, PipingSubCalculatorFactory.Instance);
@@ -331,7 +331,7 @@
SoilProfile = new PipingSoilProfile(String.Empty, -1.0, new[]
{
new PipingSoilLayer(0)
- }, 0)
+ }, SoilProfileType.SoilProfile1D, 0)
}.AsRealInput();
var calculation = new PipingCalculator(input, PipingSubCalculatorFactory.Instance);
Index: Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/PipingProfileCreatorTest.cs
===================================================================
diff -u -r10779bb6a6db2d00f4627b2bc190e7e35e1fee3e -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/PipingProfileCreatorTest.cs (.../PipingProfileCreatorTest.cs) (revision 10779bb6a6db2d00f4627b2bc190e7e35e1fee3e)
+++ Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/PipingProfileCreatorTest.cs (.../PipingProfileCreatorTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -32,7 +32,7 @@
DryUnitWeight = dryUnitWeight
},
};
- var soilProfile = new PipingSoilProfile(String.Empty, expectedBottom, layers, pipingSoilProfileId);
+ var soilProfile = new PipingSoilProfile(String.Empty, expectedBottom, layers, SoilProfileType.SoilProfile1D, pipingSoilProfileId);
// Call
PipingProfile actual = PipingProfileCreator.Create(soilProfile);
@@ -74,7 +74,7 @@
new PipingSoilLayer(expectedTopC)
};
- var soilProfile = new PipingSoilProfile(String.Empty, expectedBottom, layers, pipingSoilProfileId);
+ var soilProfile = new PipingSoilProfile(String.Empty, expectedBottom, layers, SoilProfileType.SoilProfile1D, pipingSoilProfileId);
// Call
PipingProfile actual = PipingProfileCreator.Create(soilProfile);
@@ -117,7 +117,7 @@
new PipingSoilLayer(expectedTopB),
new PipingSoilLayer(expectedTopC)
};
- var soilProfile = new PipingSoilProfile(string.Empty, expectedBottom, layers, pipingSoilProfileId);
+ var soilProfile = new PipingSoilProfile(string.Empty, expectedBottom, layers, SoilProfileType.SoilProfile1D, pipingSoilProfileId);
// Precondition
CollectionAssert.AreNotEqual(layers, layers.OrderByDescending(l => l.Top), "Layer collection should not be in descending order by the Top property.");
@@ -171,7 +171,7 @@
BelowPhreaticLevel = levelC
}
};
- var soilProfile = new PipingSoilProfile(string.Empty, -2, layers, 0);
+ var soilProfile = new PipingSoilProfile(string.Empty, -2, layers, SoilProfileType.SoilProfile1D, 0);
// Call
PipingProfile actual = PipingProfileCreator.Create(soilProfile);
@@ -208,7 +208,7 @@
AbovePhreaticLevel = levelC
}
};
- var soilProfile = new PipingSoilProfile(string.Empty, -2, layers, 0);
+ var soilProfile = new PipingSoilProfile(string.Empty, -2, layers, SoilProfileType.SoilProfile1D, 0);
// Call
PipingProfile actual = PipingProfileCreator.Create(soilProfile);
@@ -245,7 +245,7 @@
DryUnitWeight = weightC
}
};
- var soilProfile = new PipingSoilProfile(string.Empty, -2, layers, 0);
+ var soilProfile = new PipingSoilProfile(string.Empty, -2, layers, SoilProfileType.SoilProfile1D, 0);
// Call
PipingProfile actual = PipingProfileCreator.Create(soilProfile);
Index: Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.TestUtil/TestPipingInput.cs
===================================================================
diff -u -r10779bb6a6db2d00f4627b2bc190e7e35e1fee3e -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.TestUtil/TestPipingInput.cs (.../TestPipingInput.cs) (revision 10779bb6a6db2d00f4627b2bc190e7e35e1fee3e)
+++ Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.TestUtil/TestPipingInput.cs (.../TestPipingInput.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -106,7 +106,7 @@
},
new PipingSoilLayer(2),
new PipingSoilLayer(-1),
- }, 1234L);
+ }, SoilProfileType.SoilProfile1D, 1234L);
}
private RingtoetsPipingSurfaceLine CreateValidSurfaceLine()
Index: Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.TestUtil/TestPipingSoilProfile.cs
===================================================================
diff -u -rd82fa09fe9ae053ce7702ba89ef23ae029640d1b -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.TestUtil/TestPipingSoilProfile.cs (.../TestPipingSoilProfile.cs) (revision d82fa09fe9ae053ce7702ba89ef23ae029640d1b)
+++ Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.TestUtil/TestPipingSoilProfile.cs (.../TestPipingSoilProfile.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -21,6 +21,6 @@
{
IsAquifer = true
}
- }, 0) {}
+ }, SoilProfileType.SoilProfile1D, 0) {}
}
}
\ No newline at end of file
Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSoilProfilesImporterTest.cs
===================================================================
diff -u -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 -rbf334f50530164badedba45a78f3aab857ae1bf6
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSoilProfilesImporterTest.cs (.../PipingSoilProfilesImporterTest.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSoilProfilesImporterTest.cs (.../PipingSoilProfilesImporterTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6)
@@ -245,7 +245,7 @@
// Assert
Assert.IsTrue(importResult);
- var expectedProfiles = 26;
+ var expectedProfiles = 24;
var expectedModels = 3;
var expectedProgressMessages = new List
@@ -302,19 +302,17 @@
// Precondition
importer.Import(context, validFilePath);
- var names = context.FailureMechanism.StochasticSoilModels.Select(ssm => ssm.Name);
+ var alreadyImportedSoilModelNames = context.FailureMechanism.StochasticSoilModels.Select(ssm => ssm.Name);
// Call
Action call = () => importResult = importer.Import(context, validFilePath);
// Assert
- var expectedLogMessages = names.Select(name => string.Format("Het stochastisch ondergrondmodel '{0}' bestaat al in het faalmechanisme.", name)).ToList();
- expectedLogMessages.Add(String.Format("Het uitgelezen profiel '{0}' wordt niet gebruikt in een van de stochastische ondergrondmodellen.", "Segment_36005_1D2"));
- expectedLogMessages.Add(String.Format("Het uitgelezen profiel '{0}' wordt niet gebruikt in een van de stochastische ondergrondmodellen.", "Segment_36005_1D3"));
- TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, expectedLogMessages.Count);
+ var expectedLogMessages = alreadyImportedSoilModelNames.Select(name => string.Format("Het stochastisch ondergrondmodel '{0}' bestaat al in het faalmechanisme.", name)).ToArray();
+ TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, expectedLogMessages.Length);
Assert.IsTrue(importResult);
- Assert.AreEqual(35*2, progress);
+ Assert.AreEqual(33*2, progress);
mockRepository.VerifyAll();
}
@@ -395,7 +393,7 @@
// Assert
Assert.IsTrue(importResult);
- Assert.AreEqual(36, progress);
+ Assert.AreEqual(34, progress);
}
[Test]
@@ -571,12 +569,8 @@
Action call = () => importResult = importer.Import(context, validFilePath);
// Assert
- var expectedLogMessages = new[]
- {
- "Het uitgelezen profiel 'Profile' wordt niet gebruikt in een van de stochastische ondergrondmodellen.",
- "De som van de kans van voorkomen in het stochastich ondergrondmodel 'Name' is niet gelijk aan 100%."
- };
- TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2);
+ var expectedLogMessages = "De som van de kans van voorkomen in het stochastich ondergrondmodel 'Name' is niet gelijk aan 100%.";
+ TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessages, 1);
Assert.AreEqual(1, failureMechanism.StochasticSoilModels.Count);
Assert.IsTrue(importResult);