Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs =================================================================== diff -u -r01857407572023bc666b15698ded23e5f3363692 -r8d246ac6328e6e649ff6e78dfe3fac210d789ba0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs (.../MacroStabilityInwardsInputValidatorTest.cs) (revision 01857407572023bc666b15698ded23e5f3363692) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs (.../MacroStabilityInwardsInputValidatorTest.cs) (revision 8d246ac6328e6e649ff6e78dfe3fac210d789ba0) @@ -283,7 +283,6 @@ public void Validate_SurfaceLineNear2DProfile_ReturnsEmpty(MacroStabilityInwardsSoilProfile2D soilProfile) { // Setup - var surfaceLine = new MacroStabilityInwardsSurfaceLine("Test"); surfaceLine.SetGeometry(new[] { @@ -304,6 +303,64 @@ } [Test] + public void Validate_ZoneBoundaryRightSmallerThanZoneBoundaryLeft_ReturnsError() + { + // Setup + input.ZoneBoundaryLeft = (RoundedDouble) 0.5; + input.ZoneBoundaryRight = (RoundedDouble) 0.2; + + // Call + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input).ToArray(); + + // Assert + CollectionAssert.AreEqual(new[] + { + "Zoneringsgrens links moet kleiner zijn dan of gelijk zijn aan zoneringsgrens rechts." + }, messages); + } + + [Test] + [SetCulture("nl-NL")] + [TestCase(0.1, 2)] + [TestCase(-2, 0.3)] + public void Validate_ZoneBoundariesOutsideSurfaceLine_ReturnsError(double zoneBoundaryLeft, double zoneBoundaryRight) + { + // Setup + input.ZoneBoundaryLeft = (RoundedDouble) zoneBoundaryLeft; + input.ZoneBoundaryRight = (RoundedDouble) zoneBoundaryRight; + + // Call + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input).ToArray(); + + // Assert + CollectionAssert.AreEqual(new[] + { + "Zoneringsgrenzen moeten op het profiel liggen (bereik [0,0, 0,5])." + }, messages); + } + + [Test] + [TestCase(MacroStabilityInwardsZoningBoundariesDeterminationType.Manual, false)] + [TestCase(MacroStabilityInwardsZoningBoundariesDeterminationType.Automatic, false)] + [TestCase(MacroStabilityInwardsZoningBoundariesDeterminationType.Automatic, true)] + public void Validate_ZoningBoundariesDeterminationTypeManualOrCreateZonesFalse_ReturnsEmpty( + MacroStabilityInwardsZoningBoundariesDeterminationType determinationType, + bool createZones) + { + // Setup + input.ZoneBoundaryLeft = (RoundedDouble) 1; + input.ZoneBoundaryRight = (RoundedDouble) 0.6; + input.ZoningBoundariesDeterminationType = determinationType; + input.CreateZones = createZones; + + // Call + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input).ToArray(); + + // Assert + CollectionAssert.IsEmpty(messages); + } + + [Test] public void Validate_MultipleTangentLinesWithTangentLineTopAndBottomSame_ReturnsError() { // Setup