Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/DistributionAssertTest.cs =================================================================== diff -u -ra14d1309ecf82ff5b0385a2f6e3b2c4a216a4184 -rcf792220e910d93a764ea77cf57cff45d267fdde --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/DistributionAssertTest.cs (.../DistributionAssertTest.cs) (revision a14d1309ecf82ff5b0385a2f6e3b2c4a216a4184) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/DistributionAssertTest.cs (.../DistributionAssertTest.cs) (revision cf792220e910d93a764ea77cf57cff45d267fdde) @@ -42,6 +42,18 @@ } [Test] + [TestCaseSource("IdenticalTruncatedNormalDistributionProperties")] + public void AreDistributionPropertiesEqual_IdenticalTruncatedNormalDistributionProperties_DoesNotThrowException(TruncatedNormalDistribution distributionOne, + TruncatedNormalDistribution distributionTwo) + { + // Call + TestDelegate call = () => DistributionAssert.AreEqual(distributionOne, distributionTwo); + + // Assert + Assert.DoesNotThrow(call); + } + + [Test] [TestCaseSource("IdenticalVariationCoefficientDistributionProperties")] public void AreDistributionPropertiesEqual_IdenticalVariationCoefficientDistributionProperties_DoesNotThrowException(IVariationCoefficientDistribution distributionOne, IVariationCoefficientDistribution distributionTwo) @@ -66,6 +78,18 @@ } [Test] + [TestCaseSource("DifferentTruncatedNormalDistributionProperties")] + public void AreDistributionPropertiesEqual_DifferentTruncatedNormalDistributionProperties_DoesNotThrowException(TruncatedNormalDistribution distributionOne, + TruncatedNormalDistribution distributionTwo) + { + // Call + TestDelegate call = () => DistributionAssert.AreEqual(distributionOne, distributionTwo); + + // Assert + Assert.Throws(call); + } + + [Test] [TestCaseSource("DifferentVariationCoefficientDistributionProperties")] public void AreDistributionPropertiesEqual_DifferentVariationCoefficientDistributionProperties_ThrowsAssertionException(IVariationCoefficientDistribution distributionOne, IVariationCoefficientDistribution distributionTwo) @@ -108,6 +132,28 @@ } } + private static IEnumerable IdenticalTruncatedNormalDistributionProperties + { + get + { + yield return new TestCaseData( + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + StandardDeviation = (RoundedDouble) 2, + LowerBoundary = (RoundedDouble) 3, + UpperBoundary = (RoundedDouble) 4 + }, + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble)1, + StandardDeviation = (RoundedDouble)2, + LowerBoundary = (RoundedDouble)3, + UpperBoundary = (RoundedDouble)4 + }).SetName("IdenticalTruncatedNormalDistribution"); + } + } + private static IEnumerable IdenticalVariationCoefficientDistributionProperties { get @@ -221,6 +267,88 @@ } } + private static IEnumerable DifferentTruncatedNormalDistributionProperties + { + get + { + yield return new TestCaseData( + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble)1, + StandardDeviation = (RoundedDouble)2, + LowerBoundary = (RoundedDouble)3, + UpperBoundary = (RoundedDouble)4 + }, + new TruncatedNormalDistribution(3) + { + Mean = (RoundedDouble)1, + StandardDeviation = (RoundedDouble)2, + LowerBoundary = (RoundedDouble)3, + UpperBoundary = (RoundedDouble)4 + }).SetName("DifferentRoundingTruncatedNormalDistribution"); + yield return new TestCaseData( + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble)1, + StandardDeviation = (RoundedDouble)2, + LowerBoundary = (RoundedDouble)3, + UpperBoundary = (RoundedDouble)4 + }, + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble)2, + StandardDeviation = (RoundedDouble)2, + LowerBoundary = (RoundedDouble)3, + UpperBoundary = (RoundedDouble)4 + }).SetName("DifferentMeanTruncatedNormalDistribution"); + yield return new TestCaseData( + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble)1, + StandardDeviation = (RoundedDouble)2, + LowerBoundary = (RoundedDouble)3, + UpperBoundary = (RoundedDouble)4 + }, + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble)1, + StandardDeviation = (RoundedDouble)3, + LowerBoundary = (RoundedDouble)3, + UpperBoundary = (RoundedDouble)4 + }).SetName("DifferentStandardDeviationTruncatedNormalDistribution"); + yield return new TestCaseData( + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble)1, + StandardDeviation = (RoundedDouble)2, + LowerBoundary = (RoundedDouble)3, + UpperBoundary = (RoundedDouble)4 + }, + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble)1, + StandardDeviation = (RoundedDouble)2, + LowerBoundary = (RoundedDouble)4, + UpperBoundary = (RoundedDouble)4 + }).SetName("DifferentLowerBoundaryTruncatedNormalDistribution"); + yield return new TestCaseData( + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble)1, + StandardDeviation = (RoundedDouble)2, + LowerBoundary = (RoundedDouble)3, + UpperBoundary = (RoundedDouble)4 + }, + new TruncatedNormalDistribution(2) + { + Mean = (RoundedDouble)1, + StandardDeviation = (RoundedDouble)2, + LowerBoundary = (RoundedDouble)3, + UpperBoundary = (RoundedDouble)5 + }).SetName("DifferentUpperBoundaryTruncatedNormalDistribution"); + } + } + private static IEnumerable DifferentVariationCoefficientDistributionProperties { get