Index: Ringtoets/Common/src/Ringtoets.Common.Util/FailureMechanismNormHelper.cs
===================================================================
diff -u -r18fa622cceab5b9575dbf4b6bffd0825100d7416 -r3716307f520488309250ca011e43fe660ecc0e6a
--- Ringtoets/Common/src/Ringtoets.Common.Util/FailureMechanismNormHelper.cs (.../FailureMechanismNormHelper.cs) (revision 18fa622cceab5b9575dbf4b6bffd0825100d7416)
+++ Ringtoets/Common/src/Ringtoets.Common.Util/FailureMechanismNormHelper.cs (.../FailureMechanismNormHelper.cs) (revision 3716307f520488309250ca011e43fe660ecc0e6a)
@@ -55,7 +55,7 @@
/// Thrown when:
///
/// - is not in the interval [0.0, 100.0] or is ;
- /// - is not larger than 1 or is .
+ /// - is smaller than 1 or is .
///
///
public static double GetNorm(IAssessmentSection assessmentSection,
@@ -103,7 +103,7 @@
if (!Enum.IsDefined(typeof(FailureMechanismCategoryType), categoryType))
{
throw new InvalidEnumArgumentException(nameof(categoryType),
- (int)categoryType,
+ (int) categoryType,
typeof(FailureMechanismCategoryType));
}
@@ -120,7 +120,7 @@
if (double.IsNaN(n) || n < 1.0)
{
- throw new ArgumentOutOfRangeException(nameof(n), $@"The value for '{nameof(n)}' must be larger than 1.0.");
+ throw new ArgumentOutOfRangeException(nameof(n), $@"The value for '{nameof(n)}' must be 1.0 or larger.");
}
}
}
Index: Ringtoets/Common/test/Ringtoets.Common.Util.Test/FailureMechanismNormHelperTest.cs
===================================================================
diff -u -r18fa622cceab5b9575dbf4b6bffd0825100d7416 -r3716307f520488309250ca011e43fe660ecc0e6a
--- Ringtoets/Common/test/Ringtoets.Common.Util.Test/FailureMechanismNormHelperTest.cs (.../FailureMechanismNormHelperTest.cs) (revision 18fa622cceab5b9575dbf4b6bffd0825100d7416)
+++ Ringtoets/Common/test/Ringtoets.Common.Util.Test/FailureMechanismNormHelperTest.cs (.../FailureMechanismNormHelperTest.cs) (revision 3716307f520488309250ca011e43fe660ecc0e6a)
@@ -20,7 +20,7 @@
// All rights reserved.
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.ComponentModel;
using Core.Common.TestUtil;
using NUnit.Framework;
@@ -42,8 +42,8 @@
// Call
TestDelegate test = () => FailureMechanismNormHelper.GetNorm(null,
FailureMechanismCategoryType.FactorizedLowerLimitNorm,
- random.NextDouble(),
- random.NextDouble());
+ random.NextDouble(0, 100),
+ random.NextDouble(1, 20));
// Assert
string paramName = Assert.Throws(test).ParamName;
@@ -60,8 +60,8 @@
// Call
TestDelegate test = () => FailureMechanismNormHelper.GetNorm(new AssessmentSectionStub(),
(FailureMechanismCategoryType) invalidValue,
- random.NextDouble(),
- random.NextDouble());
+ random.NextDouble(0, 100),
+ random.NextDouble(1, 20));
// Assert
string expectedMessage = $"The value of argument 'categoryType' ({invalidValue}) is invalid for Enum type '{nameof(FailureMechanismCategoryType)}'.";
@@ -102,11 +102,11 @@
// Call
TestDelegate call = () => FailureMechanismNormHelper.GetNorm(new AssessmentSectionStub(),
random.NextEnumValue(),
- random.NextDouble(1, 100),
+ random.NextDouble(0, 100),
n);
// Assert
- const string message = "The value for 'n' must be larger than 1.0.";
+ const string message = "The value for 'n' must be 1.0 or larger.";
string paramName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message).ParamName;
Assert.AreEqual("n", paramName);
}
@@ -127,7 +127,7 @@
Assert.AreEqual(expectedNorm, norm, 1e-5);
}
- private static IEnumerable GetNormConfigurationPerFailureMechanismCategoryType()
+ private static IEnumerable GetNormConfigurationPerFailureMechanismCategoryType()
{
const double signalingNorm = 0.002;
const double lowerLimitNorm = 0.005;
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanismExtensions.cs
===================================================================
diff -u -r9e2f7186181853ea7cce697f737eeca21f82551f -r3716307f520488309250ca011e43fe660ecc0e6a
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanismExtensions.cs (.../GrassCoverErosionOutwardsFailureMechanismExtensions.cs) (revision 9e2f7186181853ea7cce697f737eeca21f82551f)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanismExtensions.cs (.../GrassCoverErosionOutwardsFailureMechanismExtensions.cs) (revision 3716307f520488309250ca011e43fe660ecc0e6a)
@@ -127,13 +127,6 @@
throw new ArgumentNullException(nameof(failureMechanism));
}
- if (!Enum.IsDefined(typeof(FailureMechanismCategoryType), categoryType))
- {
- throw new InvalidEnumArgumentException(nameof(categoryType),
- (int) categoryType,
- typeof(FailureMechanismCategoryType));
- }
-
return FailureMechanismNormHelper.GetNorm(assessmentSection,
categoryType,
failureMechanism.Contribution,