Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/IUpliftVanCalculator.cs
===================================================================
diff -u -r0e9146a3375e69a172409554b934db2cc14b3f84 -r1f741e6208690a17217cea730557aa10f09bd8ec
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/IUpliftVanCalculator.cs (.../IUpliftVanCalculator.cs) (revision 0e9146a3375e69a172409554b934db2cc14b3f84)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/IUpliftVanCalculator.cs (.../IUpliftVanCalculator.cs) (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
@@ -119,7 +119,7 @@
///
/// Gets the sliding curve.
///
- SlidingCurve SlidingCurve { get; }
+ SlidingDualCircle SlidingCurve { get; }
///
/// Gets the slip plane.
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/UpliftVanCalculator.cs
===================================================================
diff -u -r0e9146a3375e69a172409554b934db2cc14b3f84 -r1f741e6208690a17217cea730557aa10f09bd8ec
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/UpliftVanCalculator.cs (.../UpliftVanCalculator.cs) (revision 0e9146a3375e69a172409554b934db2cc14b3f84)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/UpliftVanCalculator.cs (.../UpliftVanCalculator.cs) (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
@@ -176,7 +176,7 @@
public bool ForbiddenZonesAutomaticallyCalculated { get; private set; }
- public SlidingCurve SlidingCurve { get; private set; }
+ public SlidingDualCircle SlidingCurve { get; private set; }
public SlipPlaneUpliftVan SlipPlane { get; private set; }
@@ -206,7 +206,7 @@
ForbiddenZonesXEntryMax = convertedResult.XMaxEntry;
ForbiddenZonesAutomaticallyCalculated = convertedResult.AreForbiddenZonesAuto;
- SlidingCurve = convertedResult.Curve;
+ SlidingCurve = (SlidingDualCircle) convertedResult.Curve;
SlipPlane = convertedResult.SlipPlaneUpliftVan;
}
}
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlidingCircle.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlidingCircle.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlidingCircle.cs (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
@@ -0,0 +1,66 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using Core.Common.Base.Geometry;
+
+namespace Ringtoets.MacroStabilityInwards.Primitives.Output
+{
+ ///
+ /// The sliding circle result of a macro stability calculation.
+ ///
+ public class MacroStabilityInwardsSlidingCircle
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The center coordinate of the circle.
+ /// The radius of the circle.
+ /// Indicator whether the circle is active or not.
+ /// Thrown when
+ /// is null.
+ public MacroStabilityInwardsSlidingCircle(Point2D center, double radius, bool isActive)
+ {
+ if (center == null)
+ {
+ throw new ArgumentNullException(nameof(center));
+ }
+ Center = center;
+ Radius = radius;
+ IsActive = isActive;
+ }
+
+ ///
+ /// Gets the center coordinate of the circle.
+ ///
+ public Point2D Center { get; }
+
+ ///
+ /// Gets the radius of the circle.
+ ///
+ public double Radius { get; }
+
+ ///
+ /// Gets whether the circle is the active circle or not.
+ ///
+ public bool IsActive { get; }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlidingCurve.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlidingCurve.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlidingCurve.cs (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
@@ -0,0 +1,63 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+
+namespace Ringtoets.MacroStabilityInwards.Primitives.Output
+{
+ ///
+ /// The sliding curve result of a macro stability calculation.
+ ///
+ public class MacroStabilityInwardsSlidingCurve
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The left circle of the curve.
+ /// The right circle of the curve.
+ /// Thrown when any parameter
+ /// is null.
+ public MacroStabilityInwardsSlidingCurve(MacroStabilityInwardsSlidingCircle leftCircle, MacroStabilityInwardsSlidingCircle rightCircle)
+ {
+ if (leftCircle == null)
+ {
+ throw new ArgumentNullException(nameof(leftCircle));
+ }
+ if (rightCircle == null)
+ {
+ throw new ArgumentNullException(nameof(rightCircle));
+ }
+
+ LeftCircle = leftCircle;
+ RightCircle = rightCircle;
+ }
+
+ ///
+ /// Gets the left circle.
+ ///
+ public MacroStabilityInwardsSlidingCircle LeftCircle { get; }
+
+ ///
+ /// Gets the right circle.
+ ///
+ public MacroStabilityInwardsSlidingCircle RightCircle { get; }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj
===================================================================
diff -u -r388ce371afb320cab772545f0292d1954fdc38ef -r1f741e6208690a17217cea730557aa10f09bd8ec
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.csproj) (revision 388ce371afb320cab772545f0292d1954fdc38ef)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.csproj) (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
@@ -54,6 +54,8 @@
+
+
Resources.resx
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs
===================================================================
diff -u -r35bb3fb2239c0f3633155ccea59b2b3bad28f52d -r1f741e6208690a17217cea730557aa10f09bd8ec
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs (.../MacroStabilityInwardsCalculatorTest.cs) (revision 35bb3fb2239c0f3633155ccea59b2b3bad28f52d)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs (.../MacroStabilityInwardsCalculatorTest.cs) (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
@@ -58,7 +58,7 @@
}
[Test]
- public void Calculate_Always_ReturnResult()
+ public void Calculate_CompleteValidInput_ReturnsResult()
{
// Setup
var input = new MacroStabilityInwardsCalculatorInput(CreateSimpleConstructionProperties());
@@ -69,6 +69,10 @@
// Assert
Assert.IsNotNull(actual);
+ Assert.IsFalse(double.IsNaN(actual.FactorOfStability));
+ Assert.IsFalse(double.IsNaN(actual.ZValue));
+ Assert.IsFalse(double.IsNaN(actual.ForbiddenZonesXEntryMax));
+ Assert.IsFalse(double.IsNaN(actual.ForbiddenZonesXEntryMin));
Assert.IsTrue(testMacroStabilityInwardsSubCalculatorFactory.LastCreatedUpliftVanCalculator.Calculated);
}
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/UpliftVanCalculatorStub.cs
===================================================================
diff -u -r0e9146a3375e69a172409554b934db2cc14b3f84 -r1f741e6208690a17217cea730557aa10f09bd8ec
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/UpliftVanCalculatorStub.cs (.../UpliftVanCalculatorStub.cs) (revision 0e9146a3375e69a172409554b934db2cc14b3f84)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/UpliftVanCalculatorStub.cs (.../UpliftVanCalculatorStub.cs) (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
@@ -69,7 +69,7 @@
public bool ForbiddenZonesAutomaticallyCalculated { get; set; }
- public SlidingCurve SlidingCurve { get; set; }
+ public SlidingDualCircle SlidingCurve { get; set; }
public SlipPlaneUpliftVan SlipPlane { get; set; }
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSlidingCircleTest.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSlidingCircleTest.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSlidingCircleTest.cs (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
@@ -0,0 +1,62 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using Core.Common.Base.Geometry;
+using Core.Common.TestUtil;
+using NUnit.Framework;
+using Ringtoets.MacroStabilityInwards.Primitives.Output;
+
+namespace Ringtoets.MacroStabilityInwards.Primitives.Test.Output
+{
+ [TestFixture]
+ public class MacroStabilityInwardsSlidingCircleTest
+ {
+ [Test]
+ public void Constructor_CenterNull_ThrowsArgumentNullException()
+ {
+ // Call
+ TestDelegate call = () => new MacroStabilityInwardsSlidingCircle(null, 0.1, true);
+
+ // Assert
+ var exception = Assert.Throws(call);
+ Assert.AreEqual("center", exception.ParamName);
+ }
+
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var random = new Random(11);
+ var center = new Point2D(random.NextDouble(), random.NextDouble());
+ double radius = random.NextDouble();
+ bool isActive = random.NextBoolean();
+
+ // Call
+ var circle = new MacroStabilityInwardsSlidingCircle(center, radius, isActive);
+
+ // Assert
+ Assert.AreEqual(center, circle.Center);
+ Assert.AreEqual(radius, circle.Radius);
+ Assert.AreEqual(isActive, circle.IsActive);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSlidingCurveTest.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSlidingCurveTest.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSlidingCurveTest.cs (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
@@ -0,0 +1,75 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using Core.Common.Base.Geometry;
+using NUnit.Framework;
+using Ringtoets.MacroStabilityInwards.Primitives.Output;
+
+namespace Ringtoets.MacroStabilityInwards.Primitives.Test.Output
+{
+ [TestFixture]
+ public class MacroStabilityInwardsSlidingCurveTest
+ {
+ [Test]
+ public void Constructor_LeftCircleNull_ThrowsArgumentNullException()
+ {
+ // Setup
+ var rightCircle = new MacroStabilityInwardsSlidingCircle(new Point2D(0, 0), 3, false);
+
+ // Call
+ TestDelegate call = () => new MacroStabilityInwardsSlidingCurve(null, rightCircle);
+
+ // Assert
+ var exception = Assert.Throws(call);
+ Assert.AreEqual("leftCircle", exception.ParamName);
+ }
+
+ [Test]
+ public void Constructor_RightCircleNull_ThrowsArgumentNullException()
+ {
+ // Setup
+ var leftCircle = new MacroStabilityInwardsSlidingCircle(new Point2D(0, 0), 3, true);
+
+ // Call
+ TestDelegate call = () => new MacroStabilityInwardsSlidingCurve(leftCircle, null);
+
+ // Assert
+ var exception = Assert.Throws(call);
+ Assert.AreEqual("rightCircle", exception.ParamName);
+ }
+
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var leftCircle = new MacroStabilityInwardsSlidingCircle(new Point2D(0, 0), 5, true);
+ var rightCircle = new MacroStabilityInwardsSlidingCircle(new Point2D(10, 10), 2, false);
+
+ // Call
+ var curve = new MacroStabilityInwardsSlidingCurve(leftCircle, rightCircle);
+
+ // Assert
+ Assert.AreSame(leftCircle, curve.LeftCircle);
+ Assert.AreSame(rightCircle, curve.RightCircle);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj
===================================================================
diff -u -r388ce371afb320cab772545f0292d1954fdc38ef -r1f741e6208690a17217cea730557aa10f09bd8ec
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.Test.csproj) (revision 388ce371afb320cab772545f0292d1954fdc38ef)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.Test.csproj) (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
@@ -64,6 +64,8 @@
+
+