Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs
===================================================================
diff -u -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 -r38940fd430501da3c19ac8c90f660b21f8938909
--- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs (.../DistributionHelper.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs (.../DistributionHelper.cs) (revision 38940fd430501da3c19ac8c90f660b21f8938909)
@@ -43,39 +43,32 @@
/// is null.
/// Thrown when the parameter is not a
/// log normal distribution with a zero shift.
- public static void ValidateLogNormalDistribution(long? distributionType, double shift, string parameterName)
+ public static void ValidateIsNonShiftedLogNormal(long? distributionType, double shift, string parameterName)
{
if (parameterName == null)
{
throw new ArgumentNullException(nameof(parameterName));
}
- if (distributionType.HasValue)
+ if (distributionType.HasValue && (distributionType.Value != SoilLayerConstants.LogNormalDistributionValue
+ || Math.Abs(shift) > tolerance))
{
- 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));
- }
+ throw new ImportedDataTransformException(string.Format(
+ Resources.Stochastic_parameter_0_has_no_lognormal_distribution,
+ parameterName));
}
}
///
- /// Validates that the distribution is a (shifted) log normal distribution.
+ /// Validates that the distribution is a 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 ValidateShiftedLogNormalDistribution(long? distributionType, string parameterName)
+ public static void ValidateIsLogNormal(long? distributionType, string parameterName)
{
if (parameterName == null)
{
@@ -85,7 +78,7 @@
if (distributionType.HasValue && distributionType != SoilLayerConstants.LogNormalDistributionValue)
{
throw new ImportedDataTransformException(string.Format(
- Resources.Stochastic_parameter_0_has_no_shifted_lognormal_distribution,
+ Resources.SoilLayer_Stochastic_parameter_0_has_no_shifted_lognormal_distribution,
parameterName));
}
}