Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanSlipPlaneConstraints.cs
===================================================================
diff -u -rbf1e2809138eed48e7c2b769e038378cfa1a1ecd -r5e06c7c77b595f59f9015775ed2748a28a8bb92e
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanSlipPlaneConstraints.cs (.../UpliftVanSlipPlaneConstraints.cs) (revision bf1e2809138eed48e7c2b769e038378cfa1a1ecd)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanSlipPlaneConstraints.cs (.../UpliftVanSlipPlaneConstraints.cs) (revision 5e06c7c77b595f59f9015775ed2748a28a8bb92e)
@@ -29,41 +29,44 @@
///
/// Creates a new instance of .
///
+ /// The slip plane minimum depth.
+ /// The slip plane minimum length.
+ /// Indicator whether zones should be created.
/// The following values are set:
///
- /// - is set to false;
- /// - is set to false;
+ /// - is set to true;
/// - is set to ;
- /// - is set to ;
- /// - is set to ;
- /// - is set to .
+ /// - is set to .
///
///
- public UpliftVanSlipPlaneConstraints()
+ public UpliftVanSlipPlaneConstraints(double slipPlaneMinimumDepth,
+ double slipPlaneMinimumLength,
+ bool createZones)
{
- CreateZones = false;
- AutomaticForbiddenZones = false;
+ CreateZones = createZones;
+ AutomaticForbiddenZones = true;
ZoneBoundaryLeft = double.NaN;
ZoneBoundaryRight = double.NaN;
- SlipPlaneMinimumLength = double.NaN;
- SlipPlaneMinimumDepth = double.NaN;
+ SlipPlaneMinimumLength = slipPlaneMinimumLength;
+ SlipPlaneMinimumDepth = slipPlaneMinimumDepth;
}
///
/// Creates a new instance of .
///
- /// Indicator whether zones should be created.
- /// Indicator whether forbidden zones
- /// should be automatically determined.
/// The left zone boundary.
/// The right zone boundary.
/// The slip plane minimum depth.
/// The slip plane minimum length.
- public UpliftVanSlipPlaneConstraints(bool createZones, bool automaticForbiddenZones, double zoneBoundaryLeft,
- double zoneBoundaryRight, double slipPlaneMinimumDepth, double slipPlaneMinimumLength)
+ /// will be set to true and
+ /// will be set to false.
+ public UpliftVanSlipPlaneConstraints(double zoneBoundaryLeft,
+ double zoneBoundaryRight,
+ double slipPlaneMinimumDepth,
+ double slipPlaneMinimumLength)
{
- CreateZones = createZones;
- AutomaticForbiddenZones = automaticForbiddenZones;
+ CreateZones = true;
+ AutomaticForbiddenZones = false;
ZoneBoundaryLeft = zoneBoundaryLeft;
ZoneBoundaryRight = zoneBoundaryRight;
SlipPlaneMinimumDepth = slipPlaneMinimumDepth;
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/UpliftVanSlipPlaneConstraintsConverter.cs
===================================================================
diff -u -rbf1e2809138eed48e7c2b769e038378cfa1a1ecd -r5e06c7c77b595f59f9015775ed2748a28a8bb92e
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/UpliftVanSlipPlaneConstraintsConverter.cs (.../UpliftVanSlipPlaneConstraintsConverter.cs) (revision bf1e2809138eed48e7c2b769e038378cfa1a1ecd)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/UpliftVanSlipPlaneConstraintsConverter.cs (.../UpliftVanSlipPlaneConstraintsConverter.cs) (revision 5e06c7c77b595f59f9015775ed2748a28a8bb92e)
@@ -46,22 +46,17 @@
throw new ArgumentNullException(nameof(input));
}
- if (!input.CreateZones || input.ZoningBoundariesDeterminationType == MacroStabilityInwardsZoningBoundariesDeterminationType.Automatic)
+ if (input.CreateZones && input.ZoningBoundariesDeterminationType == MacroStabilityInwardsZoningBoundariesDeterminationType.Manual)
{
- return new UpliftVanSlipPlaneConstraints(input.CreateZones,
- true,
- double.NaN,
- double.NaN,
+ return new UpliftVanSlipPlaneConstraints(input.ZoneBoundaryLeft,
+ input.ZoneBoundaryRight,
input.SlipPlaneMinimumDepth,
input.SlipPlaneMinimumLength);
}
- return new UpliftVanSlipPlaneConstraints(input.CreateZones,
- false,
- input.ZoneBoundaryLeft,
- input.ZoneBoundaryRight,
- input.SlipPlaneMinimumDepth,
- input.SlipPlaneMinimumLength);
+ return new UpliftVanSlipPlaneConstraints(input.SlipPlaneMinimumDepth,
+ input.SlipPlaneMinimumLength,
+ input.CreateZones);
}
}
}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanCalculatorInputTest.cs
===================================================================
diff -u -ra06f1ed48db991a6604ac72d06107a0f47bf5963 -r5e06c7c77b595f59f9015775ed2748a28a8bb92e
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanCalculatorInputTest.cs (.../UpliftVanCalculatorInputTest.cs) (revision a06f1ed48db991a6604ac72d06107a0f47bf5963)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanCalculatorInputTest.cs (.../UpliftVanCalculatorInputTest.cs) (revision 5e06c7c77b595f59f9015775ed2748a28a8bb92e)
@@ -55,7 +55,7 @@
var drainageConstruction = new DrainageConstruction();
var phreaticLineOffsets = new PhreaticLineOffsets();
var slipPlane = new UpliftVanSlipPlane();
- var slipPlaneConstraints = new UpliftVanSlipPlaneConstraints();
+ var slipPlaneConstraints = new UpliftVanSlipPlaneConstraints(double.NaN, double.NaN, true);
var waternetCreationMode = random.NextEnumValue();
var plLineCreationMethod = random.NextEnumValue();
var landwardDirection = random.NextEnumValue();
@@ -153,7 +153,7 @@
var drainageConstruction = new DrainageConstruction();
var phreaticLineOffsets = new PhreaticLineOffsets();
var slipPlane = new UpliftVanSlipPlane();
- var slipPlaneConstraints = new UpliftVanSlipPlaneConstraints();
+ var slipPlaneConstraints = new UpliftVanSlipPlaneConstraints(double.NaN, double.NaN, true);
// Call
var input = new UpliftVanCalculatorInput(
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanSlipPlaneConstraintsTest.cs
===================================================================
diff -u -rbf1e2809138eed48e7c2b769e038378cfa1a1ecd -r5e06c7c77b595f59f9015775ed2748a28a8bb92e
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanSlipPlaneConstraintsTest.cs (.../UpliftVanSlipPlaneConstraintsTest.cs) (revision bf1e2809138eed48e7c2b769e038378cfa1a1ecd)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanSlipPlaneConstraintsTest.cs (.../UpliftVanSlipPlaneConstraintsTest.cs) (revision 5e06c7c77b595f59f9015775ed2748a28a8bb92e)
@@ -30,43 +30,45 @@
public class UpliftVanSlipPlaneConstraintsTest
{
[Test]
- public void ParameterlessConstructor_ExpectedValues()
+ public void Constructor_WithMinimumLengthDepthAndCreateZones_ExpectedValues()
{
+ // Setup
+ var random = new Random(39);
+ bool createZones = random.NextBoolean();
+ double slipPlaneMinimumLength = random.NextDouble();
+ double slipPlaneMinimumDepth = random.NextDouble();
+
// Call
- var slipPlaneConstraints = new UpliftVanSlipPlaneConstraints();
+ var slipPlaneConstraints = new UpliftVanSlipPlaneConstraints(slipPlaneMinimumDepth, slipPlaneMinimumLength, createZones);
// Assert
- Assert.IsFalse(slipPlaneConstraints.CreateZones);
- Assert.IsFalse(slipPlaneConstraints.AutomaticForbiddenZones);
- Assert.IsNaN(slipPlaneConstraints.SlipPlaneMinimumLength);
- Assert.IsNaN(slipPlaneConstraints.SlipPlaneMinimumDepth);
+ Assert.AreEqual(createZones, slipPlaneConstraints.CreateZones);
+ Assert.IsTrue(slipPlaneConstraints.AutomaticForbiddenZones);
+ Assert.AreEqual(slipPlaneMinimumLength, slipPlaneConstraints.SlipPlaneMinimumLength);
+ Assert.AreEqual(slipPlaneMinimumDepth, slipPlaneConstraints.SlipPlaneMinimumDepth);
Assert.IsNaN(slipPlaneConstraints.ZoneBoundaryLeft);
Assert.IsNaN(slipPlaneConstraints.ZoneBoundaryRight);
}
[Test]
- public void Constructor_WithValues_ReturnsNewInstance()
+ public void Constructor_WithZoneBoundaries_ExpectedValues()
{
// Setup
var random = new Random(39);
- bool createZones = random.NextBoolean();
- bool automaticForbiddenZones = random.NextBoolean();
double slipPlaneMinimumLength = random.NextDouble();
double slipPlaneMinimumDepth = random.NextDouble();
double zoneBoundaryLeft = random.NextDouble();
double zoneBoundaryRight = random.NextDouble();
// Call
- var constraints = new UpliftVanSlipPlaneConstraints(createZones,
- automaticForbiddenZones,
- zoneBoundaryLeft,
+ var constraints = new UpliftVanSlipPlaneConstraints(zoneBoundaryLeft,
zoneBoundaryRight,
slipPlaneMinimumDepth,
slipPlaneMinimumLength);
// Assert
- Assert.AreEqual(createZones, constraints.CreateZones);
- Assert.AreEqual(automaticForbiddenZones, constraints.AutomaticForbiddenZones);
+ Assert.IsTrue(constraints.CreateZones);
+ Assert.IsFalse(constraints.AutomaticForbiddenZones);
Assert.AreEqual(slipPlaneMinimumDepth, constraints.SlipPlaneMinimumDepth);
Assert.AreEqual(slipPlaneMinimumLength, constraints.SlipPlaneMinimumLength);
Assert.AreEqual(zoneBoundaryLeft, constraints.ZoneBoundaryLeft);
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs
===================================================================
diff -u -ra06f1ed48db991a6604ac72d06107a0f47bf5963 -r5e06c7c77b595f59f9015775ed2748a28a8bb92e
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs (.../UpliftVanCalculatorTest.cs) (revision a06f1ed48db991a6604ac72d06107a0f47bf5963)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs (.../UpliftVanCalculatorTest.cs) (revision 5e06c7c77b595f59f9015775ed2748a28a8bb92e)
@@ -313,7 +313,7 @@
PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(),
PhreaticLineOffsetsDaily = new PhreaticLineOffsets(),
SlipPlane = new UpliftVanSlipPlane(),
- SlipPlaneConstraints = new UpliftVanSlipPlaneConstraints()
+ SlipPlaneConstraints = new UpliftVanSlipPlaneConstraints(double.NaN, double.NaN, false)
});
}
@@ -332,7 +332,7 @@
PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(),
PhreaticLineOffsetsDaily = new PhreaticLineOffsets(),
SlipPlane = new UpliftVanSlipPlane(),
- SlipPlaneConstraints = new UpliftVanSlipPlaneConstraints(),
+ SlipPlaneConstraints = new UpliftVanSlipPlaneConstraints(random.NextDouble(), random.NextDouble(), random.NextBoolean()),
WaterLevelRiverAverage = random.NextDouble(),
WaterLevelPolderExtreme = random.NextDouble(),
WaterLevelPolderDaily = random.NextDouble(),
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SlipPlaneConstraintsCreatorTest.cs
===================================================================
diff -u -rbf1e2809138eed48e7c2b769e038378cfa1a1ecd -r5e06c7c77b595f59f9015775ed2748a28a8bb92e
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SlipPlaneConstraintsCreatorTest.cs (.../SlipPlaneConstraintsCreatorTest.cs) (revision bf1e2809138eed48e7c2b769e038378cfa1a1ecd)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SlipPlaneConstraintsCreatorTest.cs (.../SlipPlaneConstraintsCreatorTest.cs) (revision 5e06c7c77b595f59f9015775ed2748a28a8bb92e)
@@ -20,7 +20,6 @@
// All rights reserved.
using System;
-using Core.Common.TestUtil;
using Deltares.WTIStability;
using NUnit.Framework;
using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input;
@@ -46,11 +45,9 @@
{
// Setup
var random = new Random(39);
- var upliftVanSlipPlaneConstraints = new UpliftVanSlipPlaneConstraints(random.NextBoolean(),
- random.NextBoolean(),
+ var upliftVanSlipPlaneConstraints = new UpliftVanSlipPlaneConstraints(random.NextDouble(),
random.NextDouble(),
random.NextDouble(),
- random.NextDouble(),
random.NextDouble());
// Call