Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsInputValidator.cs =================================================================== diff -u -r9368b3ac19481ec8b10dcea903ecdf0fab3048cf -re4e0e6f48ce1decab5f8a3831d8663abc1799fbb --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsInputValidator.cs (.../MacroStabilityInwardsInputValidator.cs) (revision 9368b3ac19481ec8b10dcea903ecdf0fab3048cf) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsInputValidator.cs (.../MacroStabilityInwardsInputValidator.cs) (revision e4e0e6f48ce1decab5f8a3831d8663abc1799fbb) @@ -60,6 +60,7 @@ if (!coreValidationError.Any()) { validationResults.AddRange(ValidateSoilLayers(inputParameters)); + validationResults.AddRange(ValidateTangentLines(inputParameters)); } return validationResults; @@ -87,6 +88,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 -r72b12726b73e7e011bed836163635b64220c23f1 -re4e0e6f48ce1decab5f8a3831d8663abc1799fbb --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 72b12726b73e7e011bed836163635b64220c23f1) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e4e0e6f48ce1decab5f8a3831d8663abc1799fbb) @@ -169,5 +169,15 @@ "Layer", resourceCulture); } } + + /// + /// 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); + } + } } } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.resx =================================================================== diff -u -r72b12726b73e7e011bed836163635b64220c23f1 -re4e0e6f48ce1decab5f8a3831d8663abc1799fbb --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.resx (.../Resources.resx) (revision 72b12726b73e7e011bed836163635b64220c23f1) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Properties/Resources.resx (.../Resources.resx) (revision e4e0e6f48ce1decab5f8a3831d8663abc1799fbb) @@ -144,4 +144,7 @@ De profielschematisatie moet op de ondergrondschematisatie liggen. + + 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 -r9368b3ac19481ec8b10dcea903ecdf0fab3048cf -re4e0e6f48ce1decab5f8a3831d8663abc1799fbb --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs (.../MacroStabilityInwardsInputValidatorTest.cs) (revision 9368b3ac19481ec8b10dcea903ecdf0fab3048cf) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs (.../MacroStabilityInwardsInputValidatorTest.cs) (revision e4e0e6f48ce1decab5f8a3831d8663abc1799fbb) @@ -303,6 +303,56 @@ CollectionAssert.IsEmpty(messages); } + [Test] + public void Validate_MultipleTangentLinesWithTangentLineTopAndBottomSame_ReturnsError() + { + // Setup + var random = new Random(21); + input.TangentLineNumber = random.Next(2, 50); + 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 + var random = new Random(21); + input.TangentLineNumber = random.Next(2, 50); + 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(