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)); } }