Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs =================================================================== diff -u -rbcaf65d1f53f270fba046eaa396d3be77bd08c0f -r1a6804681b0758a5761e39099e4b6de65f9cf4a2 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs (.../ClosingStructuresInputTest.cs) (revision bcaf65d1f53f270fba046eaa396d3be77bd08c0f) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresInputTest.cs (.../ClosingStructuresInputTest.cs) (revision 1a6804681b0758a5761e39099e4b6de65f9cf4a2) @@ -164,12 +164,16 @@ } [Test] - public void Properties_DeviationWaveDirection_ExpectedValues() + [TestCase(360.004)] + [TestCase(300)] + [TestCase(0)] + [TestCase(-360.004)] + [TestCase(double.NaN)] + public void Properties_DeviationWaveDirection_ExpectedValues(double validValue) { // Setup - var random = new Random(22); var input = new ClosingStructuresInput(); - var deviationWaveDirection = new RoundedDouble(5, random.NextDouble()); + var deviationWaveDirection = new RoundedDouble(5, validValue); // Call input.DeviationWaveDirection = deviationWaveDirection; @@ -179,6 +183,25 @@ AssertAreEqual(deviationWaveDirection, input.DeviationWaveDirection); } + [Test] + [TestCase(400)] + [TestCase(360.05)] + [TestCase(-360.005)] + [TestCase(-400)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + public void Properties_StructureNormalOrientationInValidValues_ThrowsArgumentOutOfRangeException(double invalidValue) + { + // Setup + var input = new ClosingStructuresInput(); + + // Call + TestDelegate call = () => input.DeviationWaveDirection = (RoundedDouble) invalidValue; + + // Assert + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "De waarde voor afwijking golfrichting moet in het bereik [-360, 360] liggen."); + } + #endregion #region Model factors