Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs
===================================================================
diff -u -r0e9146a3375e69a172409554b934db2cc14b3f84 -r2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs (.../MacroStabilityInwardsCalculator.cs) (revision 0e9146a3375e69a172409554b934db2cc14b3f84)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs (.../MacroStabilityInwardsCalculator.cs) (revision 2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc)
@@ -24,6 +24,7 @@
using System.Linq;
using Deltares.WTIStability.Data.Geo;
using Ringtoets.MacroStabilityInwards.KernelWrapper.Creators;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Result;
using Ringtoets.MacroStabilityInwards.KernelWrapper.SubCalculator;
using Ringtoets.MacroStabilityInwards.Primitives.MacroStabilityInwardsSoilUnderSurfaceLine;
@@ -69,7 +70,8 @@
{
IUpliftVanCalculator upliftVanCalculator = CalculateUpliftVan();
- return new MacroStabilityInwardsCalculatorResult(new MacroStabilityInwardsCalculatorResult.ConstructionProperties
+ return new MacroStabilityInwardsCalculatorResult(null, null,
+ new MacroStabilityInwardsCalculatorResult.ConstructionProperties
{
FactorOfStability = upliftVanCalculator.FactoryOfStability,
ZValue = upliftVanCalculator.ZValue,
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorResult.cs
===================================================================
diff -u -r0e9146a3375e69a172409554b934db2cc14b3f84 -r2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorResult.cs (.../MacroStabilityInwardsCalculatorResult.cs) (revision 0e9146a3375e69a172409554b934db2cc14b3f84)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorResult.cs (.../MacroStabilityInwardsCalculatorResult.cs) (revision 2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Result;
namespace Ringtoets.MacroStabilityInwards.KernelWrapper
{
@@ -32,54 +33,32 @@
/// Creates a new instance of .
/// The result will hold all the values which were given.
///
+ /// The sliding curve result.
+ /// The upliftVan calculation grid result.
/// The container of the properties for the
///
- /// Thrown when the
- /// is null.
- internal MacroStabilityInwardsCalculatorResult(ConstructionProperties properties)
+ /// Thrown when any
+ /// parameter is null.
+ internal MacroStabilityInwardsCalculatorResult(MacroStabilityInwardsSlidingCurveResult slidingCurve,
+ MacroStabilityInwardsUpliftVanCalculationGridResult upliftVanCalculationGrid,
+ ConstructionProperties properties)
{
if (properties == null)
{
throw new ArgumentNullException(nameof(properties));
}
+ SlidingCurve = slidingCurve;
+ UpliftVanCalculationGrid = upliftVanCalculationGrid;
+
FactorOfStability = properties.FactorOfStability;
ZValue = properties.ZValue;
ForbiddenZonesXEntryMin = properties.ForbiddenZonesXEntryMin;
ForbiddenZonesXEntryMax = properties.ForbiddenZonesXEntryMax;
ForbiddenZonesAutomaticallyCalculated = properties.ForbiddenZonesAutomaticallyCalculated;
}
- #region properties
-
///
- /// Gets the factor of stability of the uplift van calculation.
- ///
- public double FactorOfStability { get; }
-
- ///
- /// Gets the z value.
- ///
- public double ZValue { get; }
-
- ///
- /// Gets the forbidden zones x entry min.
- ///
- public double ForbiddenZonesXEntryMin { get; }
-
- ///
- /// Gets the forbidden zones x entry max.
- ///
- public double ForbiddenZonesXEntryMax { get; }
-
- ///
- /// Gets whether the forbidden zones are automatically calculated.
- ///
- public bool ForbiddenZonesAutomaticallyCalculated { get; }
-
- #endregion
-
- ///
/// Container for properties for constructing a .
/// s
public class ConstructionProperties
@@ -96,7 +75,7 @@
}
///
- /// Gets or sets the factor of stability of the uplift van calculation.
+ /// Gets or sets the factor of stability of the upliftVan calculation.
///
public double FactorOfStability { internal get; set; }
@@ -120,5 +99,44 @@
///
public bool ForbiddenZonesAutomaticallyCalculated { internal get; set; }
}
+
+ #region properties
+
+ ///
+ /// Gets the sliding curve result.
+ ///
+ public MacroStabilityInwardsSlidingCurveResult SlidingCurve { get; }
+
+ ///
+ /// Gets the upliftVan calculation grid result.
+ ///
+ public MacroStabilityInwardsUpliftVanCalculationGridResult UpliftVanCalculationGrid { get; }
+
+ ///
+ /// Gets the factor of stability of the upliftVan calculation.
+ ///
+ public double FactorOfStability { get; }
+
+ ///
+ /// Gets the z value.
+ ///
+ public double ZValue { get; }
+
+ ///
+ /// Gets the forbidden zones x entry min.
+ ///
+ public double ForbiddenZonesXEntryMin { get; }
+
+ ///
+ /// Gets the forbidden zones x entry max.
+ ///
+ public double ForbiddenZonesXEntryMax { get; }
+
+ ///
+ /// Gets whether the forbidden zones are automatically calculated.
+ ///
+ public bool ForbiddenZonesAutomaticallyCalculated { get; }
+
+ #endregion
}
}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Result/MacroStabilityInwardsUpliftVanCalculationGridResult.cs
===================================================================
diff -u -rec61461326a925d109c7a58600a8fe3ee4c2b31c -r2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Result/MacroStabilityInwardsUpliftVanCalculationGridResult.cs (.../MacroStabilityInwardsUpliftVanCalculationGridResult.cs) (revision ec61461326a925d109c7a58600a8fe3ee4c2b31c)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Result/MacroStabilityInwardsUpliftVanCalculationGridResult.cs (.../MacroStabilityInwardsUpliftVanCalculationGridResult.cs) (revision 2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc)
@@ -25,7 +25,7 @@
namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Result
{
///
- /// The uplift van calculation grid result of a macro stability calculation.
+ /// The upliftVan calculation grid result of a macro stability calculation.
///
public class MacroStabilityInwardsUpliftVanCalculationGridResult
{
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/IUpliftVanCalculator.cs
===================================================================
diff -u -r1f741e6208690a17217cea730557aa10f09bd8ec -r2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/IUpliftVanCalculator.cs (.../IUpliftVanCalculator.cs) (revision 1f741e6208690a17217cea730557aa10f09bd8ec)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/IUpliftVanCalculator.cs (.../IUpliftVanCalculator.cs) (revision 2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc)
@@ -60,7 +60,7 @@
double MaximumSliceWidth { set; }
///
- /// Sets the slip plane uplift van.
+ /// Sets the slip plane upliftVan.
///
SlipPlaneUpliftVan SlipPlaneUpliftVan { set; }
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorResultTest.cs
===================================================================
diff -u -r0e9146a3375e69a172409554b934db2cc14b3f84 -r2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorResultTest.cs (.../MacroStabilityInwardsCalculatorResultTest.cs) (revision 0e9146a3375e69a172409554b934db2cc14b3f84)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorResultTest.cs (.../MacroStabilityInwardsCalculatorResultTest.cs) (revision 2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc)
@@ -22,6 +22,8 @@
using System;
using Core.Common.TestUtil;
using NUnit.Framework;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Result;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Result;
namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test
{
@@ -31,19 +33,49 @@
[Test]
public void Constructor_ConstructionPropertiesNull_ThrowsArgumentNullException()
{
+ // Setup
+ MacroStabilityInwardsSlidingCurveResult curve = MacroStabilityInwardsSlidingCurveResultTestFactory.Create();
+ var upliftVanCalculationGrid = new MacroStabilityInwardsUpliftVanCalculationGridResult(MacroStabilityInwardsGridResultTestFactory.Create(),
+ MacroStabilityInwardsGridResultTestFactory.Create(),
+ new double[0]);
+
// Call
- TestDelegate call = () => new MacroStabilityInwardsCalculatorResult(null);
+ TestDelegate call = () => new MacroStabilityInwardsCalculatorResult(curve, upliftVanCalculationGrid, null);
// Assert
var exception = Assert.Throws(call);
Assert.AreEqual("properties", exception.ParamName);
}
[Test]
+ public void Constructor_WithParameters_ExpectedValues()
+ {
+ // Setup
+ MacroStabilityInwardsSlidingCurveResult curve = MacroStabilityInwardsSlidingCurveResultTestFactory.Create();
+ var upliftVanCalculationGrid = new MacroStabilityInwardsUpliftVanCalculationGridResult(MacroStabilityInwardsGridResultTestFactory.Create(),
+ MacroStabilityInwardsGridResultTestFactory.Create(),
+ new double[0]);
+
+ // Call
+ var result = new MacroStabilityInwardsCalculatorResult(curve, upliftVanCalculationGrid, new MacroStabilityInwardsCalculatorResult.ConstructionProperties());
+
+ // Assert
+ Assert.AreSame(curve, result.SlidingCurve);
+ Assert.AreSame(upliftVanCalculationGrid, result.UpliftVanCalculationGrid);
+ }
+
+ [Test]
public void Constructor_EmptyConstructionProperties_ExpectedValues()
{
+ // Setup
+ MacroStabilityInwardsSlidingCurveResult curve = MacroStabilityInwardsSlidingCurveResultTestFactory.Create();
+ var upliftVanCalculationGrid = new MacroStabilityInwardsUpliftVanCalculationGridResult(MacroStabilityInwardsGridResultTestFactory.Create(),
+ MacroStabilityInwardsGridResultTestFactory.Create(),
+ new double[0]);
+
// Call
- var result = new MacroStabilityInwardsCalculatorResult(new MacroStabilityInwardsCalculatorResult.ConstructionProperties());
+ var result = new MacroStabilityInwardsCalculatorResult(curve, upliftVanCalculationGrid,
+ new MacroStabilityInwardsCalculatorResult.ConstructionProperties());
// Assert
Assert.IsNaN(result.FactorOfStability);
@@ -73,8 +105,13 @@
ForbiddenZonesAutomaticallyCalculated = forbiddenZonesAutomaticallyCalculated
};
+ MacroStabilityInwardsSlidingCurveResult curve = MacroStabilityInwardsSlidingCurveResultTestFactory.Create();
+ var upliftVanCalculationGrid = new MacroStabilityInwardsUpliftVanCalculationGridResult(MacroStabilityInwardsGridResultTestFactory.Create(),
+ MacroStabilityInwardsGridResultTestFactory.Create(),
+ new double[0]);
+
// Call
- var result = new MacroStabilityInwardsCalculatorResult(constructionProperties);
+ var result = new MacroStabilityInwardsCalculatorResult(curve, upliftVanCalculationGrid, constructionProperties);
// Assert
Assert.AreEqual(factorOfStability, result.FactorOfStability);
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Result/MacroStabilityInwardsSlidingCurveResultTest.cs
===================================================================
diff -u -rf79fd1627089fd5c8887fd7c19ca5e75df6db29d -r2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Result/MacroStabilityInwardsSlidingCurveResultTest.cs (.../MacroStabilityInwardsSlidingCurveResultTest.cs) (revision f79fd1627089fd5c8887fd7c19ca5e75df6db29d)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Result/MacroStabilityInwardsSlidingCurveResultTest.cs (.../MacroStabilityInwardsSlidingCurveResultTest.cs) (revision 2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc)
@@ -24,7 +24,6 @@
using Core.Common.Base.Geometry;
using NUnit.Framework;
using Ringtoets.MacroStabilityInwards.KernelWrapper.Result;
-using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil;
using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Result;
namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Result
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Result/MacroStabilityInwardsSlidingCurveResultTestFactory.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Result/MacroStabilityInwardsSlidingCurveResultTestFactory.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Result/MacroStabilityInwardsSlidingCurveResultTestFactory.cs (revision 2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc)
@@ -0,0 +1,45 @@
+// 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.Linq;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Result;
+
+namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Result
+{
+ ///
+ /// Factory to create simple
+ /// instances that can be used for testing.
+ ///
+ public static class MacroStabilityInwardsSlidingCurveResultTestFactory
+ {
+ ///
+ /// Creates a new .
+ ///
+ /// The created .
+ public static MacroStabilityInwardsSlidingCurveResult Create()
+ {
+ return new MacroStabilityInwardsSlidingCurveResult(
+ MacroStabilityInwardsSlidingCircleResultTestFactory.CreateCircle(),
+ MacroStabilityInwardsSlidingCircleResultTestFactory.CreateCircle(),
+ Enumerable.Empty(), 0, 0);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj
===================================================================
diff -u -rec61461326a925d109c7a58600a8fe3ee4c2b31c -r2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj) (revision ec61461326a925d109c7a58600a8fe3ee4c2b31c)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj) (revision 2c63c29d4e7a6ea52e12ab8ae673c5681a3fb2fc)
@@ -54,6 +54,7 @@
+