Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs =================================================================== diff -u -re2892835ceb1c916be9a9122ba372858f20b981a -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 --- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e2892835ceb1c916be9a9122ba372858f20b981a) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) @@ -1564,14 +1564,14 @@ } /// - /// Looks up a localized string similar to BEGIN TRANSACTION; - ///CREATE TABLE "TimeIntegrationSettings" ( - /// "LocationID" INTEGER NOT NULL, - /// "CalculationTypeID" INTEGER NOT NULL, - /// "TimeIntegrationSchemeID" INTEGER NOT NULL, - /// CONSTRAINT timeintegrationsettings_pk PRIMARY KEY ("LocationID", "CalculationTypeID"), - /// CONSTRAINT calculationtypes_timeintegrationsettings_fk FOREIGN KEY ("CalculationTypeID") REFERENCES CalculationTypes ("CalculationTypeID") ON DELETE NO ACTION ON UPDATE NO ACTION - ///); + /// Looks up a localized string similar to BEGIN TRANSACTION; + ///CREATE TABLE "TimeIntegrationSettings" ( + /// "LocationID" INTEGER NOT NULL, + /// "CalculationTypeID" INTEGER NOT NULL, + /// "TimeIntegrationSchemeID" INTEGER NOT NULL, + /// CONSTRAINT timeintegrationsettings_pk PRIMARY KEY ("LocationID", "CalculationTypeID"), + /// CONSTRAINT calculationtypes_timeintegrationsettings_fk FOREIGN KEY ("CalculationTypeID") REFERENCES CalculationTypes ("CalculationTypeID") ON DELETE NO ACTION ON UPDATE NO ACTION + ///); ///CREATE TABLE "Numeri [rest of string was truncated]";. /// public static string settings_schema { @@ -1659,15 +1659,6 @@ } /// - /// Looks up a localized string similar to Parameter '{0}' is niet verschoven lognormaal verdeeld.. - /// - public static string SoilLayer_Stochastic_parameter_0_has_no_shifted_lognormal_distribution { - get { - return ResourceManager.GetString("SoilLayer_Stochastic_parameter_0_has_no_shifted_lognormal_distribution", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Coördinaat van een punt bevat ongeldige waarde.. /// public static string SoilLayer2DGeometryReader_Could_not_parse_point_location { @@ -1768,15 +1759,33 @@ } /// - /// Looks up a localized string similar to Parameter '{0}' is niet lognormaal verdeeld.. + /// Looks up a localized string similar to Parameter '{0}' moet verschoven lognormaal verdeeld zijn.. /// - public static string Stochastic_parameter_0_has_no_lognormal_distribution { + public static string Stochastic_parameter_0_has_no_shifted_lognormal_distribution { get { - return ResourceManager.GetString("Stochastic_parameter_0_has_no_lognormal_distribution", resourceCulture); + return ResourceManager.GetString("Stochastic_parameter_0_has_no_shifted_lognormal_distribution", resourceCulture); } } /// + /// Looks up a localized string similar to Parameter '{0}' moet lognormaal verdeeld zijn.. + /// + public static string Stochastic_parameter_0_must_be_a_lognormal_distribution { + get { + return ResourceManager.GetString("Stochastic_parameter_0_must_be_a_lognormal_distribution", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameter '{0}' moet lognormaal verdeeld zijn met een verschuiving gelijk aan 0.. + /// + public static string Stochastic_parameter_0_must_be_a_lognormal_distribution_with_zero_shift { + get { + return ResourceManager.GetString("Stochastic_parameter_0_must_be_a_lognormal_distribution_with_zero_shift", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Kon geen stochastische ondergrondmodellen verkrijgen uit de database.. /// public static string StochasticSoilModelDatabaseReader_Failed_to_read_database { Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx =================================================================== diff -u -re2892835ceb1c916be9a9122ba372858f20b981a -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 --- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision e2892835ceb1c916be9a9122ba372858f20b981a) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) @@ -850,14 +850,14 @@ Het lezen van de ondergrondschematisatie '{0}' is mislukt. Geen geldige waarde in kolom '{1}'. - - Parameter '{0}' is niet lognormaal verdeeld. + + Parameter '{0}' moet lognormaal verdeeld zijn. De ondergrondschematisatie van het type '{0}' is niet ondersteund. Alleen ondergrondschematisaties van het type '{1}' of '{2}' zijn ondersteund. - - Parameter '{0}' is niet verschoven lognormaal verdeeld. + + Parameter '{0}' moet verschoven lognormaal verdeeld zijn. Is aquifer @@ -877,4 +877,7 @@ De bestandsmap bestaat niet. + + Parameter '{0}' moet lognormaal verdeeld zijn met een verschuiving gelijk aan 0. + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs =================================================================== diff -u -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs (.../DistributionHelper.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs (.../DistributionHelper.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) @@ -43,32 +43,39 @@ /// is null. /// Thrown when the parameter is not a /// log normal distribution with a zero shift. - public static void ValidateIsNonShiftedLogNormal(long? distributionType, double shift, string parameterName) + public static void ValidateLogNormalDistribution(long? distributionType, double shift, string parameterName) { if (parameterName == null) { throw new ArgumentNullException(nameof(parameterName)); } - if (distributionType.HasValue && (distributionType.Value != SoilLayerConstants.LogNormalDistributionValue - || Math.Abs(shift) > tolerance)) + if (distributionType.HasValue) { - throw new ImportedDataTransformException(string.Format( - Resources.Stochastic_parameter_0_has_no_lognormal_distribution, - parameterName)); + if (distributionType.Value != SoilLayerConstants.LogNormalDistributionValue) + throw new ImportedDataTransformException(string.Format( + Resources.Stochastic_parameter_0_must_be_a_lognormal_distribution, + parameterName)); + + if (Math.Abs(shift) > tolerance) + { + throw new ImportedDataTransformException(string.Format( + Resources.Stochastic_parameter_0_must_be_a_lognormal_distribution_with_zero_shift, + parameterName)); + } } } /// - /// Validates that the distribution is a log normal distribution. + /// Validates that the distribution is a (shifted) log normal distribution. /// /// The distribution type. /// The name of the parameter to be validated. /// Thrown when /// is null. /// Thrown when the parameter is not a /// log normal distribution. - public static void ValidateIsLogNormal(long? distributionType, string parameterName) + public static void ValidateShiftedLogNormalDistribution(long? distributionType, string parameterName) { if (parameterName == null) { @@ -78,7 +85,7 @@ if (distributionType.HasValue && distributionType != SoilLayerConstants.LogNormalDistributionValue) { throw new ImportedDataTransformException(string.Format( - Resources.SoilLayer_Stochastic_parameter_0_has_no_shifted_lognormal_distribution, + Resources.Stochastic_parameter_0_has_no_shifted_lognormal_distribution, parameterName)); } } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs =================================================================== diff -u -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs (.../DistributionHelperTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs (.../DistributionHelperTest.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) @@ -30,15 +30,15 @@ public class DistributionHelperTest { [Test] - public void ValidateIsNonShiftedLogNormal_ParameterNameNull_ThrowsArgumentNullException() + public void ValidateLogNormalDistribution_ParameterNameNull_ThrowsArgumentNullException() { // Setup var random = new Random(21); long distributionType = random.Next(); double shift = random.NextDouble(); // Call - TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(distributionType, + TestDelegate call = () => DistributionHelper.ValidateLogNormalDistribution(distributionType, shift, null); @@ -48,34 +48,54 @@ } [Test] - [TestCase(-1, 0)] - [TestCase(3, 10)] - public void ValidateIsNonShiftedLogNormal_InvalidDistributionProperties_ThrowsImportedDataException( - long distributionType, - double shift) + public void ValidateLogNormalDistribution_InvalidDistributionType_ThrowsImportedDataException() { // Setup + const long distributionType = -1; const string parameterName = "Just a name"; + var random = new Random(21); + double shift = random.NextDouble(); + // Call - TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(distributionType, + TestDelegate call = () => DistributionHelper.ValidateLogNormalDistribution(distributionType, shift, parameterName); // Assert var exception = Assert.Throws(call); - Assert.AreEqual($"Parameter '{parameterName}' is niet lognormaal verdeeld.", exception.Message); + Assert.AreEqual($"Parameter '{parameterName}' moet lognormaal verdeeld zijn.", exception.Message); } [Test] - public void ValidateIsNonShiftedLogNormal_ValidDistribution_DoesNotThrowException() + public void ValidateLogNormalDistribution_ShiftNonZero_ThrowsImportedDataTransformException() { // Setup - const long distributionType = 3; + const long distributionType = SoilLayerConstants.LogNormalDistributionValue; + const string parameterName = "Just a name"; + + var random = new Random(21); + double shift = random.NextDouble(); + + // Call + TestDelegate call = () => DistributionHelper.ValidateLogNormalDistribution(distributionType, + shift, + parameterName); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual($"Parameter '{parameterName}' moet lognormaal verdeeld zijn met een verschuiving gelijk aan 0.", exception.Message); + } + + [Test] + public void ValidateLogNormalDistribution_ValidDistribution_DoesNotThrowException() + { + // Setup + const long distributionType = SoilLayerConstants.LogNormalDistributionValue; const double shift = 0; // Call - TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(distributionType, + TestDelegate call = () => DistributionHelper.ValidateLogNormalDistribution(distributionType, shift, string.Empty); @@ -84,15 +104,15 @@ } [Test] - public void ValidateIsNonShiftedLogNormal_DistributionTypeNull_DoesNotThrowException() + public void ValidateLogNormalDistribution_DistributionTypeNull_DoesNotThrowException() { // Setup var random = new Random(21); double shift = random.NextDouble(); const string parameterName = "Just a name"; // Call - TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(null, + TestDelegate call = () => DistributionHelper.ValidateLogNormalDistribution(null, shift, parameterName); @@ -101,60 +121,60 @@ } [Test] - public void ValidateIsLogNormal_ParameterNameNull_ThrowsArgumentNullException() + public void ValidateShiftedLogNormalDistribution_ParameterNameNull_ThrowsArgumentNullException() { // Setup var random = new Random(21); long distributionType = random.Next(); // Call - TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(distributionType, - null); + TestDelegate call = () => DistributionHelper.ValidateShiftedLogNormalDistribution(distributionType, + null); // Assert var exception = Assert.Throws(call); Assert.AreEqual("parameterName", exception.ParamName); } [Test] - public void ValidateIsLogNormal_InvalidDistributionProperties_ThrowsImportedDataException() + public void ValidateShiftedLogNormalDistribution_InvalidDistributionType_ThrowsImportedDataException() { // Setup const long invalidDistributionType = -1; const string parameterName = "Just a name"; // Call - TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(invalidDistributionType, - parameterName); + TestDelegate call = () => DistributionHelper.ValidateShiftedLogNormalDistribution(invalidDistributionType, + parameterName); // Assert var exception = Assert.Throws(call); - Assert.AreEqual($"Parameter '{parameterName}' is niet verschoven lognormaal verdeeld.", exception.Message); + Assert.AreEqual($"Parameter '{parameterName}' moet verschoven lognormaal verdeeld zijn.", exception.Message); } [Test] - public void ValidateIsLogNormal_ValidDistribution_DoesNotThrowException() + public void ValidateShiftedLogNormalDistribution_ValidDistribution_DoesNotThrowException() { // Setup - const long distributionType = 3; + const long distributionType = SoilLayerConstants.LogNormalDistributionValue; // Call - TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(distributionType, - string.Empty); + TestDelegate call = () => DistributionHelper.ValidateShiftedLogNormalDistribution(distributionType, + string.Empty); // Assert Assert.DoesNotThrow(call); } [Test] - public void ValidateIsLogNormal_DistributionTypeNull_DoesNotThrowException() + public void ValidateShiftedLogNormalDistribution_DistributionTypeNull_DoesNotThrowException() { // Setup const string parameterName = "Just a name"; // Call - TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(null, - parameterName); + TestDelegate call = () => DistributionHelper.ValidateShiftedLogNormalDistribution(null, + parameterName); // Assert Assert.DoesNotThrow(call); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsPreconsolidationStressTransformer.cs =================================================================== diff -u -r31f59cfc48a6839453e372572d03ecc6ae6f0d00 -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsPreconsolidationStressTransformer.cs (.../MacroStabilityInwardsPreconsolidationStressTransformer.cs) (revision 31f59cfc48a6839453e372572d03ecc6ae6f0d00) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsPreconsolidationStressTransformer.cs (.../MacroStabilityInwardsPreconsolidationStressTransformer.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) @@ -27,7 +27,6 @@ using Ringtoets.Common.IO.SoilProfile; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; using Ringtoets.MacroStabilityInwards.IO.Properties; -using RingtoetsCommonIOResources = Ringtoets.Common.IO.Properties.Resources; namespace Ringtoets.MacroStabilityInwards.IO.SoilProfiles { @@ -57,7 +56,7 @@ throw new ArgumentNullException(nameof(preconsolidationStress)); } - DistributionHelper.ValidateIsNonShiftedLogNormal(preconsolidationStress.StressDistributionType, + DistributionHelper.ValidateLogNormalDistribution(preconsolidationStress.StressDistributionType, preconsolidationStress.StressShift, Resources.PreconsolidationStress_DisplayName); @@ -74,12 +73,6 @@ return new MacroStabilityInwardsPreconsolidationStress(location, distribution); } - catch (ArgumentOutOfRangeException e) - { - string errorMessage = string.Format(RingtoetsCommonIOResources.Stochastic_parameter_0_has_no_lognormal_distribution, - Resources.PreconsolidationStress_DisplayName); - throw new ImportedDataTransformException(errorMessage, e); - } catch (ArgumentException e) { throw new ImportedDataTransformException(e.Message, e); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilLayerTransformer.cs =================================================================== diff -u -r53d2734c780c83d29b435303f9d82bcbaac94fe7 -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilLayerTransformer.cs (.../MacroStabilityInwardsSoilLayerTransformer.cs) (revision 53d2734c780c83d29b435303f9d82bcbaac94fe7) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilLayerTransformer.cs (.../MacroStabilityInwardsSoilLayerTransformer.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) @@ -261,34 +261,34 @@ /// stochastic parameters is not defined as log normal or is shifted when it should not be. private static void ValidateStochasticParameters(SoilLayerBase soilLayer) { - DistributionHelper.ValidateIsLogNormal(soilLayer.AbovePhreaticLevelDistributionType, + DistributionHelper.ValidateShiftedLogNormalDistribution(soilLayer.AbovePhreaticLevelDistributionType, Resources.SoilLayerData_AbovePhreaticLevelDistribution_Description); - DistributionHelper.ValidateIsLogNormal( + DistributionHelper.ValidateShiftedLogNormalDistribution( soilLayer.BelowPhreaticLevelDistributionType, Resources.SoilLayerData_BelowPhreaticLevelDistribution_DisplayName); - DistributionHelper.ValidateIsNonShiftedLogNormal( + DistributionHelper.ValidateLogNormalDistribution( soilLayer.CohesionDistributionType, soilLayer.CohesionShift, Resources.SoilLayerData_CohesionDistribution_DisplayName); - DistributionHelper.ValidateIsNonShiftedLogNormal( + DistributionHelper.ValidateLogNormalDistribution( soilLayer.FrictionAngleDistributionType, soilLayer.FrictionAngleShift, Resources.SoilLayerData_FrictionAngleDistribution_DisplayName); - DistributionHelper.ValidateIsNonShiftedLogNormal( + DistributionHelper.ValidateLogNormalDistribution( soilLayer.ShearStrengthRatioDistributionType, soilLayer.ShearStrengthRatioShift, Resources.SoilLayerData_ShearStrengthRatioDistribution_DisplayName); - DistributionHelper.ValidateIsNonShiftedLogNormal( + DistributionHelper.ValidateLogNormalDistribution( soilLayer.StrengthIncreaseExponentDistributionType, soilLayer.StrengthIncreaseExponentShift, Resources.SoilLayerData_StrengthIncreaseExponentDistribution_DisplayName); - DistributionHelper.ValidateIsNonShiftedLogNormal( + DistributionHelper.ValidateLogNormalDistribution( soilLayer.PopDistributionType, soilLayer.PopShift, Resources.SoilLayerData_PopDistribution_DisplayName); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsPreconsolidationStressTransformerTest.cs =================================================================== diff -u -rd2548d8c57adf0df3e06c5e7ceb3eb9086d84cb2 -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsPreconsolidationStressTransformerTest.cs (.../MacroStabilityInwardsPreconsolidationStressTransformerTest.cs) (revision d2548d8c57adf0df3e06c5e7ceb3eb9086d84cb2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsPreconsolidationStressTransformerTest.cs (.../MacroStabilityInwardsPreconsolidationStressTransformerTest.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) @@ -101,38 +101,47 @@ // Assert var exception = Assert.Throws(call); - Assert.AreEqual("Parameter 'Grensspanning' is niet lognormaal verdeeld.", exception.Message); - Assert.IsInstanceOf(exception.InnerException); + Exception innerException = exception.InnerException; + Assert.IsInstanceOf(innerException); + Assert.AreEqual(innerException.Message, exception.Message); } [Test] - [TestCaseSource(nameof(GetInvalidStochastConfiguration))] - public void Transform_InvalidStochasticDistributionProperties_ThrowsImportedDataTransformException( - PreconsolidationStress preconsolidationStress) + public void Transform_InvalidStochasticDistributionType_ThrowsImportedDataTransformException() { + // Setup + var random = new Random(21); + var preconsolidationStress = new PreconsolidationStress + { + StressDistributionType = random.Next(3, int.MaxValue), + StressShift = 0 + }; + // Call TestDelegate call = () => MacroStabilityInwardsPreconsolidationStressTransformer.Transform(preconsolidationStress); // Assert var exception = Assert.Throws(call); - Assert.AreEqual("Parameter 'Grensspanning' is niet lognormaal verdeeld.", exception.Message); + Assert.AreEqual("Parameter 'Grensspanning' moet lognormaal verdeeld zijn.", exception.Message); } - private static IEnumerable GetInvalidStochastConfiguration() + [Test] + public void Transform_InvalidStochasticDistributionShift_ThrowsImportedDataTransformException() { + // Setup var random = new Random(21); - - yield return new TestCaseData(new PreconsolidationStress + var preconsolidationStress = new PreconsolidationStress { - StressDistributionType = random.Next(3, int.MaxValue), - StressShift = 0 - }).SetName("Invalid DistributionType"); - - yield return new TestCaseData(new PreconsolidationStress - { StressDistributionType = 3, StressShift = random.NextDouble() - }).SetName("Invalid Shift"); + }; + + // Call + TestDelegate call = () => MacroStabilityInwardsPreconsolidationStressTransformer.Transform(preconsolidationStress); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("Parameter 'Grensspanning' moet lognormaal verdeeld zijn met een verschuiving gelijk aan 0.", exception.Message); } private static IEnumerable GetPreconsolidationStressInvalidDistributionValues() Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilLayerTransformerTest.cs =================================================================== diff -u -r1fb8f412abb01d504e4f546dfed0ca365c1984ae -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilLayerTransformerTest.cs (.../MacroStabilityInwardsSoilLayerTransformerTest.cs) (revision 1fb8f412abb01d504e4f546dfed0ca365c1984ae) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilLayerTransformerTest.cs (.../MacroStabilityInwardsSoilLayerTransformerTest.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) @@ -298,22 +298,34 @@ // Assert Exception exception = Assert.Throws(test); - Assert.AreEqual($"Parameter '{parameter}' is niet verschoven lognormaal verdeeld.", exception.Message); + Assert.AreEqual($"Parameter '{parameter}' moet verschoven lognormaal verdeeld zijn.", exception.Message); } [Test] - [TestCaseSource(nameof(IncorrectNonShiftedLogNormalDistributionsSoilLayer1D))] - public void SoilLayer1DTransform_IncorrectLogNormalDistribution_ThrowImportedDataTransformException(SoilLayer1D layer, string parameter) + [TestCaseSource(nameof(IncorrectNonShiftedLogNormalDistributionsTypeSoilLayer1D))] + public void SoilLayer1DTransform_IncorrectLogNormalDistributionType_ThrowImportedDataTransformException(SoilLayer1D layer, string parameter) { // Call TestDelegate test = () => MacroStabilityInwardsSoilLayerTransformer.Transform(layer); // Assert Exception exception = Assert.Throws(test); - Assert.AreEqual($"Parameter '{parameter}' is niet lognormaal verdeeld.", exception.Message); + Assert.AreEqual($"Parameter '{parameter}' moet lognormaal verdeeld zijn.", exception.Message); } [Test] + [TestCaseSource(nameof(IncorrectNonShiftedLogNormalDistributionsShiftSoilLayer1D))] + public void SoilLayer1DTransform_IncorrectLogNormalDistributionShift_ThrowImportedDataTransformException(SoilLayer1D layer, string parameter) + { + // Call + TestDelegate test = () => MacroStabilityInwardsSoilLayerTransformer.Transform(layer); + + // Assert + Exception exception = Assert.Throws(test); + Assert.AreEqual($"Parameter '{parameter}' moet lognormaal verdeeld zijn met een verschuiving gelijk aan 0.", exception.Message); + } + + [Test] public void SoilLayer2DTransform_SoilLayer2DNull_ThrowsArgumentNullException() { // Call @@ -497,7 +509,7 @@ } [Test] - [TestCaseSource(nameof(IncorrectShiftedLogNormalDistributionsSoilLayer2D))] + [TestCaseSource(nameof(IncorrectShiftedLogNormalDistributionsTypeSoilLayer2D))] public void SoilLayer2DTransform_IncorrectShiftedLogNormalDistribution_ThrowsImportedDataTransformException( SoilLayer2D layer, string parameter) { @@ -506,22 +518,34 @@ // Assert Exception exception = Assert.Throws(test); - Assert.AreEqual($"Parameter '{parameter}' is niet verschoven lognormaal verdeeld.", exception.Message); + Assert.AreEqual($"Parameter '{parameter}' moet verschoven lognormaal verdeeld zijn.", exception.Message); } [Test] - [TestCaseSource(nameof(IncorrectNonShiftedLogNormalDistributionsSoilLayer2D))] - public void SoilLayer2DTransform_IncorrectLogNormalDistribution_ThrowImportedDataTransformException(SoilLayer2D layer, string parameter) + [TestCaseSource(nameof(IncorrectNonShiftedLogNormalDistributionsTypeSoilLayer2D))] + public void SoilLayer2DTransform_IncorrectLogNormalDistributionType_ThrowImportedDataTransformException(SoilLayer2D layer, string parameter) { // Call TestDelegate test = () => MacroStabilityInwardsSoilLayerTransformer.Transform(layer); // Assert Exception exception = Assert.Throws(test); - Assert.AreEqual($"Parameter '{parameter}' is niet lognormaal verdeeld.", exception.Message); + Assert.AreEqual($"Parameter '{parameter}' moet lognormaal verdeeld zijn.", exception.Message); } [Test] + [TestCaseSource(nameof(IncorrectNonShiftedLogNormalDistributionsShiftSoilLayer2D))] + public void SoilLayer2DTransform_IncorrectLogNormalDistributionShift_ThrowImportedDataTransformException(SoilLayer2D layer, string parameter) + { + // Call + TestDelegate test = () => MacroStabilityInwardsSoilLayerTransformer.Transform(layer); + + // Assert + Exception exception = Assert.Throws(test); + Assert.AreEqual($"Parameter '{parameter}' moet lognormaal verdeeld zijn met een verschuiving gelijk aan 0.", exception.Message); + } + + [Test] [TestCaseSource(nameof(GetSoilLayerWithInvalidGeometry))] public void SoilLayer2DTransform_SoilLayer2DWithInvalidLoops_ThrowsImportedDataException(SoilLayer2D soilLayer) { @@ -702,107 +726,122 @@ return IncorrectShiftedLogNormalDistributions(() => new SoilLayer1D(0.0), nameof(SoilLayer1D)); } - private static IEnumerable IncorrectShiftedLogNormalDistributionsSoilLayer2D() + private static IEnumerable IncorrectShiftedLogNormalDistributionsTypeSoilLayer2D() { return IncorrectShiftedLogNormalDistributions(SoilLayer2DTestFactory.CreateSoilLayer2D, nameof(SoilLayer2D)); } private static IEnumerable IncorrectShiftedLogNormalDistributions(Func soilLayer, string typeName) { - const string testNameFormat = "{0}Transform_Incorrect{1}{{1}}_ThrowsImportedDataTransformException"; + const string testNameFormat = "{0}Transform_IncorrectDistribution{{1}}_ThrowsImportedDataTransformException"; SoilLayerBase invalidBelowPhreaticLevel = soilLayer(); invalidBelowPhreaticLevel.BelowPhreaticLevelDistributionType = -1; yield return new TestCaseData(invalidBelowPhreaticLevel, "Verzadigd gewicht") - .SetName(string.Format(testNameFormat, typeName, "Distribution")); + .SetName(string.Format(testNameFormat, typeName)); SoilLayerBase invalidAbovePhreaticLevel = soilLayer(); invalidAbovePhreaticLevel.AbovePhreaticLevelDistributionType = -1; yield return new TestCaseData(invalidAbovePhreaticLevel, "Onverzadigd gewicht") - .SetName(string.Format(testNameFormat, typeName, "Distribution")); + .SetName(string.Format(testNameFormat, typeName)); } #endregion #region Test Data: NonShifted Log Normal Distributions - private static IEnumerable IncorrectNonShiftedLogNormalDistributionsSoilLayer1D() + private static IEnumerable IncorrectNonShiftedLogNormalDistributionsTypeSoilLayer1D() { - return IncorrectNonShiftedLogNormalDistributions(() => new SoilLayer1D(0.0), nameof(SoilLayer1D)); + return IncorrectNonShiftedLogNormalDistributionsType(() => new SoilLayer1D(0.0), nameof(SoilLayer1D)); } - private static IEnumerable IncorrectNonShiftedLogNormalDistributionsSoilLayer2D() + private static IEnumerable IncorrectNonShiftedLogNormalDistributionsShiftSoilLayer1D() { - return IncorrectNonShiftedLogNormalDistributions(SoilLayer2DTestFactory.CreateSoilLayer2D, nameof(SoilLayer2D)); + return IncorrectNonShiftedLogNormalDistributionsShift(() => new SoilLayer1D(0.0), nameof(SoilLayer1D)); } - private static IEnumerable IncorrectNonShiftedLogNormalDistributions(Func soilLayer, string typeName) + private static IEnumerable IncorrectNonShiftedLogNormalDistributionsTypeSoilLayer2D() { - const string testNameFormat = "{0}Transform_Incorrect{1}{{1}}_ThrowsImportedDataTransformException"; - const long validDistributionType = SoilLayerConstants.LogNormalDistributionValue; - const double validShift = 0.0; + return IncorrectNonShiftedLogNormalDistributionsType(SoilLayer2DTestFactory.CreateSoilLayer2D, nameof(SoilLayer2D)); + } - SoilLayerBase invalidCohesionShift = soilLayer(); - invalidCohesionShift.CohesionDistributionType = validDistributionType; - invalidCohesionShift.CohesionShift = -1; - yield return new TestCaseData(invalidCohesionShift, "Cohesie" - ).SetName(string.Format(testNameFormat, typeName, "Shift")); + private static IEnumerable IncorrectNonShiftedLogNormalDistributionsShiftSoilLayer2D() + { + return IncorrectNonShiftedLogNormalDistributionsShift(SoilLayer2DTestFactory.CreateSoilLayer2D, nameof(SoilLayer2D)); + } + private static IEnumerable IncorrectNonShiftedLogNormalDistributionsType(Func soilLayer, string typeName) + { + const string testNameFormat = "{0}Transform_IncorrectDistribution{{1}}_ThrowsImportedDataTransformException"; + const double validShift = 0.0; + SoilLayerBase invalidCohesionDistribution = soilLayer(); invalidCohesionDistribution.CohesionDistributionType = -1; invalidCohesionDistribution.CohesionShift = validShift; yield return new TestCaseData(invalidCohesionDistribution, "Cohesie" - ).SetName(string.Format(testNameFormat, typeName, "Distribution")); + ).SetName(string.Format(testNameFormat, typeName)); - SoilLayerBase invalidFrictionAngleShift = soilLayer(); - invalidFrictionAngleShift.FrictionAngleDistributionType = validDistributionType; - invalidFrictionAngleShift.FrictionAngleShift = -1; - yield return new TestCaseData(invalidFrictionAngleShift, "Wrijvingshoek" - ).SetName(string.Format(testNameFormat, typeName, "Shift")); - SoilLayerBase invalidFrictionAngleDistribution = soilLayer(); invalidFrictionAngleDistribution.FrictionAngleDistributionType = -1; invalidFrictionAngleDistribution.FrictionAngleShift = validShift; yield return new TestCaseData(invalidFrictionAngleDistribution, "Wrijvingshoek" - ).SetName(string.Format(testNameFormat, typeName, "Distribution")); + ).SetName(string.Format(testNameFormat, typeName)); - SoilLayerBase invalidShearStrengthRatioShift = soilLayer(); - invalidShearStrengthRatioShift.ShearStrengthRatioDistributionType = validDistributionType; - invalidShearStrengthRatioShift.ShearStrengthRatioShift = -1; - yield return new TestCaseData(invalidShearStrengthRatioShift, "Schuifsterkte ratio (S)" - ).SetName(string.Format(testNameFormat, typeName, "Shift")); - SoilLayerBase invalidShearStrengthRatioDistribution = soilLayer(); invalidShearStrengthRatioDistribution.ShearStrengthRatioDistributionType = -1; invalidShearStrengthRatioDistribution.ShearStrengthRatioShift = validShift; yield return new TestCaseData(invalidShearStrengthRatioDistribution, "Schuifsterkte ratio (S)" - ).SetName(string.Format(testNameFormat, typeName, "Distribution")); + ).SetName(string.Format(testNameFormat, typeName)); - SoilLayerBase invalidStrengthIncreaseExponentShift = soilLayer(); - invalidStrengthIncreaseExponentShift.StrengthIncreaseExponentDistributionType = validDistributionType; - invalidStrengthIncreaseExponentShift.StrengthIncreaseExponentShift = -1; - yield return new TestCaseData(invalidStrengthIncreaseExponentShift, "Sterkte toename exp (m)" - ).SetName(string.Format(testNameFormat, typeName, "Shift")); - SoilLayerBase invalidStrengthIncreaseExponentDistribution = soilLayer(); invalidStrengthIncreaseExponentDistribution.StrengthIncreaseExponentDistributionType = -1; invalidStrengthIncreaseExponentDistribution.StrengthIncreaseExponentShift = validShift; yield return new TestCaseData(invalidStrengthIncreaseExponentDistribution, "Sterkte toename exp (m)" - ).SetName(string.Format(testNameFormat, typeName, "Distribution")); + ).SetName(string.Format(testNameFormat, typeName)); - SoilLayerBase invalidPopShift = soilLayer(); - invalidPopShift.PopDistributionType = validDistributionType; - invalidPopShift.PopShift = -1; - yield return new TestCaseData(invalidPopShift, "POP" - ).SetName(string.Format(testNameFormat, typeName, "Shift")); - SoilLayerBase invalidPopDistribution = soilLayer(); invalidPopDistribution.PopDistributionType = -1; invalidPopDistribution.PopShift = validShift; yield return new TestCaseData(invalidPopDistribution, "POP" - ).SetName(string.Format(testNameFormat, typeName, "Distribution")); + ).SetName(string.Format(testNameFormat, typeName)); } + private static IEnumerable IncorrectNonShiftedLogNormalDistributionsShift(Func soilLayer, string typeName) + { + const string testNameFormat = "{0}Transform_IncorrectShift{{1}}_ThrowsImportedDataTransformException"; + const long validDistributionType = SoilLayerConstants.LogNormalDistributionValue; + + SoilLayerBase invalidCohesionShift = soilLayer(); + invalidCohesionShift.CohesionDistributionType = validDistributionType; + invalidCohesionShift.CohesionShift = -1; + yield return new TestCaseData(invalidCohesionShift, "Cohesie" + ).SetName(string.Format(testNameFormat, typeName)); + + SoilLayerBase invalidFrictionAngleShift = soilLayer(); + invalidFrictionAngleShift.FrictionAngleDistributionType = validDistributionType; + invalidFrictionAngleShift.FrictionAngleShift = -1; + yield return new TestCaseData(invalidFrictionAngleShift, "Wrijvingshoek" + ).SetName(string.Format(testNameFormat, typeName)); + + SoilLayerBase invalidShearStrengthRatioShift = soilLayer(); + invalidShearStrengthRatioShift.ShearStrengthRatioDistributionType = validDistributionType; + invalidShearStrengthRatioShift.ShearStrengthRatioShift = -1; + yield return new TestCaseData(invalidShearStrengthRatioShift, "Schuifsterkte ratio (S)" + ).SetName(string.Format(testNameFormat, typeName)); + + SoilLayerBase invalidStrengthIncreaseExponentShift = soilLayer(); + invalidStrengthIncreaseExponentShift.StrengthIncreaseExponentDistributionType = validDistributionType; + invalidStrengthIncreaseExponentShift.StrengthIncreaseExponentShift = -1; + yield return new TestCaseData(invalidStrengthIncreaseExponentShift, "Sterkte toename exp (m)" + ).SetName(string.Format(testNameFormat, typeName)); + + SoilLayerBase invalidPopShift = soilLayer(); + invalidPopShift.PopDistributionType = validDistributionType; + invalidPopShift.PopShift = -1; + yield return new TestCaseData(invalidPopShift, "POP" + ).SetName(string.Format(testNameFormat, typeName)); + } + #endregion } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfiles/PipingSoilLayerTransformer.cs =================================================================== diff -u -r94cb41fb18a59fc737dd3bcaf0e1898a3fadcaa5 -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 --- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfiles/PipingSoilLayerTransformer.cs (.../PipingSoilLayerTransformer.cs) (revision 94cb41fb18a59fc737dd3bcaf0e1898a3fadcaa5) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfiles/PipingSoilLayerTransformer.cs (.../PipingSoilLayerTransformer.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) @@ -156,14 +156,14 @@ /// stochastic parameters is not defined as lognormal or is shifted when it should not be. private static void ValidateStochasticParameters(SoilLayerBase soilLayer) { - DistributionHelper.ValidateIsLogNormal( + DistributionHelper.ValidateShiftedLogNormalDistribution( soilLayer.BelowPhreaticLevelDistributionType, Resources.SoilLayer_BelowPhreaticLevelDistribution_DisplayName); - DistributionHelper.ValidateIsNonShiftedLogNormal( + DistributionHelper.ValidateLogNormalDistribution( soilLayer.DiameterD70DistributionType, soilLayer.DiameterD70Shift, Resources.SoilLayer_DiameterD70Distribution_DisplayName); - DistributionHelper.ValidateIsNonShiftedLogNormal( + DistributionHelper.ValidateLogNormalDistribution( soilLayer.PermeabilityDistributionType, soilLayer.PermeabilityShift, Resources.SoilLayer_PermeabilityDistribution_DisplayName); Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfiles/PipingSoilLayerTransformerTest.cs =================================================================== diff -u -r94cb41fb18a59fc737dd3bcaf0e1898a3fadcaa5 -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfiles/PipingSoilLayerTransformerTest.cs (.../PipingSoilLayerTransformerTest.cs) (revision 94cb41fb18a59fc737dd3bcaf0e1898a3fadcaa5) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfiles/PipingSoilLayerTransformerTest.cs (.../PipingSoilLayerTransformerTest.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) @@ -203,22 +203,34 @@ // Assert Exception exception = Assert.Throws(test); - Assert.AreEqual("Parameter 'Verzadigd gewicht' is niet verschoven lognormaal verdeeld.", exception.Message); + Assert.AreEqual("Parameter 'Verzadigd gewicht' moet verschoven lognormaal verdeeld zijn.", exception.Message); } [Test] - [TestCaseSource(nameof(IncorrectLogNormalDistributionsSoilLayer1D))] - public void SoilLayer1DTransform_IncorrectLogNormalDistribution_ThrowsImportedDataTransformException(SoilLayer1D layer, string parameter) + [TestCaseSource(nameof(IncorrectLogNormalDistributionsTypeSoilLayer1D))] + public void SoilLayer1DTransform_IncorrectLogNormalDistributionType_ThrowsImportedDataTransformException(SoilLayer1D layer, string parameter) { // Call TestDelegate test = () => PipingSoilLayerTransformer.Transform(layer); // Assert Exception exception = Assert.Throws(test); - Assert.AreEqual($"Parameter '{parameter}' is niet lognormaal verdeeld.", exception.Message); + Assert.AreEqual($"Parameter '{parameter}' moet lognormaal verdeeld zijn.", exception.Message); } [Test] + [TestCaseSource(nameof(IncorrectLogNormalDistributionsShiftSoilLayer1D))] + public void SoilLayer1DTransform_IncorrectLogNormalDistributionShift_ThrowsImportedDataTransformException(SoilLayer1D layer, string parameter) + { + // Call + TestDelegate test = () => PipingSoilLayerTransformer.Transform(layer); + + // Assert + Exception exception = Assert.Throws(test); + Assert.AreEqual($"Parameter '{parameter}' moet lognormaal verdeeld zijn met een verschuiving gelijk aan 0.", exception.Message); + } + + [Test] public void SoilLayer2DTransform_SoilLayer2DNull_ThrowsArgumentNullException() { // Setup @@ -969,12 +981,12 @@ // Assert Exception exception = Assert.Throws(test); - Assert.AreEqual("Parameter 'Verzadigd gewicht' is niet verschoven lognormaal verdeeld.", exception.Message); + Assert.AreEqual("Parameter 'Verzadigd gewicht' moet verschoven lognormaal verdeeld zijn.", exception.Message); } [Test] - [TestCaseSource(nameof(IncorrectLogNormalDistributionsSoilLayer2D))] - public void SoilLayer2DTransform_IncorrectLogNormalDistribution_ThrowsImportedDataTransformException(SoilLayer2D layer, string parameter) + [TestCaseSource(nameof(IncorrectLogNormalDistributionsTypeSoilLayer2D))] + public void SoilLayer2DTransform_IncorrectLogNormalDistributionType_ThrowsImportedDataTransformException(SoilLayer2D layer, string parameter) { // Setup double bottom; @@ -984,9 +996,24 @@ // Assert Exception exception = Assert.Throws(test); - Assert.AreEqual($"Parameter '{parameter}' is niet lognormaal verdeeld.", exception.Message); + Assert.AreEqual($"Parameter '{parameter}' moet lognormaal verdeeld zijn.", exception.Message); } + [Test] + [TestCaseSource(nameof(IncorrectLogNormalDistributionsShiftSoilLayer2D))] + public void SoilLayer2DTransform_IncorrectLogNormalDistributionShift_ThrowsImportedDataTransformException(SoilLayer2D layer, string parameter) + { + // Setup + double bottom; + + // Call + TestDelegate test = () => PipingSoilLayerTransformer.Transform(layer, 0, out bottom); + + // Assert + Exception exception = Assert.Throws(test); + Assert.AreEqual($"Parameter '{parameter}' moet lognormaal verdeeld zijn met een verschuiving gelijk aan 0.", exception.Message); + } + private static SoilLayer2D CreateValidConfiguredSoilLayer2D(double x1, double x3) { var random = new Random(21); @@ -1007,19 +1034,29 @@ return SoilLayer2DTestFactory.CreateSoilLayer2D(Enumerable.Empty>(), outerLoop); } - private static IEnumerable IncorrectLogNormalDistributionsSoilLayer1D() + private static IEnumerable IncorrectLogNormalDistributionsTypeSoilLayer1D() { - return IncorrectLogNormalDistributions(() => new SoilLayer1D(0.0), nameof(SoilLayer1D)); + return IncorrectLogNormalDistributionsType(() => new SoilLayer1D(0.0), nameof(SoilLayer1D)); } - private static IEnumerable IncorrectLogNormalDistributionsSoilLayer2D() + private static IEnumerable IncorrectLogNormalDistributionsShiftSoilLayer1D() { - return IncorrectLogNormalDistributions(SoilLayer2DTestFactory.CreateSoilLayer2D, nameof(SoilLayer2D)); + return IncorrectLogNormalDistributionsShift(() => new SoilLayer1D(0.0), nameof(SoilLayer1D)); } - private static IEnumerable IncorrectLogNormalDistributions(Func soilLayer, string typeName) + private static IEnumerable IncorrectLogNormalDistributionsTypeSoilLayer2D() { - const string testNameFormat = "{0}Transform_Incorrect{1}{{1}}_ThrowsImportedDataTransformException"; + return IncorrectLogNormalDistributionsType(SoilLayer2DTestFactory.CreateSoilLayer2D, nameof(SoilLayer2D)); + } + + private static IEnumerable IncorrectLogNormalDistributionsShiftSoilLayer2D() + { + return IncorrectLogNormalDistributionsShift(SoilLayer2DTestFactory.CreateSoilLayer2D, nameof(SoilLayer2D)); + } + + private static IEnumerable IncorrectLogNormalDistributionsType(Func soilLayer, string typeName) + { + const string testNameFormat = "{0}Transform_IncorrectDistribution{{1}}_ThrowsImportedDataTransformException"; const long validDistributionType = SoilLayerConstants.LogNormalDistributionValue; const double validShift = 0.0; @@ -1031,18 +1068,8 @@ invalidDiameterD70Distribution.PermeabilityShift = validShift; yield return new TestCaseData(invalidDiameterD70Distribution, "Korrelgrootte" - ).SetName(string.Format(testNameFormat, typeName, "Distribution")); + ).SetName(string.Format(testNameFormat, typeName)); - SoilLayerBase invalidDiameterD70Shift = soilLayer(); - invalidDiameterD70Shift.BelowPhreaticLevelDistributionType = validDistributionType; - invalidDiameterD70Shift.DiameterD70DistributionType = validDistributionType; - invalidDiameterD70Shift.DiameterD70Shift = -1; - invalidDiameterD70Shift.PermeabilityDistributionType = validDistributionType; - invalidDiameterD70Shift.PermeabilityShift = validShift; - - yield return new TestCaseData(invalidDiameterD70Shift, "Korrelgrootte" - ).SetName(string.Format(testNameFormat, typeName, "Shift")); - SoilLayerBase invalidPermeabilityDistribution = soilLayer(); invalidPermeabilityDistribution.BelowPhreaticLevelDistributionType = validDistributionType; invalidPermeabilityDistribution.DiameterD70DistributionType = validDistributionType; @@ -1051,8 +1078,25 @@ invalidPermeabilityDistribution.PermeabilityShift = validShift; yield return new TestCaseData(invalidPermeabilityDistribution, "Doorlatendheid" - ).SetName(string.Format(testNameFormat, typeName, "Distribution")); + ).SetName(string.Format(testNameFormat, typeName)); + } + private static IEnumerable IncorrectLogNormalDistributionsShift(Func soilLayer, string typeName) + { + const string testNameFormat = "{0}Transform_IncorrectShift{{1}}_ThrowsImportedDataTransformException"; + const long validDistributionType = SoilLayerConstants.LogNormalDistributionValue; + const double validShift = 0.0; + + SoilLayerBase invalidDiameterD70Shift = soilLayer(); + invalidDiameterD70Shift.BelowPhreaticLevelDistributionType = validDistributionType; + invalidDiameterD70Shift.DiameterD70DistributionType = validDistributionType; + invalidDiameterD70Shift.DiameterD70Shift = -1; + invalidDiameterD70Shift.PermeabilityDistributionType = validDistributionType; + invalidDiameterD70Shift.PermeabilityShift = validShift; + + yield return new TestCaseData(invalidDiameterD70Shift, "Korrelgrootte" + ).SetName(string.Format(testNameFormat, typeName)); + SoilLayerBase invalidPermeabilityShift = soilLayer(); invalidPermeabilityShift.BelowPhreaticLevelDistributionType = validDistributionType; invalidPermeabilityShift.DiameterD70DistributionType = validDistributionType; @@ -1061,7 +1105,7 @@ invalidPermeabilityShift.PermeabilityShift = -1; yield return new TestCaseData(invalidPermeabilityShift, "Doorlatendheid" - ).SetName(string.Format(testNameFormat, typeName, "Shift")); + ).SetName(string.Format(testNameFormat, typeName)); } private static IEnumerable GetColorCases()