Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensions.cs =================================================================== diff -u -r7585d2fd78627d94d55ffa16423af90a91e4efd4 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensions.cs (.../MacroStabilityInwardsSoilLayer1DCreateExtensions.cs) (revision 7585d2fd78627d94d55ffa16423af90a91e4efd4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensions.cs (.../MacroStabilityInwardsSoilLayer1DCreateExtensions.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -49,7 +49,7 @@ throw new ArgumentNullException(nameof(soilLayer)); } - IMacroStabilityInwardsSoilLayerData data = soilLayer.Data; + MacroStabilityInwardsSoilLayerData data = soilLayer.Data; return new MacroStabilityInwardsSoilLayerOneDEntity { Top = soilLayer.Top.ToNaNAsNull(), Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensions.cs =================================================================== diff -u -rf6dd19ee061fc2754d81eb3677c26fbdb504fc49 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensions.cs (.../MacroStabilityInwardsSoilLayer2DCreateExtensions.cs) (revision f6dd19ee061fc2754d81eb3677c26fbdb504fc49) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensions.cs (.../MacroStabilityInwardsSoilLayer2DCreateExtensions.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -51,7 +51,7 @@ throw new ArgumentNullException(nameof(soilLayer)); } - IMacroStabilityInwardsSoilLayerData data = soilLayer.Data; + MacroStabilityInwardsSoilLayerData data = soilLayer.Data; var entity = new MacroStabilityInwardsSoilLayerTwoDEntity { OuterRingXml = new Point2DXmlSerializer().ToXml(soilLayer.OuterRing.Points), Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensionsTest.cs =================================================================== diff -u -rbeb20fbb814f4128b6d7dc7648af798fcccbe24c -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensionsTest.cs (.../MacroStabilityInwardsSoilLayer1DCreateExtensionsTest.cs) (revision beb20fbb814f4128b6d7dc7648af798fcccbe24c) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensionsTest.cs (.../MacroStabilityInwardsSoilLayer1DCreateExtensionsTest.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -107,7 +107,7 @@ Assert.IsNotNull(entity); Assert.AreEqual(soilLayer.Top, entity.Top); - IMacroStabilityInwardsSoilLayerData data = soilLayer.Data; + MacroStabilityInwardsSoilLayerData data = soilLayer.Data; Assert.AreEqual(Convert.ToByte(data.IsAquifer), entity.IsAquifer); Assert.AreEqual(data.MaterialName, entity.MaterialName); Assert.AreEqual(data.Color.ToArgb(), Convert.ToInt32(entity.Color)); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensionsTest.cs =================================================================== diff -u -rf6dd19ee061fc2754d81eb3677c26fbdb504fc49 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensionsTest.cs (.../MacroStabilityInwardsSoilLayer2DCreateExtensionsTest.cs) (revision f6dd19ee061fc2754d81eb3677c26fbdb504fc49) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensionsTest.cs (.../MacroStabilityInwardsSoilLayer2DCreateExtensionsTest.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -250,7 +250,7 @@ { Assert.IsNotNull(entity); - IMacroStabilityInwardsSoilLayerData data = soilLayer.Data; + MacroStabilityInwardsSoilLayerData data = soilLayer.Data; Assert.AreEqual(Convert.ToByte(data.IsAquifer), entity.IsAquifer); Assert.AreEqual(data.MaterialName, entity.MaterialName); Assert.AreEqual(data.Color.ToArgb(), Convert.ToInt32(entity.Color)); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs =================================================================== diff -u -rf6dd19ee061fc2754d81eb3677c26fbdb504fc49 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision f6dd19ee061fc2754d81eb3677c26fbdb504fc49) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -1512,8 +1512,8 @@ AssertMacroStabilityInwardsSoilLayer); } - private static void AssertMacroStabilityInwardsSoilLayerData(IMacroStabilityInwardsSoilLayerData expectedData, - IMacroStabilityInwardsSoilLayerData actualData) + private static void AssertMacroStabilityInwardsSoilLayerData(MacroStabilityInwardsSoilLayerData expectedData, + MacroStabilityInwardsSoilLayerData actualData) { Assert.AreEqual(expectedData.IsAquifer, actualData.IsAquifer); Assert.AreEqual(expectedData.MaterialName, actualData.MaterialName); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerOneDEntityReadExtensionsTest.cs =================================================================== diff -u -r7585d2fd78627d94d55ffa16423af90a91e4efd4 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerOneDEntityReadExtensionsTest.cs (.../MacroStabilityInwardsSoilLayerOneDEntityReadExtensionsTest.cs) (revision 7585d2fd78627d94d55ffa16423af90a91e4efd4) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerOneDEntityReadExtensionsTest.cs (.../MacroStabilityInwardsSoilLayerOneDEntityReadExtensionsTest.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -102,7 +102,7 @@ // Assert Assert.IsNotNull(layer); Assert.AreEqual(top, layer.Top); - IMacroStabilityInwardsSoilLayerData data = layer.Data; + MacroStabilityInwardsSoilLayerData data = layer.Data; Assert.AreEqual(isAquifer, data.IsAquifer); Assert.AreEqual(Color.FromArgb(color), data.Color); Assert.AreEqual(entity.MaterialName, data.MaterialName); @@ -166,7 +166,7 @@ // Assert Assert.IsNotNull(layer); - IMacroStabilityInwardsSoilLayerData data = layer.Data; + MacroStabilityInwardsSoilLayerData data = layer.Data; Assert.AreEqual(entity.MaterialName, data.MaterialName); Assert.IsNaN(layer.Top); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityReadExtensionsTest.cs =================================================================== diff -u -rf6dd19ee061fc2754d81eb3677c26fbdb504fc49 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityReadExtensionsTest.cs (.../MacroStabilityInwardsSoilLayerTwoDEntityReadExtensionsTest.cs) (revision f6dd19ee061fc2754d81eb3677c26fbdb504fc49) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityReadExtensionsTest.cs (.../MacroStabilityInwardsSoilLayerTwoDEntityReadExtensionsTest.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -104,7 +104,7 @@ // Assert Assert.IsNotNull(layer); - IMacroStabilityInwardsSoilLayerData data = layer.Data; + MacroStabilityInwardsSoilLayerData data = layer.Data; Assert.AreEqual(entity.MaterialName, data.MaterialName); DistributionAssert.AreEqual(new VariationCoefficientLogNormalDistribution(2) @@ -156,7 +156,7 @@ IMacroStabilityInwardsSoilLayer2D layer) { Assert.IsNotNull(layer); - IMacroStabilityInwardsSoilLayerData data = layer.Data; + MacroStabilityInwardsSoilLayerData data = layer.Data; Assert.AreEqual(Convert.ToBoolean(entity.IsAquifer), data.IsAquifer); Assert.AreEqual(Color.FromArgb(Convert.ToInt32(entity.Color)), data.Color); Assert.AreEqual(entity.MaterialName, data.MaterialName); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Converters/SoilProfileConverter.cs =================================================================== diff -u -r66894d34e58e0db658fa3183df8792ed244ccda3 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Converters/SoilProfileConverter.cs (.../SoilProfileConverter.cs) (revision 66894d34e58e0db658fa3183df8792ed244ccda3) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Converters/SoilProfileConverter.cs (.../SoilProfileConverter.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -44,10 +44,10 @@ /// Thrown when /// is null. /// Thrown when - /// + /// /// is an invalid value. /// Thrown when - /// + /// /// is a valid value but unsupported. public static SoilProfile Convert(IMacroStabilityInwardsSoilProfileUnderSurfaceLine soilProfile) { @@ -68,16 +68,16 @@ /// The layers to convert. /// The converted . /// Thrown when - /// + /// /// is an invalid value. /// Thrown when - /// + /// /// is a valid value but unsupported. private static IEnumerable ConvertLayers(IEnumerable layers) { return layers.Select(l => { - IMacroStabilityInwardsSoilLayerData data = l.Data; + MacroStabilityInwardsSoilLayerData data = l.Data; return new SoilLayer(RingToPoints(l.OuterRing), new SoilLayer.ConstructionProperties Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/Ringtoets.MacroStabilityInwards.Data.csproj =================================================================== diff -u -r66894d34e58e0db658fa3183df8792ed244ccda3 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/Ringtoets.MacroStabilityInwards.Data.csproj (.../Ringtoets.MacroStabilityInwards.Data.csproj) (revision 66894d34e58e0db658fa3183df8792ed244ccda3) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/Ringtoets.MacroStabilityInwards.Data.csproj (.../Ringtoets.MacroStabilityInwards.Data.csproj) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -73,7 +73,6 @@ - Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilLayer1D.cs =================================================================== diff -u -rbeb20fbb814f4128b6d7dc7648af798fcccbe24c -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilLayer1D.cs (.../MacroStabilityInwardsSoilLayer1D.cs) (revision beb20fbb814f4128b6d7dc7648af798fcccbe24c) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilLayer1D.cs (.../MacroStabilityInwardsSoilLayer1D.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -41,7 +41,7 @@ /// The top level of the soil layer. /// The data of the soil layer. /// Thrown when is null. - public MacroStabilityInwardsSoilLayer1D(double top, IMacroStabilityInwardsSoilLayerData data) + public MacroStabilityInwardsSoilLayer1D(double top, MacroStabilityInwardsSoilLayerData data) { if (data == null) { @@ -57,7 +57,7 @@ /// public double Top { get; } - public IMacroStabilityInwardsSoilLayerData Data { get; } + public MacroStabilityInwardsSoilLayerData Data { get; } public override bool Equals(object obj) { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilLayer2D.cs =================================================================== diff -u -r1a3f904157a3f86e702ea8086bee67e780da7856 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilLayer2D.cs (.../MacroStabilityInwardsSoilLayer2D.cs) (revision 1a3f904157a3f86e702ea8086bee67e780da7856) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilLayer2D.cs (.../MacroStabilityInwardsSoilLayer2D.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -50,7 +50,7 @@ /// The data of the soil layer. /// The nested . /// Thrown when any parameter is null. - public MacroStabilityInwardsSoilLayer2D(Ring outerRing, IEnumerable holes, IMacroStabilityInwardsSoilLayerData data, IEnumerable nestedLayers) + public MacroStabilityInwardsSoilLayer2D(Ring outerRing, IEnumerable holes, MacroStabilityInwardsSoilLayerData data, IEnumerable nestedLayers) { if (outerRing == null) { @@ -84,7 +84,7 @@ public IEnumerable NestedLayers { get; } - public IMacroStabilityInwardsSoilLayerData Data { get; } + public MacroStabilityInwardsSoilLayerData Data { get; } public override bool Equals(object obj) { Fisheye: Tag d9005dfa3b398d70ada0cf03cf408f8bcfc384db refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilLayerData.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLineFactory.cs =================================================================== diff -u -r1a3f904157a3f86e702ea8086bee67e780da7856 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLineFactory.cs (.../MacroStabilityInwardsSoilProfileUnderSurfaceLineFactory.cs) (revision 1a3f904157a3f86e702ea8086bee67e780da7856) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfileUnderSurfaceLineFactory.cs (.../MacroStabilityInwardsSoilProfileUnderSurfaceLineFactory.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -134,15 +134,15 @@ private class TempSoilLayerGeometry { - public TempSoilLayerGeometry(Point2D[] outerLoop, IMacroStabilityInwardsSoilLayerData data) + public TempSoilLayerGeometry(Point2D[] outerLoop, MacroStabilityInwardsSoilLayerData data) { OuterLoop = outerLoop; Data = data; } public Point2D[] OuterLoop { get; } - public IMacroStabilityInwardsSoilLayerData Data { get; } + public MacroStabilityInwardsSoilLayerData Data { get; } } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFormattedSoilLayerDataRow.cs =================================================================== diff -u -ra55213880414ace4d70b5755ee12783dec33f9b3 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFormattedSoilLayerDataRow.cs (.../MacroStabilityInwardsFormattedSoilLayerDataRow.cs) (revision a55213880414ace4d70b5755ee12783dec33f9b3) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFormattedSoilLayerDataRow.cs (.../MacroStabilityInwardsFormattedSoilLayerDataRow.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -32,18 +32,18 @@ namespace Ringtoets.MacroStabilityInwards.Forms.Views { /// - /// This class represents a row of . + /// This class represents a row of . /// public class MacroStabilityInwardsFormattedSoilLayerDataRow { /// /// Creates a new instance of . /// - /// The to format. + /// The to format. /// The index of the soil layer within the soil profile. /// Thrown when /// is null. - public MacroStabilityInwardsFormattedSoilLayerDataRow(IMacroStabilityInwardsSoilLayerData layerData, int layerIndex) + public MacroStabilityInwardsFormattedSoilLayerDataRow(MacroStabilityInwardsSoilLayerData layerData, int layerIndex) { if (layerData == null) { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs =================================================================== diff -u -ra55213880414ace4d70b5755ee12783dec33f9b3 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs (.../MacroStabilityInwardsSoilLayerDataTable.cs) (revision a55213880414ace4d70b5755ee12783dec33f9b3) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs (.../MacroStabilityInwardsSoilLayerDataTable.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -28,7 +28,7 @@ namespace Ringtoets.MacroStabilityInwards.Forms.Views { /// - /// This class defines a table in which properties of instances + /// This class defines a table in which properties of instances /// are shown as rows. /// public class MacroStabilityInwardsSoilLayerDataTable : DataGridViewControl @@ -46,11 +46,11 @@ /// are shown in the table. /// /// The collection of layer data to show. - public void SetData(IEnumerable layerData) + public void SetData(IEnumerable layerData) { if (layerData != null) { - IEnumerable macroStabilityInwardsSoilLayerData = layerData.ToArray(); + IEnumerable macroStabilityInwardsSoilLayerData = layerData.ToArray(); int layerIndex = macroStabilityInwardsSoilLayerData.Count(); SetDataSource(macroStabilityInwardsSoilLayerData.Select(soilLayerData => new MacroStabilityInwardsFormattedSoilLayerDataRow(soilLayerData, layerIndex--)).ToArray()); } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/IMacroStabilityInwardsSoilLayer.cs =================================================================== diff -u -r7585d2fd78627d94d55ffa16423af90a91e4efd4 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/IMacroStabilityInwardsSoilLayer.cs (.../IMacroStabilityInwardsSoilLayer.cs) (revision 7585d2fd78627d94d55ffa16423af90a91e4efd4) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/IMacroStabilityInwardsSoilLayer.cs (.../IMacroStabilityInwardsSoilLayer.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -29,6 +29,6 @@ /// /// Gets the data of the soil layer. /// - IMacroStabilityInwardsSoilLayerData Data { get; } + MacroStabilityInwardsSoilLayerData Data { get; } } } \ No newline at end of file Fisheye: Tag d9005dfa3b398d70ada0cf03cf408f8bcfc384db refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/IMacroStabilityInwardsSoilLayerData.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.cs =================================================================== diff -u -rcfa7dc2bce5e37f5677d9c8772b68599f9e26a0c -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.cs (.../MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.cs) (revision cfa7dc2bce5e37f5677d9c8772b68599f9e26a0c) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.cs (.../MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -29,9 +29,9 @@ public static class MacroStabilityInwardsSemiProbabilisticDesignVariableFactory { /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static VariationCoefficientDesignVariable GetAbovePhreaticLevel(IMacroStabilityInwardsSoilLayerData data) + public static VariationCoefficientDesignVariable GetAbovePhreaticLevel(MacroStabilityInwardsSoilLayerData data) { return new VariationCoefficientLogNormalDistributionDesignVariable(data.AbovePhreaticLevel) { @@ -40,9 +40,9 @@ } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static VariationCoefficientDesignVariable GetBelowPhreaticLevel(IMacroStabilityInwardsSoilLayerData data) + public static VariationCoefficientDesignVariable GetBelowPhreaticLevel(MacroStabilityInwardsSoilLayerData data) { return new VariationCoefficientLogNormalDistributionDesignVariable(data.BelowPhreaticLevel) { @@ -51,9 +51,9 @@ } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static VariationCoefficientDesignVariable GetCohesion(IMacroStabilityInwardsSoilLayerData data) + public static VariationCoefficientDesignVariable GetCohesion(MacroStabilityInwardsSoilLayerData data) { return new VariationCoefficientLogNormalDistributionDesignVariable(data.Cohesion) { @@ -62,9 +62,9 @@ } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static VariationCoefficientDesignVariable GetFrictionAngle(IMacroStabilityInwardsSoilLayerData data) + public static VariationCoefficientDesignVariable GetFrictionAngle(MacroStabilityInwardsSoilLayerData data) { return new VariationCoefficientLogNormalDistributionDesignVariable(data.FrictionAngle) { @@ -73,9 +73,9 @@ } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static VariationCoefficientDesignVariable GetShearStrengthRatio(IMacroStabilityInwardsSoilLayerData data) + public static VariationCoefficientDesignVariable GetShearStrengthRatio(MacroStabilityInwardsSoilLayerData data) { return new VariationCoefficientLogNormalDistributionDesignVariable(data.ShearStrengthRatio) { @@ -84,9 +84,9 @@ } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static VariationCoefficientDesignVariable GetStrengthIncreaseExponent(IMacroStabilityInwardsSoilLayerData data) + public static VariationCoefficientDesignVariable GetStrengthIncreaseExponent(MacroStabilityInwardsSoilLayerData data) { return new VariationCoefficientLogNormalDistributionDesignVariable(data.StrengthIncreaseExponent) { @@ -95,9 +95,9 @@ } /// - /// Creates the design variable for . + /// Creates the design variable for . /// - public static VariationCoefficientDesignVariable GetPop(IMacroStabilityInwardsSoilLayerData data) + public static VariationCoefficientDesignVariable GetPop(MacroStabilityInwardsSoilLayerData data) { return new VariationCoefficientLogNormalDistributionDesignVariable(data.Pop) { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilLayerData.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilLayerData.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilLayerData.cs (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -0,0 +1,294 @@ +// 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 System.Drawing; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.Probabilistics; + +namespace Ringtoets.MacroStabilityInwards.Primitives +{ + /// + /// Data of a soil layer. + /// + public class MacroStabilityInwardsSoilLayerData + { + private readonly VariationCoefficientLogNormalDistribution abovePhreaticLevel; + private readonly VariationCoefficientLogNormalDistribution belowPhreaticLevel; + private readonly VariationCoefficientLogNormalDistribution cohesion; + private readonly VariationCoefficientLogNormalDistribution frictionAngle; + private readonly VariationCoefficientLogNormalDistribution strengthIncreaseExponent; + private readonly VariationCoefficientLogNormalDistribution shearStrengthRatio; + private readonly VariationCoefficientLogNormalDistribution pop; + private string materialName = string.Empty; + + /// + /// Creates a new instance of . + /// + public MacroStabilityInwardsSoilLayerData() + { + abovePhreaticLevel = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN, + Shift = RoundedDouble.NaN + }; + belowPhreaticLevel = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN, + Shift = RoundedDouble.NaN + }; + cohesion = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN + }; + frictionAngle = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN + }; + strengthIncreaseExponent = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN + }; + shearStrengthRatio = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN + }; + pop = new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN + }; + + ShearStrengthModel = MacroStabilityInwardsShearStrengthModel.CPhi; + } + + /// + /// Gets or sets a value indicating whether the layer is an aquifer. + /// + public bool IsAquifer { get; set; } + + /// + /// Gets or sets the name of the material that was assigned to the layer. + /// + /// Thrown when is null. + public string MaterialName + { + get + { + return materialName; + } + set + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + materialName = value; + } + } + + /// + /// Gets or sets the that was used to represent the layer. + /// + public Color Color { get; set; } + + /// + /// Gets or sets a value indicating whether to use POP for the layer. + /// + public bool UsePop { get; set; } + + /// + /// Gets or sets the shear strength model to use for the layer. + /// + public MacroStabilityInwardsShearStrengthModel ShearStrengthModel { get; set; } + + /// + /// Gets or sets the volumic weight of the layer above the phreatic level. + /// [kN/m³] + /// + public VariationCoefficientLogNormalDistribution AbovePhreaticLevel + { + get + { + return abovePhreaticLevel; + } + set + { + abovePhreaticLevel.Mean = value.Mean; + abovePhreaticLevel.CoefficientOfVariation = value.CoefficientOfVariation; + abovePhreaticLevel.Shift = value.Shift; + } + } + + /// + /// Gets or sets the volumic weight of the layer below the phreatic level. + /// [kN/m³] + /// + public VariationCoefficientLogNormalDistribution BelowPhreaticLevel + { + get + { + return belowPhreaticLevel; + } + set + { + belowPhreaticLevel.Mean = value.Mean; + belowPhreaticLevel.CoefficientOfVariation = value.CoefficientOfVariation; + belowPhreaticLevel.Shift = value.Shift; + } + } + + /// + /// Gets or sets the cohesion. + /// [kN/m³] + /// + public VariationCoefficientLogNormalDistribution Cohesion + { + get + { + return cohesion; + } + set + { + cohesion.Mean = value.Mean; + cohesion.CoefficientOfVariation = value.CoefficientOfVariation; + } + } + + /// + /// Gets or sets the friction angle. + /// [°] + /// + public VariationCoefficientLogNormalDistribution FrictionAngle + { + get + { + return frictionAngle; + } + set + { + frictionAngle.Mean = value.Mean; + frictionAngle.CoefficientOfVariation = value.CoefficientOfVariation; + } + } + + /// + /// Gets or sets the strength increase component. + /// [-] + /// + public VariationCoefficientLogNormalDistribution StrengthIncreaseExponent + { + get + { + return strengthIncreaseExponent; + } + set + { + strengthIncreaseExponent.Mean = value.Mean; + strengthIncreaseExponent.CoefficientOfVariation = value.CoefficientOfVariation; + } + } + + /// + /// Gets or sets the shear strength ratio. + /// [-] + /// + public VariationCoefficientLogNormalDistribution ShearStrengthRatio + { + get + { + return shearStrengthRatio; + } + set + { + shearStrengthRatio.Mean = value.Mean; + shearStrengthRatio.CoefficientOfVariation = value.CoefficientOfVariation; + } + } + + /// + /// Gets or sets the POP. + /// [kN/m²] + /// + public VariationCoefficientLogNormalDistribution Pop + { + get + { + return pop; + } + set + { + pop.Mean = value.Mean; + pop.CoefficientOfVariation = value.CoefficientOfVariation; + } + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((MacroStabilityInwardsSoilLayerData) obj); + } + + public override int GetHashCode() + { + unchecked + { + int hashCode = StringComparer.InvariantCulture.GetHashCode(materialName); + hashCode = (hashCode * 397) ^ IsAquifer.GetHashCode(); + hashCode = (hashCode * 397) ^ Color.GetHashCode(); + hashCode = (hashCode * 397) ^ UsePop.GetHashCode(); + hashCode = (hashCode * 397) ^ ShearStrengthModel.GetHashCode(); + hashCode = (hashCode * 397) ^ AbovePhreaticLevel.GetHashCode(); + hashCode = (hashCode * 397) ^ BelowPhreaticLevel.GetHashCode(); + hashCode = (hashCode * 397) ^ Cohesion.GetHashCode(); + hashCode = (hashCode * 397) ^ FrictionAngle.GetHashCode(); + hashCode = (hashCode * 397) ^ ShearStrengthRatio.GetHashCode(); + hashCode = (hashCode * 397) ^ StrengthIncreaseExponent.GetHashCode(); + hashCode = (hashCode * 397) ^ Pop.GetHashCode(); + return hashCode; + } + } + + private bool Equals(MacroStabilityInwardsSoilLayerData other) + { + return string.Equals(materialName, other.materialName, StringComparison.InvariantCulture) + && IsAquifer == other.IsAquifer + && Color.ToArgb().Equals(other.Color.ToArgb()) + && UsePop == other.UsePop + && ShearStrengthModel == other.ShearStrengthModel + && AbovePhreaticLevel.Equals(other.AbovePhreaticLevel) + && BelowPhreaticLevel.Equals(other.BelowPhreaticLevel) + && Cohesion.Equals(other.Cohesion) + && FrictionAngle.Equals(other.FrictionAngle) + && ShearStrengthRatio.Equals(other.ShearStrengthRatio) + && StrengthIncreaseExponent.Equals(other.StrengthIncreaseExponent) + && Pop.Equals(other.Pop); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj =================================================================== diff -u -r66894d34e58e0db658fa3183df8792ed244ccda3 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.csproj) (revision 66894d34e58e0db658fa3183df8792ed244ccda3) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.csproj) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -49,12 +49,12 @@ - + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/CalculatorInputAssert.cs =================================================================== diff -u -r66894d34e58e0db658fa3183df8792ed244ccda3 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/CalculatorInputAssert.cs (.../CalculatorInputAssert.cs) (revision 66894d34e58e0db658fa3183df8792ed244ccda3) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/CalculatorInputAssert.cs (.../CalculatorInputAssert.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -116,7 +116,7 @@ AssertLayers(original[i].NestedLayers.ToArray(), actual[i].NestedLayers.ToArray()); - IMacroStabilityInwardsSoilLayerData expectedData = original[i].Data; + MacroStabilityInwardsSoilLayerData expectedData = original[i].Data; Assert.AreEqual(expectedData.MaterialName, actual[i].MaterialName); Assert.AreEqual(expectedData.UsePop, actual[i].UsePop); Assert.AreEqual(expectedData.IsAquifer, actual[i].IsAquifer); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsSoilLayerDataTest.cs =================================================================== diff -u -r90a9502badff5788374461a1b2179a5dd0e866a2 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsSoilLayerDataTest.cs (.../MacroStabilityInwardsSoilLayerDataTest.cs) (revision 90a9502badff5788374461a1b2179a5dd0e866a2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsSoilLayerDataTest.cs (.../MacroStabilityInwardsSoilLayerDataTest.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -28,7 +28,6 @@ using NUnit.Framework; using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Common.Data.TestUtil; -using Ringtoets.MacroStabilityInwards.Data.SoilProfile; using Ringtoets.MacroStabilityInwards.Primitives; namespace Ringtoets.MacroStabilityInwards.Data.Test.SoilProfile @@ -43,7 +42,7 @@ var data = new MacroStabilityInwardsSoilLayerData(); // Assert - Assert.IsInstanceOf(data); + Assert.IsInstanceOf(data); Assert.IsFalse(data.IsAquifer); Assert.IsEmpty(data.MaterialName); Assert.AreEqual(Color.Empty, data.Color); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilLayerTransformerTest.cs =================================================================== diff -u -r7585d2fd78627d94d55ffa16423af90a91e4efd4 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilLayerTransformerTest.cs (.../MacroStabilityInwardsSoilLayerTransformerTest.cs) (revision 7585d2fd78627d94d55ffa16423af90a91e4efd4) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilLayerTransformerTest.cs (.../MacroStabilityInwardsSoilLayerTransformerTest.cs) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -108,7 +108,7 @@ // Assert Assert.AreEqual(top, soilLayer1D.Top); - IMacroStabilityInwardsSoilLayerData data = soilLayer1D.Data; + MacroStabilityInwardsSoilLayerData data = soilLayer1D.Data; Assert.AreEqual(materialName, data.MaterialName); bool expectedIsAquifer = isAquifer.Equals(1.0); @@ -376,7 +376,7 @@ MacroStabilityInwardsSoilLayer2D soilLayer2D = MacroStabilityInwardsSoilLayerTransformer.Transform(layer); // Assert - IMacroStabilityInwardsSoilLayerData data = soilLayer2D.Data; + MacroStabilityInwardsSoilLayerData data = soilLayer2D.Data; Assert.AreEqual(materialName, data.MaterialName); bool expectedIsAquifer = isAquifer.Equals(1.0); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSoilLayerDataTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSoilLayerDataTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/MacroStabilityInwardsSoilLayerDataTest.cs (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -0,0 +1,310 @@ +// 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 System.Collections.Generic; +using System.Drawing; +using System.Linq; +using Core.Common.Base.Data; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; +using Ringtoets.Common.Data.TestUtil; + +namespace Ringtoets.MacroStabilityInwards.Primitives.Test +{ + [TestFixture] + public class MacroStabilityInwardsSoilLayerDataTest + { + [Test] + public void DefaultConstructor_DefaultValuesSet() + { + // Call + var data = new MacroStabilityInwardsSoilLayerData(); + + // Assert + Assert.IsFalse(data.IsAquifer); + Assert.IsEmpty(data.MaterialName); + Assert.AreEqual(Color.Empty, data.Color); + + Assert.IsFalse(data.UsePop); + Assert.AreEqual(MacroStabilityInwardsShearStrengthModel.CPhi, data.ShearStrengthModel); + + DistributionAssert.AreEqual(new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN, + Shift = RoundedDouble.NaN + }, data.AbovePhreaticLevel); + + DistributionAssert.AreEqual(new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN, + Shift = RoundedDouble.NaN + }, data.BelowPhreaticLevel); + + DistributionAssert.AreEqual(new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN + }, data.Cohesion); + + DistributionAssert.AreEqual(new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN + }, data.FrictionAngle); + + DistributionAssert.AreEqual(new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN + }, data.ShearStrengthRatio); + + DistributionAssert.AreEqual(new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN + }, data.StrengthIncreaseExponent); + + DistributionAssert.AreEqual(new VariationCoefficientLogNormalDistribution(2) + { + Mean = RoundedDouble.NaN, + CoefficientOfVariation = RoundedDouble.NaN + }, data.Pop); + } + + [Test] + public void MaterialName_Null_ThrowsArgumentNullException() + { + // Setup + var data = new MacroStabilityInwardsSoilLayerData(); + + // Call + TestDelegate test = () => data.MaterialName = null; + + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("value", paramName); + } + + [Test] + [TestCase("")] + [TestCase("A name")] + public void MaterialName_NotNullValue_ValueSet(string materialName) + { + // Setup + var data = new MacroStabilityInwardsSoilLayerData(); + + // Call + data.MaterialName = materialName; + + // Assert + Assert.AreEqual(materialName, data.MaterialName); + } + + [Test] + public void GetHashCode_EqualProperties_AreEqual() + { + // Setup + MacroStabilityInwardsSoilLayerData dataA = CreateRandomData(21); + MacroStabilityInwardsSoilLayerData dataB = CreateRandomData(21); + + // Precondition + Assert.AreEqual(dataA, dataB); + Assert.AreEqual(dataB, dataA); + + // Call & Assert + Assert.AreEqual(dataA.GetHashCode(), dataB.GetHashCode()); + Assert.AreEqual(dataB.GetHashCode(), dataA.GetHashCode()); + } + + [Test] + public void Equals_DifferentType_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSoilLayerData data = CreateRandomData(21); + + // Call + bool areEqual = data.Equals(new object()); + + // Assert + Assert.IsFalse(areEqual); + } + + [Test] + public void Equals_Null_ReturnsFalse() + { + // Setup + MacroStabilityInwardsSoilLayerData data = CreateRandomData(21); + + // Call + bool areEqual = data.Equals(null); + + // Assert + Assert.IsFalse(areEqual); + } + + [Test] + [TestCaseSource(nameof(ChangeSingleDataProperties))] + public void Equals_ChangeSingleProperty_ReturnsFalse(Action changeProperty) + { + // Setup + MacroStabilityInwardsSoilLayerData data = CreateRandomData(21); + MacroStabilityInwardsSoilLayerData dataToChange = CreateRandomData(21); + + changeProperty(dataToChange); + + // Call + bool areEqualOne = data.Equals(dataToChange); + bool areEqualTwo = dataToChange.Equals(data); + + // Assert + Assert.IsFalse(areEqualOne); + Assert.IsFalse(areEqualTwo); + } + + [Test] + [TestCaseSource(nameof(DataPropertiesCombinations))] + public void Equals_DifferentScenarios_ReturnsExpectedResult(MacroStabilityInwardsSoilLayerData data, MacroStabilityInwardsSoilLayerData otherData, bool expectedEqual) + { + // Call + bool areEqualOne = data.Equals(otherData); + bool areEqualTwo = otherData.Equals(data); + + // Assert + Assert.AreEqual(expectedEqual, areEqualOne); + Assert.AreEqual(expectedEqual, areEqualTwo); + } + + private static IEnumerable ChangeSingleDataProperties() + { + yield return new TestCaseData(new Action(lp => lp.ShearStrengthModel = (MacroStabilityInwardsShearStrengthModel) 9)); + yield return new TestCaseData(new Action(lp => lp.MaterialName = "interesting")); + yield return new TestCaseData(new Action(lp => lp.IsAquifer = !lp.IsAquifer)); + yield return new TestCaseData(new Action(lp => lp.UsePop = !lp.UsePop)); + yield return new TestCaseData(new Action(lp => lp.Color = lp.Color.ToArgb().Equals(Color.Aqua.ToArgb()) ? Color.Bisque : Color.Aqua)); + yield return new TestCaseData(new Action(lp => lp.AbovePhreaticLevel.Mean = (RoundedDouble) (11.0 - lp.AbovePhreaticLevel.Mean))); + yield return new TestCaseData(new Action(lp => lp.AbovePhreaticLevel.CoefficientOfVariation = (RoundedDouble) (1.0 - lp.AbovePhreaticLevel.CoefficientOfVariation))); + yield return new TestCaseData(new Action(lp => lp.AbovePhreaticLevel.Shift = (RoundedDouble) (1.0 - lp.AbovePhreaticLevel.Shift))); + yield return new TestCaseData(new Action(lp => lp.BelowPhreaticLevel.Mean = (RoundedDouble) (12.0 - lp.BelowPhreaticLevel.Mean))); + yield return new TestCaseData(new Action(lp => lp.BelowPhreaticLevel.CoefficientOfVariation = (RoundedDouble) (1.0 - lp.BelowPhreaticLevel.CoefficientOfVariation))); + yield return new TestCaseData(new Action(lp => lp.BelowPhreaticLevel.Shift = (RoundedDouble) (1.0 - lp.BelowPhreaticLevel.Shift))); + yield return new TestCaseData(new Action(lp => lp.Cohesion.Mean = (RoundedDouble) (11.0 - lp.Cohesion.Mean))); + yield return new TestCaseData(new Action(lp => lp.Cohesion.CoefficientOfVariation = (RoundedDouble) (1.0 - lp.Cohesion.CoefficientOfVariation))); + yield return new TestCaseData(new Action(lp => lp.FrictionAngle.Mean = (RoundedDouble) (11.0 - lp.FrictionAngle.Mean))); + yield return new TestCaseData(new Action(lp => lp.FrictionAngle.CoefficientOfVariation = (RoundedDouble) (1.0 - lp.FrictionAngle.CoefficientOfVariation))); + yield return new TestCaseData(new Action(lp => lp.ShearStrengthRatio.Mean = (RoundedDouble) (11.0 - lp.ShearStrengthRatio.Mean))); + yield return new TestCaseData(new Action(lp => lp.ShearStrengthRatio.CoefficientOfVariation = (RoundedDouble) (1.0 - lp.ShearStrengthRatio.CoefficientOfVariation))); + yield return new TestCaseData(new Action(lp => lp.StrengthIncreaseExponent.Mean = (RoundedDouble) (11.0 - lp.StrengthIncreaseExponent.Mean))); + yield return new TestCaseData(new Action(lp => lp.StrengthIncreaseExponent.CoefficientOfVariation = (RoundedDouble) (1.0 - lp.StrengthIncreaseExponent.CoefficientOfVariation))); + yield return new TestCaseData(new Action(lp => lp.Pop.Mean = (RoundedDouble) (11.0 - lp.Pop.Mean))); + yield return new TestCaseData(new Action(lp => lp.Pop.CoefficientOfVariation = (RoundedDouble) (1.0 - lp.Pop.CoefficientOfVariation))); + } + + private static TestCaseData[] DataPropertiesCombinations() + { + MacroStabilityInwardsSoilLayerData dataA = CreateRandomData(21); + MacroStabilityInwardsSoilLayerData dataB = CreateRandomData(21); + MacroStabilityInwardsSoilLayerData dataC = CreateRandomData(73); + MacroStabilityInwardsSoilLayerData dataD = CreateRandomData(21); + + return new[] + { + new TestCaseData(dataA, dataA, true) + { + TestName = "Equals_DataADataA_True" + }, + new TestCaseData(dataA, dataB, true) + { + TestName = "Equals_DataADataB_True" + }, + new TestCaseData(dataB, dataD, true) + { + TestName = "Equals_DataBDataD_True" + }, + new TestCaseData(dataA, dataD, true) + { + TestName = "Equals_DataADataD_True" + }, + new TestCaseData(dataB, dataC, false) + { + TestName = "Equals_DataBDataC_False" + }, + new TestCaseData(dataA, dataC, false) + { + TestName = "Equals_DataADataC_False" + } + }; + } + + private static MacroStabilityInwardsSoilLayerData CreateRandomData(int randomSeed) + { + var random = new Random(randomSeed); + return new MacroStabilityInwardsSoilLayerData + { + MaterialName = string.Join("", Enumerable.Repeat('x', random.Next(0, 40))), + Color = Color.FromKnownColor(random.NextEnumValue()), + IsAquifer = random.NextBoolean(), + UsePop = random.NextBoolean(), + ShearStrengthModel = random.NextEnumValue(), + AbovePhreaticLevel = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) 10, + CoefficientOfVariation = (RoundedDouble) 0.2, + Shift = (RoundedDouble) 1 + }, + BelowPhreaticLevel = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) 11, + CoefficientOfVariation = (RoundedDouble) 0.6, + Shift = (RoundedDouble) 1 + }, + Cohesion = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) 10, + CoefficientOfVariation = (RoundedDouble) 0.2 + }, + FrictionAngle = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) 10, + CoefficientOfVariation = (RoundedDouble) 0.2 + }, + ShearStrengthRatio = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) 10, + CoefficientOfVariation = (RoundedDouble) 0.2 + }, + StrengthIncreaseExponent = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) 10, + CoefficientOfVariation = (RoundedDouble) 0.2 + }, + Pop = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) 10, + CoefficientOfVariation = (RoundedDouble) 0.2 + } + }; + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj =================================================================== diff -u -r66894d34e58e0db658fa3183df8792ed244ccda3 -rd9005dfa3b398d70ada0cf03cf408f8bcfc384db --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.Test.csproj) (revision 66894d34e58e0db658fa3183df8792ed244ccda3) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.Test.csproj) (revision d9005dfa3b398d70ada0cf03cf408f8bcfc384db) @@ -47,6 +47,7 @@ + @@ -55,6 +56,7 @@ +