Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/LimitedPrecisionHelperTest.cs =================================================================== diff -u -rab330857f161d3f884db508d80a2dd0ade36434f -r1df1e9ae0057dde85489929cbf85d222c26e8c5f --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/LimitedPrecisionHelperTest.cs (.../LimitedPrecisionHelperTest.cs) (revision ab330857f161d3f884db508d80a2dd0ade36434f) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/LimitedPrecisionHelperTest.cs (.../LimitedPrecisionHelperTest.cs) (revision 1df1e9ae0057dde85489929cbf85d222c26e8c5f) @@ -40,10 +40,10 @@ var roundedDouble = new RoundedDouble(precision); // Call - var accuracy = roundedDouble.GetAccuracy(); + double accuracy = roundedDouble.GetAccuracy(); // Assert - var expectedPrecision = 0.5*Math.Pow(10.0, -precision); + double expectedPrecision = 0.5 * Math.Pow(10.0, -precision); Assert.AreEqual(expectedPrecision, accuracy); } @@ -59,40 +59,68 @@ }; // Call - var accuracy = distribution.GetAccuracy(); + double accuracy = distribution.GetAccuracy(); // Assert - var expectedPrecision = 0.5*Math.Pow(10.0, -precision); + double expectedPrecision = 0.5 * Math.Pow(10.0, -precision); Assert.AreEqual(expectedPrecision, accuracy); } [Test] [TestCase(1)] [TestCase(2)] + public void GetAccuracy_VariationCoefficientDistribution_ReturnsAccuracy(int precision) + { + // Setup + var distribution = new SimpleVariationCoefficientDistribution + { + Mean = new RoundedDouble(precision) + }; + + // Call + double accuracy = distribution.GetAccuracy(); + + // Assert + double expectedPrecision = 0.5 * Math.Pow(10.0, -precision); + Assert.AreEqual(expectedPrecision, accuracy); + } + + [Test] + [TestCase(1)] + [TestCase(2)] public void GetAccuracy_RoundedPoint2DCollection_ReturnsAccuracy(int precision) { // Setup var roundedCollectoin = new RoundedPoint2DCollection(precision, Enumerable.Empty()); // Call - var accuracy = roundedCollectoin.GetAccuracy(); + double accuracy = roundedCollectoin.GetAccuracy(); // Assert - var expectedPrecision = 0.5*Math.Pow(10.0, -precision); + double expectedPrecision = 0.5 * Math.Pow(10.0, -precision); Assert.AreEqual(expectedPrecision, accuracy); } - private class SimpleDistribution : IDistributionBase + private class SimpleDistribution : IDistribution { public RoundedDouble Mean { get; set; } - public RoundedDouble StandardDeviation { get; } - public RoundedDouble CoefficientOfVariation { get; } + public RoundedDouble StandardDeviation { get; set; } public object Clone() { throw new NotImplementedException(); } + } + private class SimpleVariationCoefficientDistribution : IVariationCoefficientDistribution + { + public RoundedDouble Mean { get; set; } + public RoundedDouble CoefficientOfVariation { get; set; } + + public object Clone() + { + throw new NotImplementedException(); + } } } } \ No newline at end of file