Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs
===================================================================
diff -u -r686c5eeaad900a6bb627733de8c21bd607f130aa -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs (.../MacroStabilityInwardsChartDataPointsFactory.cs) (revision 686c5eeaad900a6bb627733de8c21bd607f130aa)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs (.../MacroStabilityInwardsChartDataPointsFactory.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -24,7 +24,6 @@
using System.Linq;
using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
-using Core.Common.Utils.Extensions;
using Core.Components.Chart.Data;
using Ringtoets.MacroStabilityInwards.Data;
using Ringtoets.MacroStabilityInwards.Primitives;
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFormattedSoilLayerDataRow.cs
===================================================================
diff -u -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFormattedSoilLayerDataRow.cs (.../MacroStabilityInwardsFormattedSoilLayerDataRow.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFormattedSoilLayerDataRow.cs (.../MacroStabilityInwardsFormattedSoilLayerDataRow.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -40,17 +40,16 @@
/// Creates a new instance of .
///
/// The to format.
- /// The index of the soil layer within the soil profile.
/// Thrown when
/// is null.
- public MacroStabilityInwardsFormattedSoilLayerDataRow(MacroStabilityInwardsSoilLayerData layerData, int layerIndex)
+ public MacroStabilityInwardsFormattedSoilLayerDataRow(MacroStabilityInwardsSoilLayerData layerData)
{
if (layerData == null)
{
throw new ArgumentNullException(nameof(layerData));
}
- MaterialName = $"{layerIndex} {layerData.MaterialName}";
+ MaterialName = layerData.MaterialName;
Color = layerData.Color;
IsAquifer = layerData.IsAquifer;
AbovePhreaticLevel = FormatVariationCoefficientDesignVariableWithShift(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetAbovePhreaticLevel(layerData));
@@ -81,11 +80,13 @@
///
/// Gets the above phreatic level of the layer.
+ /// [kN/m�]
///
public string AbovePhreaticLevel { get; }
///
/// Gets the below phreatic level of the layer.
+ /// [kN/m�]
///
public string BelowPhreaticLevel { get; }
@@ -97,21 +98,25 @@
///
/// Gets the cohesion of the layer.
+ /// [kN/m�]
///
public string Cohesion { get; }
///
/// Gets the friction angle of the layer.
+ /// [�]
///
public string FrictionAngle { get; }
///
/// Gets the shear strength ratio of the layer.
+ /// [-]
///
public string ShearStrengthRatio { get; }
///
/// Gets the strength increase exponent of the layer.
+ /// [-]
///
public string StrengthIncreaseExponent { get; }
@@ -122,36 +127,31 @@
///
/// Gets the POP of the layer.
+ /// [kN/m�]
///
public string Pop { get; }
private static string FormatVariationCoefficientDesignVariable(VariationCoefficientDesignVariable designVariable)
{
RoundedDouble designValue = designVariable.GetDesignValue();
- if (double.IsNaN(designValue))
- {
- return double.NaN.ToString(CultureInfo.CurrentCulture);
- }
-
- return string.Format(RingtoetsCommonFormsResources.VariationCoefficientDesignVariable_0_Mean_1_CoefficientOfVariation_2,
- designValue,
- designVariable.Distribution.Mean,
- designVariable.Distribution.CoefficientOfVariation);
+ return double.IsNaN(designValue)
+ ? double.NaN.ToString(CultureInfo.CurrentCulture)
+ : string.Format(RingtoetsCommonFormsResources.VariationCoefficientDesignVariable_0_Mean_1_CoefficientOfVariation_2,
+ designValue,
+ designVariable.Distribution.Mean,
+ designVariable.Distribution.CoefficientOfVariation);
}
private static string FormatVariationCoefficientDesignVariableWithShift(VariationCoefficientDesignVariable designVariable)
{
RoundedDouble designValue = designVariable.GetDesignValue();
- if (double.IsNaN(designValue))
- {
- return double.NaN.ToString(CultureInfo.CurrentCulture);
- }
-
- return string.Format(RingtoetsCommonFormsResources.VariationCoefficientDesignVariable_0_Mean_1_CoefficientOfVariation_2_Shift_3,
- designValue,
- designVariable.Distribution.Mean,
- designVariable.Distribution.CoefficientOfVariation,
- designVariable.Distribution.Shift);
+ return double.IsNaN(designValue)
+ ? double.NaN.ToString(CultureInfo.CurrentCulture)
+ : string.Format(RingtoetsCommonFormsResources.VariationCoefficientDesignVariable_0_Mean_1_CoefficientOfVariation_2_Shift_3,
+ designValue,
+ designVariable.Distribution.Mean,
+ designVariable.Distribution.CoefficientOfVariation,
+ designVariable.Distribution.Shift);
}
}
}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs
===================================================================
diff -u -r686c5eeaad900a6bb627733de8c21bd607f130aa -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs (.../MacroStabilityInwardsInputView.cs) (revision 686c5eeaad900a6bb627733de8c21bd607f130aa)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs (.../MacroStabilityInwardsInputView.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -296,9 +296,8 @@
IEnumerable soilLayers = GetSoilLayers().Reverse();
- soilLayers.Select((layer, layerIndex) => MacroStabilityInwardsChartDataFactory.CreateSoilLayerChartData(
- $"{layerIndex + 1} {layer.Data.MaterialName}",
- layer.Data.Color))
+ soilLayers.Select((layer, layerIndex) => MacroStabilityInwardsChartDataFactory.CreateSoilLayerChartData(layer.Data.MaterialName,
+ layer.Data.Color))
.ForEachElementDo(sl =>
{
soilProfileChartData.Insert(0, sl);
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputChartControl.cs
===================================================================
diff -u -r686c5eeaad900a6bb627733de8c21bd607f130aa -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputChartControl.cs (.../MacroStabilityInwardsOutputChartControl.cs) (revision 686c5eeaad900a6bb627733de8c21bd607f130aa)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputChartControl.cs (.../MacroStabilityInwardsOutputChartControl.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -61,18 +61,18 @@
private readonly ChartPointData rightGridChartData;
private readonly List soilLayerChartDataLookup;
+
+ private readonly IDictionary phreaticLineExtremeLookup;
+ private readonly IDictionary phreaticLineDailyLookup;
+ private readonly IDictionary waternetLineExtremeLookup;
+ private readonly IDictionary waternetLineDailyLookup;
private MacroStabilityInwardsCalculationScenario data;
private IMacroStabilityInwardsSoilProfile currentSoilProfile;
private MacroStabilityInwardsSurfaceLine currentSurfaceLine;
private MacroStabilityInwardsWaternet currentWaternetExtreme;
private MacroStabilityInwardsWaternet currentWaternetDaily;
- private readonly IDictionary phreaticLineExtremeLookup;
- private readonly IDictionary phreaticLineDailyLookup;
- private readonly IDictionary waternetLineExtremeLookup;
- private readonly IDictionary waternetLineDailyLookup;
-
///
/// Creates a new instance of .
///
@@ -215,9 +215,8 @@
IEnumerable soilLayers = GetSoilLayers().Reverse();
- soilLayers.Select((layer, layerIndex) => MacroStabilityInwardsChartDataFactory.CreateSoilLayerChartData(
- $"{layerIndex + 1} {layer.Data.MaterialName}",
- layer.Data.Color))
+ soilLayers.Select((layer, layerIndex) => MacroStabilityInwardsChartDataFactory.CreateSoilLayerChartData(layer.Data.MaterialName,
+ layer.Data.Color))
.ForEachElementDo(sl =>
{
soilProfileChartData.Insert(0, sl);
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs
===================================================================
diff -u -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs (.../MacroStabilityInwardsSoilLayerDataTable.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs (.../MacroStabilityInwardsSoilLayerDataTable.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -48,16 +48,7 @@
/// The collection of layer data to show.
public void SetData(IEnumerable layerData)
{
- if (layerData != null)
- {
- IEnumerable macroStabilityInwardsSoilLayerData = layerData.ToArray();
- int layerIndex = macroStabilityInwardsSoilLayerData.Count();
- SetDataSource(macroStabilityInwardsSoilLayerData.Select(soilLayerData => new MacroStabilityInwardsFormattedSoilLayerDataRow(soilLayerData, layerIndex--)).ToArray());
- }
- else
- {
- SetDataSource(null);
- }
+ SetDataSource(layerData?.Select(data => new MacroStabilityInwardsFormattedSoilLayerDataRow(data)).ToArray());
}
private void AddColumns()
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilLayerData.cs
===================================================================
diff -u -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilLayerData.cs (.../MacroStabilityInwardsSoilLayerData.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilLayerData.cs (.../MacroStabilityInwardsSoilLayerData.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -164,7 +164,7 @@
///
/// Gets or sets the cohesion.
- /// [kN/m³]
+ /// [kN/m²]
///
public VariationCoefficientLogNormalDistribution Cohesion
{
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/MacroStabilityInwardsCalculationScenarioFactoryTest.cs
===================================================================
diff -u -rbeb20fbb814f4128b6d7dc7648af798fcccbe24c -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/MacroStabilityInwardsCalculationScenarioFactoryTest.cs (.../MacroStabilityInwardsCalculationScenarioFactoryTest.cs) (revision beb20fbb814f4128b6d7dc7648af798fcccbe24c)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/MacroStabilityInwardsCalculationScenarioFactoryTest.cs (.../MacroStabilityInwardsCalculationScenarioFactoryTest.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -315,6 +315,7 @@
{
Data =
{
+ MaterialName = "Clay",
IsAquifer = false,
Cohesion = new VariationCoefficientLogNormalDistribution(),
FrictionAngle = new VariationCoefficientLogNormalDistribution(),
@@ -336,6 +337,7 @@
{
Data =
{
+ MaterialName = "Sand",
IsAquifer = true,
Cohesion = new VariationCoefficientLogNormalDistribution(),
FrictionAngle = new VariationCoefficientLogNormalDistribution(),
@@ -357,6 +359,7 @@
{
Data =
{
+ MaterialName = "Soil",
IsAquifer = false,
Cohesion = new VariationCoefficientLogNormalDistribution(),
FrictionAngle = new VariationCoefficientLogNormalDistribution(),
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test.csproj
===================================================================
diff -u -rb2f4b307c254c747a5cf01d2fb94970e5e954c36 -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.Data.TestUtil.Test.csproj) (revision b2f4b307c254c747a5cf01d2fb94970e5e954c36)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.Data.TestUtil.Test.csproj) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -57,6 +57,8 @@
+
+
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/SoilProfile/MacroStabilityInwardsSoilLayer1DTestFactoryTest.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/SoilProfile/MacroStabilityInwardsSoilLayer1DTestFactoryTest.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/SoilProfile/MacroStabilityInwardsSoilLayer1DTestFactoryTest.cs (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -0,0 +1,64 @@
+// 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 NUnit.Framework;
+using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
+using Ringtoets.MacroStabilityInwards.Data.TestUtil.SoilProfile;
+using Ringtoets.MacroStabilityInwards.Primitives;
+
+namespace Ringtoets.MacroStabilityInwards.Data.TestUtil.Test.SoilProfile
+{
+ [TestFixture]
+ public class MacroStabilityInwardsSoilLayer1DTestFactoryTest
+ {
+ [Test]
+ public void CreateMacroStabilityInwardsSoilLayer1D_DefaultTop_ReturnsExpectedMacroStabilityInwardsSoilLayer1D()
+ {
+ // Call
+ MacroStabilityInwardsSoilLayer1D soilLayer = MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D();
+
+ // Assert
+ Assert.IsNotNull(soilLayer);
+ Assert.AreEqual(typeof(MacroStabilityInwardsSoilLayer1D), soilLayer.GetType());
+ Assert.AreEqual(0.0, soilLayer.Top);
+ Assert.AreEqual(new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Valid"
+ }, soilLayer.Data);
+ }
+
+ [Test]
+ public void CreateMacroStabilityInwardsSoilLayer1D_WithTop_ReturnsExpectedMacroStabilityInwardsSoilLayer1D()
+ {
+ // Call
+ MacroStabilityInwardsSoilLayer1D soilLayer = MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(4.5);
+
+ // Assert
+ Assert.IsNotNull(soilLayer);
+ Assert.AreEqual(typeof(MacroStabilityInwardsSoilLayer1D), soilLayer.GetType());
+ Assert.AreEqual(4.5, soilLayer.Top);
+ Assert.AreEqual(new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Valid"
+ }, soilLayer.Data);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/SoilProfile/MacroStabilityInwardsSoilLayer2DTestFactoryTest.cs
===================================================================
diff -u -rf6dd19ee061fc2754d81eb3677c26fbdb504fc49 -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/SoilProfile/MacroStabilityInwardsSoilLayer2DTestFactoryTest.cs (.../MacroStabilityInwardsSoilLayer2DTestFactoryTest.cs) (revision f6dd19ee061fc2754d81eb3677c26fbdb504fc49)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/SoilProfile/MacroStabilityInwardsSoilLayer2DTestFactoryTest.cs (.../MacroStabilityInwardsSoilLayer2DTestFactoryTest.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -21,7 +21,6 @@
using Core.Common.Base.Geometry;
using NUnit.Framework;
-using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
using Ringtoets.MacroStabilityInwards.Data.TestUtil.SoilProfile;
using Ringtoets.MacroStabilityInwards.Primitives;
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/SoilProfile/MacroStabilityInwardsStochasticSoilProfileTestFactoryTest.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/SoilProfile/MacroStabilityInwardsStochasticSoilProfileTestFactoryTest.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/SoilProfile/MacroStabilityInwardsStochasticSoilProfileTestFactoryTest.cs (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -0,0 +1,119 @@
+// 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.Collections.Generic;
+using Core.Common.Base.Geometry;
+using NUnit.Framework;
+using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
+using Ringtoets.MacroStabilityInwards.Data.TestUtil.SoilProfile;
+using Ringtoets.MacroStabilityInwards.Primitives;
+
+namespace Ringtoets.MacroStabilityInwards.Data.TestUtil.Test.SoilProfile
+{
+ [TestFixture]
+ public class MacroStabilityInwardsStochasticSoilProfileTestFactoryTest
+ {
+ [Test]
+ public void CreateMacroStabilityInwardsStochasticSoilProfile2D_ReturnsExpectedMacroStabilityInwardsStochasticSoilProfile2D()
+ {
+ // Call
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory
+ .CreateMacroStabilityInwardsStochasticSoilProfile2D();
+
+ // Assert
+ var doubleNestedLayer = new MacroStabilityInwardsSoilLayer2D(
+ new Ring(new List
+ {
+ new Point2D(4.0, 2.0),
+ new Point2D(0.0, 2.5)
+ }),
+ new List(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Soil"
+ },
+ new List());
+
+ var nestedLayer = new MacroStabilityInwardsSoilLayer2D(
+ new Ring(new List
+ {
+ new Point2D(4.0, 2.0),
+ new Point2D(0.0, 2.5)
+ }),
+ new List(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Clay"
+ },
+ new[]
+ {
+ doubleNestedLayer
+ });
+
+ var layers = new[]
+ {
+ new MacroStabilityInwardsSoilLayer2D(
+ new Ring(new List
+ {
+ new Point2D(0.0, 1.0),
+ new Point2D(2.0, 4.0)
+ }),
+ new List(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Sand"
+ },
+ new List()),
+ new MacroStabilityInwardsSoilLayer2D(
+ new Ring(new List
+ {
+ new Point2D(3.0, 1.0),
+ new Point2D(8.0, 3.0)
+ }),
+ new List(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Sand"
+ },
+ new[]
+ {
+ nestedLayer
+ }
+ ),
+ new MacroStabilityInwardsSoilLayer2D(
+ new Ring(new List
+ {
+ new Point2D(2.0, 4.0),
+ new Point2D(2.0, 8.0)
+ }),
+ new List(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Sand"
+ },
+ new List())
+ };
+
+ Assert.AreEqual(0.5, stochasticSoilProfile.Probability);
+ CollectionAssert.AreEqual(layers, stochasticSoilProfile.SoilProfile.Layers);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsCalculationScenarioFactory.cs
===================================================================
diff -u -rbeb20fbb814f4128b6d7dc7648af798fcccbe24c -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsCalculationScenarioFactory.cs (.../MacroStabilityInwardsCalculationScenarioFactory.cs) (revision beb20fbb814f4128b6d7dc7648af798fcccbe24c)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsCalculationScenarioFactory.cs (.../MacroStabilityInwardsCalculationScenarioFactory.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -140,6 +140,7 @@
{
Data =
{
+ MaterialName = "Clay",
IsAquifer = false,
Cohesion = new VariationCoefficientLogNormalDistribution(),
FrictionAngle = new VariationCoefficientLogNormalDistribution(),
@@ -161,6 +162,7 @@
{
Data =
{
+ MaterialName = "Sand",
IsAquifer = true,
Cohesion = new VariationCoefficientLogNormalDistribution(),
FrictionAngle = new VariationCoefficientLogNormalDistribution(),
@@ -182,6 +184,7 @@
{
Data =
{
+ MaterialName = "Soil",
IsAquifer = false,
Cohesion = new VariationCoefficientLogNormalDistribution(),
FrictionAngle = new VariationCoefficientLogNormalDistribution(),
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/Ringtoets.MacroStabilityInwards.Data.TestUtil.csproj
===================================================================
diff -u -rc5836107e7d32e9802f3febb60303ea5c0c37484 -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/Ringtoets.MacroStabilityInwards.Data.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.Data.TestUtil.csproj) (revision c5836107e7d32e9802f3febb60303ea5c0c37484)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/Ringtoets.MacroStabilityInwards.Data.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.Data.TestUtil.csproj) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -58,7 +58,9 @@
+
+
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsSoilLayer1DTestFactory.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsSoilLayer1DTestFactory.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsSoilLayer1DTestFactory.cs (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -0,0 +1,46 @@
+// 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 Ringtoets.MacroStabilityInwards.Data.SoilProfile;
+using Ringtoets.MacroStabilityInwards.Primitives;
+
+namespace Ringtoets.MacroStabilityInwards.Data.TestUtil.SoilProfile
+{
+ ///
+ /// Factory to create simple instances that
+ /// can be used for testing.
+ ///
+ public static class MacroStabilityInwardsSoilLayer1DTestFactory
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The top level of the soil layer.
+ /// The created .
+ public static MacroStabilityInwardsSoilLayer1D CreateMacroStabilityInwardsSoilLayer1D(double top = 0.0)
+ {
+ return new MacroStabilityInwardsSoilLayer1D(top, new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Valid"
+ });
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsSoilLayer2DTestFactory.cs
===================================================================
diff -u -r686c5eeaad900a6bb627733de8c21bd607f130aa -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsSoilLayer2DTestFactory.cs (.../MacroStabilityInwardsSoilLayer2DTestFactory.cs) (revision 686c5eeaad900a6bb627733de8c21bd607f130aa)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsSoilLayer2DTestFactory.cs (.../MacroStabilityInwardsSoilLayer2DTestFactory.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -52,7 +52,10 @@
new Point2D(0, 0),
new Point2D(1, 1)
}), new Ring[0],
- new MacroStabilityInwardsSoilLayerData(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Valid"
+ },
nestedLayers);
}
}
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsSoilProfile1DTestFactory.cs
===================================================================
diff -u -rbeb20fbb814f4128b6d7dc7648af798fcccbe24c -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsSoilProfile1DTestFactory.cs (.../MacroStabilityInwardsSoilProfile1DTestFactory.cs) (revision beb20fbb814f4128b6d7dc7648af798fcccbe24c)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsSoilProfile1DTestFactory.cs (.../MacroStabilityInwardsSoilProfile1DTestFactory.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -59,7 +59,7 @@
{
return new MacroStabilityInwardsSoilProfile1D(name, 0.0, new[]
{
- new MacroStabilityInwardsSoilLayer1D(0.0)
+ MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D()
});
}
}
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsStochasticSoilProfileTestFactory.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsStochasticSoilProfileTestFactory.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/SoilProfile/MacroStabilityInwardsStochasticSoilProfileTestFactory.cs (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -0,0 +1,121 @@
+// 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.Collections.Generic;
+using Core.Common.Base.Geometry;
+using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
+using Ringtoets.MacroStabilityInwards.Primitives;
+
+namespace Ringtoets.MacroStabilityInwards.Data.TestUtil.SoilProfile
+{
+ ///
+ /// A factor to create configured that
+ /// can be used for testing.
+ ///
+ public static class MacroStabilityInwardsStochasticSoilProfileTestFactory
+ {
+ ///
+ /// Creates a new instance of with
+ /// a configured 2D soil profile.
+ ///
+ /// A configured .
+ public static MacroStabilityInwardsStochasticSoilProfile CreateMacroStabilityInwardsStochasticSoilProfile2D()
+ {
+ var doubleNestedLayer = new MacroStabilityInwardsSoilLayer2D(
+ new Ring(new List
+ {
+ new Point2D(4.0, 2.0),
+ new Point2D(0.0, 2.5)
+ }),
+ new List(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Soil"
+ },
+ new List());
+
+ var nestedLayer = new MacroStabilityInwardsSoilLayer2D(
+ new Ring(new List
+ {
+ new Point2D(4.0, 2.0),
+ new Point2D(0.0, 2.5)
+ }),
+ new List(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Clay"
+ },
+ new[]
+ {
+ doubleNestedLayer
+ });
+ var layers = new[]
+ {
+ new MacroStabilityInwardsSoilLayer2D(
+ new Ring(new List
+ {
+ new Point2D(0.0, 1.0),
+ new Point2D(2.0, 4.0)
+ }),
+ new List(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Sand"
+ },
+ new List()),
+ new MacroStabilityInwardsSoilLayer2D(
+ new Ring(new List
+ {
+ new Point2D(3.0, 1.0),
+ new Point2D(8.0, 3.0)
+ }),
+ new List(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Sand"
+ },
+ new[]
+ {
+ nestedLayer
+ }
+ ),
+ new MacroStabilityInwardsSoilLayer2D(
+ new Ring(new List
+ {
+ new Point2D(2.0, 4.0),
+ new Point2D(2.0, 8.0)
+ }),
+ new List(),
+ new MacroStabilityInwardsSoilLayerData
+ {
+ MaterialName = "Sand"
+ },
+ new List())
+ };
+
+ return new MacroStabilityInwardsStochasticSoilProfile(0.5,
+ new MacroStabilityInwardsSoilProfile2D(
+ "Profile 2D",
+ layers,
+ new List()));
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFormattedSoilLayerDataRowTest.cs
===================================================================
diff -u -ra55213880414ace4d70b5755ee12783dec33f9b3 -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFormattedSoilLayerDataRowTest.cs (.../MacroStabilityInwardsFormattedSoilLayerDataRowTest.cs) (revision a55213880414ace4d70b5755ee12783dec33f9b3)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFormattedSoilLayerDataRowTest.cs (.../MacroStabilityInwardsFormattedSoilLayerDataRowTest.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -26,7 +26,6 @@
using Core.Common.Utils;
using NUnit.Framework;
using Ringtoets.Common.Data.Probabilistics;
-using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
using Ringtoets.MacroStabilityInwards.Forms.Views;
using Ringtoets.MacroStabilityInwards.Primitives;
@@ -39,7 +38,7 @@
public void Constructor_SoilLayerDataNull_ThrowsArgumentNullException()
{
// Call
- TestDelegate test = () => new MacroStabilityInwardsFormattedSoilLayerDataRow(null, 0);
+ TestDelegate test = () => new MacroStabilityInwardsFormattedSoilLayerDataRow(null);
// Assert
Assert.Throws(test);
@@ -97,13 +96,13 @@
};
// Call
- var formattedSoilLayerDataRow = new MacroStabilityInwardsFormattedSoilLayerDataRow(soilLayerData, 4);
+ var formattedSoilLayerDataRow = new MacroStabilityInwardsFormattedSoilLayerDataRow(soilLayerData);
// Assert
TestHelper.AssertTypeConverter(
nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.ShearStrengthModel));
- Assert.AreEqual("4 " + soilLayerData.MaterialName, formattedSoilLayerDataRow.MaterialName);
+ Assert.AreEqual(soilLayerData.MaterialName, formattedSoilLayerDataRow.MaterialName);
Assert.AreEqual(soilLayerData.Color, formattedSoilLayerDataRow.Color);
Assert.AreEqual(soilLayerData.IsAquifer, formattedSoilLayerDataRow.IsAquifer);
Assert.AreEqual("0,85 (Verwachtingswaarde = 1,00, Variatiecoëfficiënt = 1,00, Verschuiving = 0,50)", formattedSoilLayerDataRow.AbovePhreaticLevel);
@@ -167,13 +166,13 @@
};
// Call
- var formattedSoilLayerDataRow = new MacroStabilityInwardsFormattedSoilLayerDataRow(soilLayerData, 2);
+ var formattedSoilLayerDataRow = new MacroStabilityInwardsFormattedSoilLayerDataRow(soilLayerData);
// Assert
TestHelper.AssertTypeConverter(
nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.ShearStrengthModel));
- Assert.AreEqual("2 " + soilLayerData.MaterialName, formattedSoilLayerDataRow.MaterialName);
+ Assert.AreEqual(soilLayerData.MaterialName, formattedSoilLayerDataRow.MaterialName);
Assert.AreEqual(soilLayerData.Color, formattedSoilLayerDataRow.Color);
Assert.AreEqual(soilLayerData.IsAquifer, formattedSoilLayerDataRow.IsAquifer);
Assert.AreEqual("NaN", formattedSoilLayerDataRow.AbovePhreaticLevel);
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs
===================================================================
diff -u -rcb6bb67915ea2869b2d7b705bdcee757dcdf2ce1 -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs (.../MacroStabilityInwardsInputViewTest.cs) (revision cb6bb67915ea2869b2d7b705bdcee757dcdf2ce1)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs (.../MacroStabilityInwardsInputViewTest.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -32,6 +32,8 @@
using Ringtoets.Common.Forms.TestUtil;
using Ringtoets.MacroStabilityInwards.Data;
using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
+using Ringtoets.MacroStabilityInwards.Data.TestUtil;
+using Ringtoets.MacroStabilityInwards.Data.TestUtil.SoilProfile;
using Ringtoets.MacroStabilityInwards.Forms.TestUtil;
using Ringtoets.MacroStabilityInwards.Forms.Views;
using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Calculators;
@@ -177,9 +179,9 @@
-1,
new[]
{
- new MacroStabilityInwardsSoilLayer1D(3.0),
- new MacroStabilityInwardsSoilLayer1D(2.0),
- new MacroStabilityInwardsSoilLayer1D(0)
+ MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(1.0),
+ MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(2.0),
+ MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(3.0)
})),
SurfaceLine = GetSurfaceLineWithGeometry()
}
@@ -243,7 +245,7 @@
{
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -309,7 +311,7 @@
{
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -342,7 +344,7 @@
{
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -485,7 +487,7 @@
using (var view = new MacroStabilityInwardsInputView())
{
- MacroStabilityInwardsStochasticSoilProfile originalSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile originalSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
@@ -503,7 +505,7 @@
surfaceLineChartData.Attach(observer);
- MacroStabilityInwardsStochasticSoilProfile newSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile newSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
// When
calculation.InputParameters.StochasticSoilProfile = newSoilProfile;
@@ -742,7 +744,7 @@
-1,
new[]
{
- new MacroStabilityInwardsSoilLayer1D(1)
+ MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D()
})),
SurfaceLine = GetSurfaceLineWithGeometry()
}
@@ -761,8 +763,8 @@
-1,
new[]
{
- new MacroStabilityInwardsSoilLayer1D(3),
- new MacroStabilityInwardsSoilLayer1D(4)
+ MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(3),
+ MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(4)
}));
calculation.InputParameters.NotifyObservers();
@@ -816,7 +818,7 @@
using (var view = new MacroStabilityInwardsInputView())
{
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -858,7 +860,7 @@
{
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -902,7 +904,7 @@
{
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -946,7 +948,7 @@
{
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -1004,61 +1006,12 @@
{
return new MacroStabilityInwardsStochasticSoilProfile(0.5, new MacroStabilityInwardsSoilProfile1D("profile 1D", -1, new[]
{
- new MacroStabilityInwardsSoilLayer1D(1),
- new MacroStabilityInwardsSoilLayer1D(3),
- new MacroStabilityInwardsSoilLayer1D(5)
+ MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(2),
+ MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(3),
+ MacroStabilityInwardsSoilLayer1DTestFactory.CreateMacroStabilityInwardsSoilLayer1D(5)
}));
}
- private static MacroStabilityInwardsStochasticSoilProfile GetStochasticSoilProfile2D()
- {
- var layers = new[]
- {
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(0.0, 1.0),
- new Point2D(2.0, 4.0)
- }), new List()),
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(3.0, 1.0),
- new Point2D(8.0, 3.0)
- }),
- new List(),
- new MacroStabilityInwardsSoilLayerData(),
- new[]
- {
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(4.0, 2.0),
- new Point2D(0.0, 2.5)
- }),
- new List(),
- new MacroStabilityInwardsSoilLayerData(),
- new[]
- {
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(4.0, 2.0),
- new Point2D(0.0, 2.5)
- }),
- new List())
- }
- )
- }
- ),
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(2.0, 4.0),
- new Point2D(2.0, 8.0)
- }), new List())
- };
-
- return new MacroStabilityInwardsStochasticSoilProfile(0.5, new MacroStabilityInwardsSoilProfile2D("profile 2D",
- layers,
- new List()));
- }
-
MacroStabilityInwardsSurfaceLine GetSurfaceLineWithGeometry()
{
var points = new[]
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputChartControlTest.cs
===================================================================
diff -u -r4acb5ca07c10a411648e4ac3fe6f15109dfca3e0 -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputChartControlTest.cs (.../MacroStabilityInwardsOutputChartControlTest.cs) (revision 4acb5ca07c10a411648e4ac3fe6f15109dfca3e0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputChartControlTest.cs (.../MacroStabilityInwardsOutputChartControlTest.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -30,6 +30,7 @@
using Ringtoets.MacroStabilityInwards.Data;
using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
using Ringtoets.MacroStabilityInwards.Data.TestUtil;
+using Ringtoets.MacroStabilityInwards.Data.TestUtil.SoilProfile;
using Ringtoets.MacroStabilityInwards.Forms.TestUtil;
using Ringtoets.MacroStabilityInwards.Forms.Views;
using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Calculators;
@@ -40,6 +41,7 @@
[TestFixture]
public class MacroStabilityInwardsOutputChartControlTest
{
+ private const int soilProfileIndex = 0;
private const int waternetZonesExtremeIndex = 14;
private const int waternetZonesDailyIndex = 15;
@@ -107,14 +109,14 @@
}
[Test]
- public void Data_SetValueWithOutput_ChartDatSet()
+ public void Data_SetValueWithOutput_ChartDataSet()
{
// Setup
using (new MacroStabilityInwardsCalculatorFactoryConfig())
using (var control = new MacroStabilityInwardsOutputChartControl())
{
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -138,11 +140,43 @@
}
[Test]
+ public void Data_SetValueWithoutStochasticSoilProfile_ChartDataSetWithDefaultSoilProfileChartDataName()
+ {
+ // Setup
+ using (new MacroStabilityInwardsCalculatorFactoryConfig())
+ using (var control = new MacroStabilityInwardsOutputChartControl())
+ {
+ MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
+ var calculation = new MacroStabilityInwardsCalculationScenario
+ {
+ InputParameters =
+ {
+ SurfaceLine = surfaceLine,
+ },
+ Output = MacroStabilityInwardsOutputTestFactory.CreateOutput()
+ };
+
+ // Call
+ control.Data = calculation;
+
+ // Assert
+ IChartControl chartControl = GetChartControl(control);
+ ChartDataCollection chartData = chartControl.Data;
+ MacroStabilityInwardsViewChartDataAssert.AssertSoilProfileChartData(calculation.InputParameters.SoilProfileUnderSurfaceLine,
+ "Ondergrondschematisatie",
+ false,
+ chartData.Collection.ElementAt(soilProfileIndex));
+
+ Assert.AreEqual(calculation.Name, chartControl.ChartTitle);
+ }
+ }
+
+ [Test]
public void Data_SetValueWithoutOutputAndEmptyWaternet_ChartDataEmpty()
{
// Setup
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -172,7 +206,7 @@
{
// Setup
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -203,7 +237,7 @@
{
// Setup
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -240,7 +274,7 @@
{
// Setup
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -278,7 +312,7 @@
{
// Setup
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -317,7 +351,7 @@
{
// Setup
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -380,7 +414,7 @@
public void GivenCalculationWithStochasticSoilProfileAndSurfaceLine_WhenStochasticSoilProfileUpdate_ThenChartDataUpdated()
{
// Given
- MacroStabilityInwardsStochasticSoilProfile originalSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile originalSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
@@ -402,7 +436,7 @@
// Precondition
MacroStabilityInwardsOutputViewChartDataAssert.AssertInputChartData(calculation, chartData);
- MacroStabilityInwardsStochasticSoilProfile newSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile newSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
// When
calculation.InputParameters.StochasticSoilProfile = newSoilProfile;
@@ -417,7 +451,7 @@
public void GivenViewWithWaternets_WhenWaternetSetEmpty_ThenNoChartData()
{
// Setup
- MacroStabilityInwardsStochasticSoilProfile originalSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile originalSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
@@ -451,7 +485,7 @@
public void GivenViewWithEmptyWaternets_WhenWaternetSet_ThenChartDataSet()
{
// Setup
- MacroStabilityInwardsStochasticSoilProfile originalSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile originalSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
@@ -488,7 +522,7 @@
public void GivenViewWithWaternets_WhenObserversNotifiedAndWaternetSame_ThenChartDataNotUpdated()
{
// Setup
- MacroStabilityInwardsStochasticSoilProfile originalSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile originalSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
@@ -528,53 +562,6 @@
}
}
- private static MacroStabilityInwardsStochasticSoilProfile GetStochasticSoilProfile2D()
- {
- var layers = new[]
- {
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(0.0, 1.0),
- new Point2D(2.0, 4.0)
- }), new List()),
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(3.0, 1.0),
- new Point2D(8.0, 3.0)
- }),
- new List(),
- new MacroStabilityInwardsSoilLayerData(),
- new[]
- {
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(4.0, 2.0),
- new Point2D(0.0, 2.5)
- }),
- new List(),
- new MacroStabilityInwardsSoilLayerData(),
- new[]
- {
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(4.0, 2.0),
- new Point2D(0.0, 2.5)
- }), new List())
- })
- }
- ),
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(2.0, 4.0),
- new Point2D(2.0, 8.0)
- }), new List())
- };
-
- return new MacroStabilityInwardsStochasticSoilProfile(0.5, new MacroStabilityInwardsSoilProfile2D("Ondergrondschematisatie",
- layers,
- new List()));
- }
-
private static MacroStabilityInwardsSurfaceLine GetSurfaceLineWithGeometry()
{
var points = new[]
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputViewTest.cs
===================================================================
diff -u -r4acb5ca07c10a411648e4ac3fe6f15109dfca3e0 -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputViewTest.cs (.../MacroStabilityInwardsOutputViewTest.cs) (revision 4acb5ca07c10a411648e4ac3fe6f15109dfca3e0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputViewTest.cs (.../MacroStabilityInwardsOutputViewTest.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -30,6 +30,7 @@
using Ringtoets.MacroStabilityInwards.Data;
using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
using Ringtoets.MacroStabilityInwards.Data.TestUtil;
+using Ringtoets.MacroStabilityInwards.Data.TestUtil.SoilProfile;
using Ringtoets.MacroStabilityInwards.Forms.TestUtil;
using Ringtoets.MacroStabilityInwards.Forms.Views;
using Ringtoets.MacroStabilityInwards.Primitives;
@@ -157,7 +158,7 @@
MacroStabilityInwardsOutputChartControl chartControl = GetChartControl(form);
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -196,7 +197,7 @@
MacroStabilityInwardsOutputChartControl chartControl = GetChartControl(form);
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -234,7 +235,7 @@
MacroStabilityInwardsOutputChartControl chartControl = GetChartControl(form);
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -253,7 +254,7 @@
MacroStabilityInwardsOutputViewChartDataAssert.AssertInputChartData(calculation, chartData);
// When
- MacroStabilityInwardsStochasticSoilProfile newSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile newSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
calculation.InputParameters.StochasticSoilProfile = newSoilProfile;
calculation.InputParameters.NotifyObservers();
@@ -275,7 +276,7 @@
MacroStabilityInwardsOutputChartControl chartControl = GetChartControl(form);
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -293,7 +294,7 @@
MacroStabilityInwardsOutputViewChartDataAssert.AssertEmptyChartDataWithEmptySoilLayerAndEmptyWaternetChartData(chartData);
// When
- MacroStabilityInwardsStochasticSoilProfile newSoilProfile = GetStochasticSoilProfile2D();
+ MacroStabilityInwardsStochasticSoilProfile newSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D();
calculation.InputParameters.StochasticSoilProfile = newSoilProfile;
calculation.InputParameters.NotifyObservers();
@@ -312,28 +313,6 @@
return ControlTestHelper.GetControls(view, "chartControl").Single();
}
- private static MacroStabilityInwardsStochasticSoilProfile GetStochasticSoilProfile2D()
- {
- return new MacroStabilityInwardsStochasticSoilProfile(0.5, new MacroStabilityInwardsSoilProfile2D("Ondergrondschematisatie", new[]
- {
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(0.0, 1.0),
- new Point2D(2.0, 4.0)
- }), new List()),
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(3.0, 1.0),
- new Point2D(8.0, 3.0)
- }), new List()),
- new MacroStabilityInwardsSoilLayer2D(new Ring(new List
- {
- new Point2D(2.0, 4.0),
- new Point2D(2.0, 8.0)
- }), new List())
- }, new List()));
- }
-
private static MacroStabilityInwardsSurfaceLine GetSurfaceLineWithGeometry()
{
var points = new[]
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsSoilLayerDataTableTest.cs
===================================================================
diff -u -r9ab2b4a1db979a19810acdde546f961da0c40efa -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsSoilLayerDataTableTest.cs (.../MacroStabilityInwardsSoilLayerDataTableTest.cs) (revision 9ab2b4a1db979a19810acdde546f961da0c40efa)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsSoilLayerDataTableTest.cs (.../MacroStabilityInwardsSoilLayerDataTableTest.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -25,7 +25,6 @@
using Core.Common.TestUtil;
using NUnit.Framework;
using Ringtoets.Common.Data.Probabilistics;
-using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
using Ringtoets.MacroStabilityInwards.Forms.Views;
using Ringtoets.MacroStabilityInwards.Primitives;
@@ -179,7 +178,7 @@
{
MacroStabilityInwardsSoilLayerData soilLayerData = layers[i];
DataGridViewCellCollection rowCells = table.Rows[i].Cells;
- Assert.AreEqual((table.Rows.Count - i) + " " + soilLayerData.MaterialName,
+ Assert.AreEqual(soilLayerData.MaterialName,
rowCells[nameColumnIndex].Value);
Assert.AreEqual(soilLayerData.Color,
rowCells[colorColumnIndex].Value);
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsOutputViewChartDataAssert.cs
===================================================================
diff -u -r9de18fdb8dc733977bbb44f41cf08567b5fcbeb3 -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsOutputViewChartDataAssert.cs (.../MacroStabilityInwardsOutputViewChartDataAssert.cs) (revision 9de18fdb8dc733977bbb44f41cf08567b5fcbeb3)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsOutputViewChartDataAssert.cs (.../MacroStabilityInwardsOutputViewChartDataAssert.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -205,7 +205,7 @@
Assert.AreEqual(nrOfChartData, chartDataArray.Length);
var surfaceLineData = (ChartLineData) chartDataArray[surfaceLineIndex];
- var soilProfileData = (ChartDataCollection) chartDataArray[soilProfileIndex];
+ //var soilProfileData = (ChartDataCollection) chartDataArray[soilProfileIndex];
var surfaceLevelInsideData = (ChartPointData) chartDataArray[surfaceLevelInsideIndex];
var ditchPolderSideData = (ChartPointData) chartDataArray[ditchPolderSideIndex];
var bottomDitchPolderSideData = (ChartPointData) chartDataArray[bottomDitchPolderSideIndex];
@@ -234,7 +234,7 @@
CollectionAssert.IsEmpty(surfaceLevelOutsideData.Points);
Assert.AreEqual("Profielschematisatie", surfaceLineData.Name);
- Assert.AreEqual("Ondergrondschematisatie", soilProfileData.Name);
+ //Assert.AreEqual("Ondergrondschematisatie", soilProfileData.Name);
Assert.AreEqual("Maaiveld binnenwaarts", surfaceLevelInsideData.Name);
Assert.AreEqual("Insteek sloot polderzijde", ditchPolderSideData.Name);
Assert.AreEqual("Slootbodem polderzijde", bottomDitchPolderSideData.Name);
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsViewChartDataAssert.cs
===================================================================
diff -u -r686c5eeaad900a6bb627733de8c21bd607f130aa -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsViewChartDataAssert.cs (.../MacroStabilityInwardsViewChartDataAssert.cs) (revision 686c5eeaad900a6bb627733de8c21bd607f130aa)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsViewChartDataAssert.cs (.../MacroStabilityInwardsViewChartDataAssert.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -77,14 +77,12 @@
Assert.AreEqual(expectedLayerCount, soilProfileChartData.Collection.Count());
Assert.AreEqual(expectedName, soilProfileChartData.Name);
- string[] expectedSoilLayerNames = layers.Select((l, i) => $"{i + 1} {l.Data.MaterialName}").Reverse().ToArray();
-
for (var i = 0; i < expectedLayerCount; i++)
{
var chartMultipleAreaData = soilProfileChartData.Collection.ElementAt(i) as ChartMultipleAreaData;
Assert.IsNotNull(chartMultipleAreaData);
- Assert.AreEqual(expectedSoilLayerNames[i], chartMultipleAreaData.Name);
+ Assert.AreEqual(layers.ElementAt(i).Data.MaterialName, chartMultipleAreaData.Name);
Assert.AreEqual(mapDataShouldContainAreas, chartMultipleAreaData.Areas.Any());
}
}
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsStochasticSoilModelUpdateDataStrategyTest.cs
===================================================================
diff -u -r1a3f904157a3f86e702ea8086bee67e780da7856 -r9e2f9f7fe2d7daf45c943fc446cd9edc4298290d
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsStochasticSoilModelUpdateDataStrategyTest.cs (.../MacroStabilityInwardsStochasticSoilModelUpdateDataStrategyTest.cs) (revision 1a3f904157a3f86e702ea8086bee67e780da7856)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsStochasticSoilModelUpdateDataStrategyTest.cs (.../MacroStabilityInwardsStochasticSoilModelUpdateDataStrategyTest.cs) (revision 9e2f9f7fe2d7daf45c943fc446cd9edc4298290d)
@@ -555,23 +555,8 @@
{
return new List
{
- new MacroStabilityInwardsStochasticSoilProfile(0.5, new MacroStabilityInwardsSoilProfile1D(
- "A",
- 0.0,
- new[]
- {
- new MacroStabilityInwardsSoilLayer1D(0.0)
- })),
- new MacroStabilityInwardsStochasticSoilProfile(0.5, new MacroStabilityInwardsSoilProfile2D(
- "B",
- new[]
- {
- new MacroStabilityInwardsSoilLayer2D(new Ring(new[]
- {
- new Point2D(3, 2),
- new Point2D(4, 5)
- }), Enumerable.Empty())
- }, Enumerable.Empty()))
+ new MacroStabilityInwardsStochasticSoilProfile(0.5, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()),
+ new MacroStabilityInwardsStochasticSoilProfile(0.5, MacroStabilityInwardsSoilProfile2DTestFactory.CreateMacroStabilityInwardsSoilProfile2D())
};
}