Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsInputValidator.cs =================================================================== diff -u -r9655570a15a7fff650337906cb33de8042312c29 -r0c5bcfd7a61efa90f83d11dd36c4d8582a78d63f --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsInputValidator.cs (.../MacroStabilityInwardsInputValidator.cs) (revision 9655570a15a7fff650337906cb33de8042312c29) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsInputValidator.cs (.../MacroStabilityInwardsInputValidator.cs) (revision 0c5bcfd7a61efa90f83d11dd36c4d8582a78d63f) @@ -64,6 +64,7 @@ { validationResults.AddRange(ValidateSoilLayers(inputParameters)); validationResults.AddRange(ValidateZoneBoundaries(inputParameters)); + validationResults.AddRange(ValidateTangentLines(inputParameters)); } return validationResults; @@ -116,6 +117,15 @@ } } + private static IEnumerable ValidateTangentLines(MacroStabilityInwardsInput inputParameters) + { + if (inputParameters.TangentLineZTop == inputParameters.TangentLineZBottom + && inputParameters.TangentLineNumber != 1) + { + yield return Resources.MacroStabilityInwardsInputValidator_ValidateTangentLines_TangentLineNumber_must_be_one_when_TangentLineTop_equals_TangentLineBottom; + } + } + private static bool ValidateTopOfProfileExceedsSurfaceLineTop(IMacroStabilityInwardsWaternetInput inputParameters, MacroStabilityInwardsSoilProfile1D soilProfile1D) { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.Designer.cs =================================================================== diff -u -r9655570a15a7fff650337906cb33de8042312c29 -r0c5bcfd7a61efa90f83d11dd36c4d8582a78d63f --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9655570a15a7fff650337906cb33de8042312c29) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 0c5bcfd7a61efa90f83d11dd36c4d8582a78d63f) @@ -171,6 +171,16 @@ } /// + /// Looks up a localized string similar to Het aantal tangentlijnen moet 1 zijn wanneer tangentlijn Z-boven gelijk is aan tangentlijn Z-onder.. + /// + internal static string MacroStabilityInwardsInputValidator_ValidateTangentLines_TangentLineNumber_must_be_one_when_TangentLineTop_equals_TangentLineBottom { + get { + return ResourceManager.GetString("MacroStabilityInwardsInputValidator_ValidateTangentLines_TangentLineNumber_must_b" + + "e_one_when_TangentLineTop_equals_TangentLineBottom", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Zoneringsgrens links moet kleiner zijn dan of gelijk zijn aan zoneringsgrens rechts.. /// internal static string MacroStabilityInwardsInputValidator_ValidateZoneBoundaries_ZoneBoundaries_BoundaryLeft_should_be_smaller_than_or_equal_to_BoundaryRight { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.resx =================================================================== diff -u -r9655570a15a7fff650337906cb33de8042312c29 -r0c5bcfd7a61efa90f83d11dd36c4d8582a78d63f --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.resx (.../Resources.resx) (revision 9655570a15a7fff650337906cb33de8042312c29) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.resx (.../Resources.resx) (revision 0c5bcfd7a61efa90f83d11dd36c4d8582a78d63f) @@ -150,4 +150,7 @@ Zoneringsgrens links moet kleiner zijn dan of gelijk zijn aan zoneringsgrens rechts. + + Het aantal tangentlijnen moet 1 zijn wanneer tangentlijn Z-boven gelijk is aan tangentlijn Z-onder. + \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs =================================================================== diff -u -r08a1d37783424699debf8c053dc95a75df38d8dc -r0c5bcfd7a61efa90f83d11dd36c4d8582a78d63f --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs (.../MacroStabilityInwardsInputValidatorTest.cs) (revision 08a1d37783424699debf8c053dc95a75df38d8dc) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs (.../MacroStabilityInwardsInputValidatorTest.cs) (revision 0c5bcfd7a61efa90f83d11dd36c4d8582a78d63f) @@ -360,6 +360,54 @@ CollectionAssert.IsEmpty(messages); } + [Test] + public void Validate_MultipleTangentLinesWithTangentLineTopAndBottomSame_ReturnsError() + { + // Setup + input.TangentLineNumber = 3; + input.TangentLineZTop = (RoundedDouble) 1.5; + input.TangentLineZBottom = (RoundedDouble) 1.5; + + // Call + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input).ToArray(); + + // Assert + CollectionAssert.AreEqual(new[] + { + "Het aantal tangentlijnen moet 1 zijn wanneer tangentlijn Z-boven gelijk is aan tangentlijn Z-onder." + }, messages); + } + + [Test] + public void Validate_MultipleTangentLinesWithTangentLineTopAndBottomNotSame_ReturnsEmpty() + { + // Setup + input.TangentLineNumber = 4; + input.TangentLineZTop = (RoundedDouble) 1.5; + input.TangentLineZBottom = (RoundedDouble) 0.2; + + // Call + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input).ToArray(); + + // Assert + CollectionAssert.IsEmpty(messages); + } + + [Test] + public void Validate_SingleTangentLineWithTangentLineTopAndBottomSame_ReturnsEmpty() + { + // Setup + input.TangentLineNumber = 1; + input.TangentLineZTop = (RoundedDouble) 1.59; + input.TangentLineZBottom = (RoundedDouble) 1.59; + + // Call + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input).ToArray(); + + // Assert + CollectionAssert.IsEmpty(messages); + } + private static IEnumerable SurfacelineNotOnMacroStabilityInwardsSoilProfile2D() { yield return new TestCaseData(