Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/IllustrationPoint.cs =================================================================== diff -u -r1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9 -r6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/IllustrationPoint.cs (.../IllustrationPoint.cs) (revision 1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/IllustrationPoint.cs (.../IllustrationPoint.cs) (revision 6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb) @@ -31,7 +31,7 @@ public class IllustrationPoint { /// - /// Creates a . + /// Creates a new instance of . /// /// The name of the illustration point result /// The realized stochasts. Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/RealizedStochast.cs =================================================================== diff -u -r1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9 -r6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/RealizedStochast.cs (.../RealizedStochast.cs) (revision 1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/RealizedStochast.cs (.../RealizedStochast.cs) (revision 6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb) @@ -30,7 +30,7 @@ public class RealizedStochast : Stochast { /// - /// Instantiates a . + /// Creates a new instance of . /// /// The name of the stochast. /// The duration. Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/Stochast.cs =================================================================== diff -u -r1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9 -r6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/Stochast.cs (.../Stochast.cs) (revision 1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/Stochast.cs (.../Stochast.cs) (revision 6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb) @@ -30,12 +30,12 @@ public class Stochast { /// - /// Instantiates a . + /// Creates a new instance of . /// /// The name of the stochast. /// The duration. /// The alpha value - /// + /// Thrown when is null. public Stochast(string name, int duration, double alpha) { if (name == null) Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/WindDirection.cs =================================================================== diff -u -r1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9 -r6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/WindDirection.cs (.../WindDirection.cs) (revision 1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/IllustrationPoints/WindDirection.cs (.../WindDirection.cs) (revision 6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb) @@ -37,7 +37,7 @@ new RoundedDouble(windDirectionAngleNumberOfDecimals, 360)); /// - /// Instantiates a . + /// Creates a new instance of . /// /// The name of the wind direction. /// The angle of the wind direction in degrees. @@ -58,7 +58,7 @@ { string message = string.Format(Resources.WindDirection_WindDirectionAngle_Value_needs_to_be_in_Range_0_, windDirectionAngleValidityRange); - throw new ArgumentOutOfRangeException(null, message); + throw new ArgumentOutOfRangeException(nameof(angle), message); } Name = name; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/IllustrationPointResultTest.cs =================================================================== diff -u -r1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9 -r6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/IllustrationPointResultTest.cs (.../IllustrationPointResultTest.cs) (revision 1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/IllustrationPointResultTest.cs (.../IllustrationPointResultTest.cs) (revision 6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb) @@ -62,21 +62,5 @@ illustrationPointResult.Value.GetAccuracy()); Assert.AreEqual(5, illustrationPointResult.Value.NumberOfDecimalPlaces); } - - [Test] - [TestCase(double.PositiveInfinity)] - [TestCase(double.NaN)] - [TestCase(double.NegativeInfinity)] - [TestCase(0.05)] - public void Constructor_ValidArguments_ReturnExpectedValues(double value) - { - // Call - var illustrationPointResult = new IllustrationPointResult("illustration point", value); - - // Assert - Assert.AreEqual(value, illustrationPointResult.Value, - illustrationPointResult.Value.GetAccuracy()); - Assert.AreEqual(5, illustrationPointResult.Value.NumberOfDecimalPlaces); - } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/RealizedStochastTest.cs =================================================================== diff -u -r1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9 -r6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/RealizedStochastTest.cs (.../RealizedStochastTest.cs) (revision 1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/RealizedStochastTest.cs (.../RealizedStochastTest.cs) (revision 6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb) @@ -45,13 +45,13 @@ // Assert Assert.IsInstanceOf(stochast); - Assert.AreEqual(realization, stochast.Realization, - stochast.Realization.GetAccuracy()); - Assert.AreEqual(5, stochast.Realization.NumberOfDecimalPlaces); - Assert.AreEqual(name, stochast.Name); Assert.AreEqual(duration, stochast.Duration); Assert.AreEqual(alpha, stochast.Alpha, stochast.Alpha.GetAccuracy()); + + Assert.AreEqual(realization, stochast.Realization, + stochast.Realization.GetAccuracy()); + Assert.AreEqual(5, stochast.Realization.NumberOfDecimalPlaces); } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/StochastTest.cs =================================================================== diff -u -r1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9 -r6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/StochastTest.cs (.../StochastTest.cs) (revision 1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/StochastTest.cs (.../StochastTest.cs) (revision 6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb) @@ -64,24 +64,5 @@ Assert.AreEqual(alpha, stochast.Alpha, stochast.Alpha.GetAccuracy()); Assert.AreEqual(5, stochast.Alpha.NumberOfDecimalPlaces); } - - [Test] - [TestCase(double.PositiveInfinity)] - [TestCase(double.NaN)] - [TestCase(double.NegativeInfinity)] - [TestCase(0.05)] - public void Constructor_ValidAlpha_ReturnExpectedValues(double alpha) - { - // Setup - var random = new Random(21); - int duration = random.Next(); - - // Call - var stochast = new Stochast("Stochast name", duration, alpha); - - // Assert - Assert.AreEqual(alpha, stochast.Alpha, stochast.Alpha.GetAccuracy()); - Assert.AreEqual(5, stochast.Alpha.NumberOfDecimalPlaces); - } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/WindDirectionTest.cs =================================================================== diff -u -r1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9 -r6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/WindDirectionTest.cs (.../WindDirectionTest.cs) (revision 1a7bbfc1520b96bab3d6d50f9e68da0b23ca0da9) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/IllustrationPoints/WindDirectionTest.cs (.../WindDirectionTest.cs) (revision 6fb7fba714affe795d1d41ae88b1fbcfcb73bbbb) @@ -31,7 +31,7 @@ public class WindDirectionTest { [Test] - public void Constructor_NameNull_ThrownsArgumentNullException() + public void Constructor_NameNull_ThrowsArgumentNullException() { // Setup var random = new Random(21); @@ -56,42 +56,27 @@ TestDelegate call = () => new WindDirection("SSE", windDirectionAngle); // Assert - var exception = Assert.Throws(call); const string expectedErrorMessage = "De waarde voor de windrichting moet in het bereik van [0.00, 360.00] liggen."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedErrorMessage); - Assert.AreEqual(expectedErrorMessage, exception.Message); + var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedErrorMessage); + Assert.AreEqual("angle", exception.ParamName); } [Test] [TestCase(360.004)] [TestCase(double.NaN)] [TestCase(50)] [TestCase(-0.004)] - public void Constructor_ValidWindDirection_ReturnsExpectedValues(double windDirectionAngle) + public void Constructor_ValidValues_ReturnsExpectedValues(double angle) { - // Call - var windDirection = new WindDirection("SSE", windDirectionAngle); - - // Assert - Assert.AreEqual(windDirectionAngle, windDirection.Angle, windDirection.Angle.GetAccuracy()); - Assert.AreEqual(2, windDirection.Angle.NumberOfDecimalPlaces); - } - - [Test] - public void Constructor_ValidValues_ReturnsExpectedValues() - { // Setup const string windDirectionName = "SSE"; - var random = new Random(21); - double value = random.NextDouble(); - // Call - var windDirection = new WindDirection(windDirectionName, value); + var windDirection = new WindDirection(windDirectionName, angle); // Assert Assert.AreEqual(windDirectionName, windDirection.Name); - Assert.AreEqual(value, windDirection.Angle, windDirection.Angle.GetAccuracy()); + Assert.AreEqual(angle, windDirection.Angle, windDirection.Angle.GetAccuracy()); Assert.AreEqual(2, windDirection.Angle.NumberOfDecimalPlaces); } }