Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs
===================================================================
diff -u -r38940fd430501da3c19ac8c90f660b21f8938909 -r117a54dfd9b5972086a1f3386923edda2e7a334b
--- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs (.../DistributionHelper.cs) (revision 38940fd430501da3c19ac8c90f660b21f8938909)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs (.../DistributionHelper.cs) (revision 117a54dfd9b5972086a1f3386923edda2e7a334b)
@@ -41,34 +41,41 @@
/// The name of the parameter to be validated.
/// Thrown when
/// is null.
- /// Thrown when the parameter is not a
+ /// 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 InvalidDistributionSettingException(string.Format(
+ Resources.Stochastic_parameter_0_must_be_a_lognormal_distribution,
+ parameterName));
+
+ if (Math.Abs(shift) > tolerance)
+ {
+ throw new InvalidDistributionSettingException(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
+ /// 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)
{
@@ -77,9 +84,9 @@
if (distributionType.HasValue && distributionType != SoilLayerConstants.LogNormalDistributionValue)
{
- throw new ImportedDataTransformException(string.Format(
- Resources.SoilLayer_Stochastic_parameter_0_has_no_shifted_lognormal_distribution,
- parameterName));
+ throw new InvalidDistributionSettingException(string.Format(
+ Resources.Stochastic_parameter_0_has_no_shifted_lognormal_distribution,
+ parameterName));
}
}
}