Index: Riskeer/Revetment/test/Riskeer.Revetment.Data.Test/WaveConditionsInputHelperTest.cs =================================================================== diff -u -rdf06804d1c7938e2cc4600e12968c78b396edc07 -r46f67cbfb21c6a0d524d242cddaadd5103c86151 --- Riskeer/Revetment/test/Riskeer.Revetment.Data.Test/WaveConditionsInputHelperTest.cs (.../WaveConditionsInputHelperTest.cs) (revision df06804d1c7938e2cc4600e12968c78b396edc07) +++ Riskeer/Revetment/test/Riskeer.Revetment.Data.Test/WaveConditionsInputHelperTest.cs (.../WaveConditionsInputHelperTest.cs) (revision 46f67cbfb21c6a0d524d242cddaadd5103c86151) @@ -168,6 +168,25 @@ } [Test] + public void GetTargetProbability_InputWithInvalidWaterLevelType_ThrowsInvalidEnumArgumentException() + { + // Setup + const WaveConditionsInputWaterLevelType waterLevelType = (WaveConditionsInputWaterLevelType) 99; + var waveConditionsInput = new TestWaveConditionsInput + { + WaterLevelType = waterLevelType + }; + + // Call + void Call() => WaveConditionsInputHelper.GetTargetProbability(waveConditionsInput, new AssessmentSectionStub()); + + // Assert + var expectedMessage = $"The value of argument 'WaterLevelType' ({(int) waterLevelType}) is invalid for Enum type '{nameof(WaveConditionsInputWaterLevelType)}'."; + var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage); + Assert.AreEqual("WaterLevelType", exception.ParamName); + } + + [Test] public void GetAssessmentLevel_InputNull_ThrowsArgumentNullException() { // Call @@ -188,5 +207,24 @@ var exception = Assert.Throws(Call); Assert.AreEqual("assessmentSection", exception.ParamName); } + + [Test] + public void GetAssessmentLevel_InputWithInvalidWaterLevelType_ThrowsInvalidEnumArgumentException() + { + // Setup + const WaveConditionsInputWaterLevelType waterLevelType = (WaveConditionsInputWaterLevelType) 99; + var waveConditionsInput = new TestWaveConditionsInput + { + WaterLevelType = waterLevelType + }; + + // Call + void Call() => WaveConditionsInputHelper.GetAssessmentLevel(waveConditionsInput, new AssessmentSectionStub()); + + // Assert + var expectedMessage = $"The value of argument 'WaterLevelType' ({(int) waterLevelType}) is invalid for Enum type '{nameof(WaveConditionsInputWaterLevelType)}'."; + var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage); + Assert.AreEqual("WaterLevelType", exception.ParamName); + } } } \ No newline at end of file