Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs =================================================================== diff -u -r8cdbb1c76ccda6f711ec3bb02339896e7eb660c0 -r38940fd430501da3c19ac8c90f660b21f8938909 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs (.../DistributionHelperTest.cs) (revision 8cdbb1c76ccda6f711ec3bb02339896e7eb660c0) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs (.../DistributionHelperTest.cs) (revision 38940fd430501da3c19ac8c90f660b21f8938909) @@ -30,15 +30,15 @@ public class DistributionHelperTest { [Test] - public void ValidateLogNormalDistribution_ParameterNameNull_ThrowsArgumentNullException() + public void ValidateIsNonShiftedLogNormal_ParameterNameNull_ThrowsArgumentNullException() { // Setup var random = new Random(21); long distributionType = random.Next(); double shift = random.NextDouble(); // Call - TestDelegate call = () => DistributionHelper.ValidateLogNormalDistribution(distributionType, + TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(distributionType, shift, null); @@ -48,54 +48,34 @@ } [Test] - public void ValidateLogNormalDistribution_InvalidDistributionType_ThrowsImportedDataException() + [TestCase(-1, 0)] + [TestCase(3, 10)] + public void ValidateIsNonShiftedLogNormal_InvalidDistributionProperties_ThrowsImportedDataException( + long distributionType, + double shift) { // Setup - const long distributionType = -1; const string parameterName = "Just a name"; - var random = new Random(21); - double shift = random.NextDouble(); - // Call - TestDelegate call = () => DistributionHelper.ValidateLogNormalDistribution(distributionType, + TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(distributionType, shift, parameterName); // Assert var exception = Assert.Throws(call); - Assert.AreEqual($"Parameter '{parameterName}' moet lognormaal verdeeld zijn.", exception.Message); + Assert.AreEqual($"Parameter '{parameterName}' is niet lognormaal verdeeld.", exception.Message); } [Test] - public void ValidateLogNormalDistribution_ShiftNonZero_ThrowsImportedDataTransformException() + public void ValidateIsNonShiftedLogNormal_ValidDistribution_DoesNotThrowException() { // Setup - 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 long distributionType = 3; const double shift = 0; // Call - TestDelegate call = () => DistributionHelper.ValidateLogNormalDistribution(distributionType, + TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(distributionType, shift, string.Empty); @@ -104,15 +84,15 @@ } [Test] - public void ValidateLogNormalDistribution_DistributionTypeNull_DoesNotThrowException() + public void ValidateIsNonShiftedLogNormal_DistributionTypeNull_DoesNotThrowException() { // Setup var random = new Random(21); double shift = random.NextDouble(); const string parameterName = "Just a name"; // Call - TestDelegate call = () => DistributionHelper.ValidateLogNormalDistribution(null, + TestDelegate call = () => DistributionHelper.ValidateIsNonShiftedLogNormal(null, shift, parameterName); @@ -121,60 +101,60 @@ } [Test] - public void ValidateShiftedLogNormalDistribution_ParameterNameNull_ThrowsArgumentNullException() + public void ValidateIsLogNormal_ParameterNameNull_ThrowsArgumentNullException() { // Setup var random = new Random(21); long distributionType = random.Next(); // Call - TestDelegate call = () => DistributionHelper.ValidateShiftedLogNormalDistribution(distributionType, - null); + TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(distributionType, + null); // Assert var exception = Assert.Throws(call); Assert.AreEqual("parameterName", exception.ParamName); } [Test] - public void ValidateShiftedLogNormalDistribution_InvalidDistributionType_ThrowsImportedDataException() + public void ValidateIsLogNormal_InvalidDistributionProperties_ThrowsImportedDataException() { // Setup const long invalidDistributionType = -1; const string parameterName = "Just a name"; // Call - TestDelegate call = () => DistributionHelper.ValidateShiftedLogNormalDistribution(invalidDistributionType, - parameterName); + TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(invalidDistributionType, + parameterName); // Assert var exception = Assert.Throws(call); - Assert.AreEqual($"Parameter '{parameterName}' moet verschoven lognormaal verdeeld zijn.", exception.Message); + Assert.AreEqual($"Parameter '{parameterName}' is niet verschoven lognormaal verdeeld.", exception.Message); } [Test] - public void ValidateShiftedLogNormalDistribution_ValidDistribution_DoesNotThrowException() + public void ValidateIsLogNormal_ValidDistribution_DoesNotThrowException() { // Setup - const long distributionType = SoilLayerConstants.LogNormalDistributionValue; + const long distributionType = 3; // Call - TestDelegate call = () => DistributionHelper.ValidateShiftedLogNormalDistribution(distributionType, - string.Empty); + TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(distributionType, + string.Empty); // Assert Assert.DoesNotThrow(call); } [Test] - public void ValidateShiftedLogNormalDistribution_DistributionTypeNull_DoesNotThrowException() + public void ValidateIsLogNormal_DistributionTypeNull_DoesNotThrowException() { // Setup const string parameterName = "Just a name"; // Call - TestDelegate call = () => DistributionHelper.ValidateShiftedLogNormalDistribution(null, - parameterName); + TestDelegate call = () => DistributionHelper.ValidateIsLogNormal(null, + parameterName); // Assert Assert.DoesNotThrow(call);