Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs =================================================================== diff -u -r88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca -rd5daf17a6ed66dddef590069e4db152f6250c2c3 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision 88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision d5daf17a6ed66dddef590069e4db152f6250c2c3) @@ -361,12 +361,17 @@ } set { + if (double.IsNaN(value)) + { + structureNormalOrientation = (RoundedDouble) double.NaN; + return; + } + RoundedDouble newOrientationValue = value.ToPrecision(structureNormalOrientation.NumberOfDecimalPlaces); - if (double.IsNaN(newOrientationValue) || newOrientationValue < 0 || newOrientationValue > 360) + if (newOrientationValue < 0 || newOrientationValue > 360) { throw new ArgumentOutOfRangeException("value", RingtoetsCommonDataResources.Orientation_Value_needs_to_be_between_0_and_360); } - structureNormalOrientation = newOrientationValue; } } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs =================================================================== diff -u -r88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca -rd5daf17a6ed66dddef590069e4db152f6250c2c3 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs (.../ClosingStructuresInputTest.cs) (revision 88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs (.../ClosingStructuresInputTest.cs) (revision d5daf17a6ed66dddef590069e4db152f6250c2c3) @@ -228,6 +228,7 @@ [TestCase(300)] [TestCase(0)] [TestCase(-0.004)] + [TestCase(double.NaN)] public void Properties_StructureNormalOrientationValidValues_NewValueSet(double orientation) { // Setup @@ -246,7 +247,6 @@ [TestCase(360.05)] [TestCase(-0.005)] [TestCase(-23)] - [TestCase(double.NaN)] [TestCase(double.PositiveInfinity)] [TestCase(double.NegativeInfinity)] public void Properties_StructureNormalOrientationInValidValues_ThrowsArgumentOutOfRangeException(double invalidValue) @@ -258,8 +258,6 @@ TestDelegate call = () => input.StructureNormalOrientation = (RoundedDouble) invalidValue; // Assert - string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("value", paramName); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "De waarde voor de oriëntatie moet in het bereik tussen [0, 360] graden liggen."); } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs =================================================================== diff -u -r88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca -rd5daf17a6ed66dddef590069e4db152f6250c2c3 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs (.../HeightStructuresInput.cs) (revision 88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs (.../HeightStructuresInput.cs) (revision d5daf17a6ed66dddef590069e4db152f6250c2c3) @@ -203,12 +203,17 @@ } set { + if (double.IsNaN(value)) + { + structureNormalOrientation = (RoundedDouble) double.NaN; + return; + } + RoundedDouble newOrientationValue = value.ToPrecision(structureNormalOrientation.NumberOfDecimalPlaces); - if (double.IsNaN(newOrientationValue) || newOrientationValue < 0 || newOrientationValue > 360) + if (newOrientationValue < 0 || newOrientationValue > 360) { throw new ArgumentOutOfRangeException("value", RingtoetsCommonDataResources.Orientation_Value_needs_to_be_between_0_and_360); } - structureNormalOrientation = newOrientationValue; } } Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs =================================================================== diff -u -r88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca -rd5daf17a6ed66dddef590069e4db152f6250c2c3 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision 88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision d5daf17a6ed66dddef590069e4db152f6250c2c3) @@ -160,6 +160,7 @@ [TestCase(300)] [TestCase(0)] [TestCase(-0.004)] + [TestCase(double.NaN)] public void Properties_StructureNormalOrientationValidValues_NewValueSet(double orientation) { // Setup @@ -178,7 +179,6 @@ [TestCase(360.05)] [TestCase(-0.005)] [TestCase(-23)] - [TestCase(double.NaN)] [TestCase(double.PositiveInfinity)] [TestCase(double.NegativeInfinity)] public void Properties_StructureNormalOrientationInValidValues_ThrowsArgumentOutOfRangeException(double invalidValue) @@ -190,8 +190,6 @@ TestDelegate call = () => input.StructureNormalOrientation = (RoundedDouble)invalidValue; // Assert - string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("value", paramName); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "De waarde voor de oriëntatie moet in het bereik tussen [0, 360] graden liggen."); } Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs =================================================================== diff -u -r88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca -rd5daf17a6ed66dddef590069e4db152f6250c2c3 --- Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision 88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision d5daf17a6ed66dddef590069e4db152f6250c2c3) @@ -109,8 +109,14 @@ } set { + if (double.IsNaN(value)) + { + orientation = (RoundedDouble)double.NaN; + return; + } + RoundedDouble newOrientation = value.ToPrecision(orientation.NumberOfDecimalPlaces); - if (double.IsNaN(newOrientation) || newOrientation < 0 || newOrientation > 360) + if (newOrientation < 0 || newOrientation > 360) { throw new ArgumentOutOfRangeException("value", RingtoetsCommonDataResources.Orientation_Value_needs_to_be_between_0_and_360); } Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/WaveConditionsInputTest.cs =================================================================== diff -u -r88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca -rd5daf17a6ed66dddef590069e4db152f6250c2c3 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/WaveConditionsInputTest.cs (.../WaveConditionsInputTest.cs) (revision 88e625c7d47b0efd2a5ea8ea118e524c8f8e36ca) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/WaveConditionsInputTest.cs (.../WaveConditionsInputTest.cs) (revision d5daf17a6ed66dddef590069e4db152f6250c2c3) @@ -280,6 +280,7 @@ [TestCase(300)] [TestCase(0)] [TestCase(-0.004)] + [TestCase(double.NaN)] public void Orientation_ValidValue_NewValueSet(double orientation) { // Setup @@ -297,7 +298,6 @@ [TestCase(360.05)] [TestCase(-0.005)] [TestCase(-23)] - [TestCase(double.NaN)] [TestCase(double.PositiveInfinity)] [TestCase(double.NegativeInfinity)] public void Orientation_InvalidValue_ThrowsArgumentOutOfRangeException(double invalidValue) @@ -309,8 +309,6 @@ TestDelegate call = () => input.Orientation = (RoundedDouble) invalidValue; // Assert - string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("value", paramName); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "De waarde voor de oriëntatie moet in het bereik tussen [0, 360] graden liggen."); }