Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Service.Test/WaveConditionsCalculationServiceBaseTest.cs =================================================================== diff -u -r87b3dec8abf9077375a10deb16d508d9cc2711e4 -re674bb3e0b3e4f2e66080348b8e6acfa48137bb1 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Service.Test/WaveConditionsCalculationServiceBaseTest.cs (.../WaveConditionsCalculationServiceBaseTest.cs) (revision 87b3dec8abf9077375a10deb16d508d9cc2711e4) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Service.Test/WaveConditionsCalculationServiceBaseTest.cs (.../WaveConditionsCalculationServiceBaseTest.cs) (revision e674bb3e0b3e4f2e66080348b8e6acfa48137bb1) @@ -317,6 +317,7 @@ input.ForeshoreProfile = null; input.UseBreakWater = false; input.UseForeshore = false; + input.Orientation = (RoundedDouble) 0; break; case CalculationType.ForeshoreWithoutBreakWater: input.ForeshoreProfile = CreateForeshoreProfile(null); @@ -367,7 +368,8 @@ LowerBoundaryRevetment = (RoundedDouble) 3, StepSize = WaveConditionsInputStepSize.Two, UseBreakWater = useBreakWater, - UseForeshore = useForeshore + UseForeshore = useForeshore, + Orientation = (RoundedDouble) 0 }; string hcldFilePath = "C:\\temp\\someFile"; @@ -393,6 +395,37 @@ } [Test] + public void Validate_StructureNormalOrientationInvalid_ReturnsFalse() + { + // Setup + string name = "test"; + bool isValid = false; + + var dbFilePath = Path.Combine(testDataPath, "HRD ijsselmeer.sqlite"); + + WaveConditionsInput input = GetDefaultValidationInput(); + input.Orientation = (RoundedDouble) double.NaN; + + // Call + Action action = () => isValid = new WaveConditionsCalculationService().PublicValidateWaveConditionsInput(input, + name, + dbFilePath, + "DesignWaterLevelName"); + + // Assert + TestHelper.AssertLogMessages(action, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(3, msgs.Length); + StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", name), msgs[0]); + StringAssert.StartsWith("Validatie mislukt: Er is geen concreet getal ingevoerd voor 'oriƫntatie'.", msgs[1]); + StringAssert.StartsWith(string.Format("Validatie van '{0}' beƫindigd om: ", name), msgs[2]); + }); + + Assert.IsFalse(isValid); + } + + [Test] public void Calculate_CalculationOutputNull_LogError() { // Setup @@ -507,7 +540,8 @@ UpperBoundaryRevetment = (RoundedDouble) 10.0, StepSize = WaveConditionsInputStepSize.One, LowerBoundaryWaterLevels = (RoundedDouble) 1.0, - UpperBoundaryWaterLevels = (RoundedDouble) 10.0 + UpperBoundaryWaterLevels = (RoundedDouble) 10.0, + Orientation = (RoundedDouble) 0 }; return input; }