Index: Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.2_17.3.sql =================================================================== diff -u -r686466dda6406ee2c7fb1f33faa60494878b1fc8 -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.2_17.3.sql (.../Migration_17.2_17.3.sql) (revision 686466dda6406ee2c7fb1f33faa60494878b1fc8) +++ Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.2_17.3.sql (.../Migration_17.2_17.3.sql) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -255,7 +255,7 @@ asfm.[AssessmentSectionName], asfm.[FailureMechanismId], asfm.[FailureMechanismName], - "De waarde van '" || source.[BelowPhreaticLevelMean] || "' voor het gemiddelde van parameter 'Verzadigd gewicht' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." + "De waarde '" || source.[BelowPhreaticLevelMean] || "' voor het gemiddelde van parameter 'Verzadigd gewicht' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." FROM PipingSoilLayerEntity as psl JOIN PipingSoilProfileEntity USING(PipingSoilProfileEntityId) JOIN PipingStochasticSoilProfileEntity USING(PipingSoilProfileEntityId) @@ -271,7 +271,7 @@ asfm.[AssessmentSectionName], asfm.[FailureMechanismId], asfm.[FailureMechanismName], - "De waarde van '" || source.[BelowPhreaticLevelDeviation] || "' voor de standaard afwijking van parameter 'Verzadigd gewicht' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." + "De waarde '" || source.[BelowPhreaticLevelDeviation] || "' voor de standaardafwijking van parameter 'Verzadigd gewicht' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." FROM PipingSoilLayerEntity as psl JOIN PipingSoilProfileEntity USING(PipingSoilProfileEntityId) JOIN PipingStochasticSoilProfileEntity USING(PipingSoilProfileEntityId) @@ -286,7 +286,7 @@ asfm.[AssessmentSectionName], asfm.[FailureMechanismId], asfm.[FailureMechanismName], - "De waarde van '" || source.[BelowPhreaticLevelShift] || "' voor de verschuiving van parameter 'Verzadigd gewicht' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." + "De waarde '" || source.[BelowPhreaticLevelShift] || "' voor de verschuiving van parameter 'Verzadigd gewicht' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." FROM PipingSoilLayerEntity as psl JOIN PipingSoilProfileEntity USING(PipingSoilProfileEntityId) JOIN PipingStochasticSoilProfileEntity USING(PipingSoilProfileEntityId) @@ -301,7 +301,7 @@ asfm.[AssessmentSectionName], asfm.[FailureMechanismId], asfm.[FailureMechanismName], - "De waarde van '" || source.[DiameterD70Mean] || "' voor het gemiddelde van parameter 'd70' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." + "De waarde '" || source.[DiameterD70Mean] || "' voor het gemiddelde van parameter 'd70' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." FROM PipingSoilLayerEntity as psl JOIN PipingSoilProfileEntity USING(PipingSoilProfileEntityId) JOIN PipingStochasticSoilProfileEntity USING(PipingSoilProfileEntityId) @@ -316,7 +316,7 @@ asfm.[AssessmentSectionName], asfm.[FailureMechanismId], asfm.[FailureMechanismName], - "De waarde van '" || source.[DiameterD70CoefficientOfVariation] || "' voor de variatieco" || CAST(X'c3ab' AS TEXT) || "ffici" || CAST(X'c3ab' AS TEXT) || "nt van parameter 'd70' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." + "De waarde '" || source.[DiameterD70CoefficientOfVariation] || "' voor de variatieco" || CAST(X'c3ab' AS TEXT) || "ffici" || CAST(X'c3ab' AS TEXT) || "nt van parameter 'd70' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." FROM PipingSoilLayerEntity as psl JOIN PipingSoilProfileEntity USING(PipingSoilProfileEntityId) JOIN PipingStochasticSoilProfileEntity USING(PipingSoilProfileEntityId) @@ -331,7 +331,7 @@ asfm.[AssessmentSectionName], asfm.[FailureMechanismId], asfm.[FailureMechanismName], - "De waarde van '" || source.[PermeabilityMean] || "' voor het gemiddelde van parameter 'Doorlatendheid' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." + "De waarde '" || source.[PermeabilityMean] || "' voor het gemiddelde van parameter 'Doorlatendheid' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." FROM PipingSoilLayerEntity as psl JOIN PipingSoilProfileEntity USING(PipingSoilProfileEntityId) JOIN PipingStochasticSoilProfileEntity USING(PipingSoilProfileEntityId) @@ -346,7 +346,7 @@ asfm.[AssessmentSectionName], asfm.[FailureMechanismId], asfm.[FailureMechanismName], - "De waarde van '" || source.[PermeabilityCoefficientOfVariation] || "' voor de variatieco" || CAST(X'c3ab' AS TEXT) || "ffici" || CAST(X'c3ab' AS TEXT) || "nt van parameter 'Doorlatendheid' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." + "De waarde '" || source.[PermeabilityCoefficientOfVariation] || "' voor de variatieco" || CAST(X'c3ab' AS TEXT) || "ffici" || CAST(X'c3ab' AS TEXT) || "nt van parameter 'Doorlatendheid' van ondergrondlaag '" || source.[MaterialName] || "' is ongeldig en is veranderd naar NaN." FROM PipingSoilLayerEntity as psl JOIN PipingSoilProfileEntity USING(PipingSoilProfileEntityId) JOIN PipingStochasticSoilProfileEntity USING(PipingSoilProfileEntityId) Index: Application/Ringtoets/test/Application.Ringtoets.Migration.Test/RingtoetsProjectMigratorTest.cs =================================================================== diff -u -r686466dda6406ee2c7fb1f33faa60494878b1fc8 -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Application/Ringtoets/test/Application.Ringtoets.Migration.Test/RingtoetsProjectMigratorTest.cs (.../RingtoetsProjectMigratorTest.cs) (revision 686466dda6406ee2c7fb1f33faa60494878b1fc8) +++ Application/Ringtoets/test/Application.Ringtoets.Migration.Test/RingtoetsProjectMigratorTest.cs (.../RingtoetsProjectMigratorTest.cs) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -479,7 +479,7 @@ $@"Gevolgen van de migratie van versie 17.2 naar versie 17.3:{Environment.NewLine}" + $@"* Traject: 'assessmentSection'{Environment.NewLine}" + $@" + Toetsspoor: 'Piping'{Environment.NewLine}" + - $@" - De waarde van '3.2' voor de verschuiving van parameter 'Verzadigd gewicht' van ondergrondlaag 'HotPinkLayer' is ongeldig en is veranderd naar NaN."); + $@" - De waarde '3.2' voor de verschuiving van parameter 'Verzadigd gewicht' van ondergrondlaag 'HotPinkLayer' is ongeldig en is veranderd naar NaN."); var expectedLogMessagesAndLevel = new[] { Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensionsTest.cs =================================================================== diff -u -r3353bf211a1b34b81752a0dcdc40c153a94df1fa -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensionsTest.cs (.../MacroStabilityInwardsSoilLayer1DCreateExtensionsTest.cs) (revision 3353bf211a1b34b81752a0dcdc40c153a94df1fa) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensionsTest.cs (.../MacroStabilityInwardsSoilLayer1DCreateExtensionsTest.cs) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -26,6 +26,8 @@ using Core.Common.Base.Data; using Core.Common.TestUtil; using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; using Ringtoets.MacroStabilityInwards.Primitives; @@ -113,22 +115,50 @@ Assert.AreEqual(data.Color.ToInt64(), Convert.ToInt64(entity.Color)); Assert.AreEqual(Convert.ToByte(data.UsePop), entity.UsePop); Assert.AreEqual(Convert.ToByte(data.ShearStrengthModel), entity.ShearStrengthModel); - Assert.AreEqual(data.AbovePhreaticLevel.Mean, entity.AbovePhreaticLevelMean); - Assert.AreEqual(data.AbovePhreaticLevel.CoefficientOfVariation, entity.AbovePhreaticLevelCoefficientOfVariation); - Assert.AreEqual(data.AbovePhreaticLevel.Shift, entity.AbovePhreaticLevelShift); - Assert.AreEqual(data.BelowPhreaticLevel.Mean, entity.BelowPhreaticLevelMean); - Assert.AreEqual(data.BelowPhreaticLevel.CoefficientOfVariation, entity.BelowPhreaticLevelCoefficientOfVariation); - Assert.AreEqual(data.BelowPhreaticLevel.Shift, entity.BelowPhreaticLevelShift); - Assert.AreEqual(data.Cohesion.Mean, entity.CohesionMean); - Assert.AreEqual(data.Cohesion.CoefficientOfVariation, entity.CohesionCoefficientOfVariation); - Assert.AreEqual(data.FrictionAngle.Mean, entity.FrictionAngleMean); - Assert.AreEqual(data.FrictionAngle.CoefficientOfVariation, entity.FrictionAngleCoefficientOfVariation); - Assert.AreEqual(data.ShearStrengthRatio.Mean, entity.ShearStrengthRatioMean); - Assert.AreEqual(data.ShearStrengthRatio.CoefficientOfVariation, entity.ShearStrengthRatioCoefficientOfVariation); - Assert.AreEqual(data.StrengthIncreaseExponent.Mean, entity.StrengthIncreaseExponentMean); - Assert.AreEqual(data.StrengthIncreaseExponent.CoefficientOfVariation, entity.StrengthIncreaseExponentCoefficientOfVariation); - Assert.AreEqual(data.Pop.Mean, entity.PopMean); - Assert.AreEqual(data.Pop.CoefficientOfVariation, entity.PopCoefficientOfVariation); + + VariationCoefficientLogNormalDistribution abovePhreaticLevelDistribution = data.AbovePhreaticLevel; + Assert.AreEqual(abovePhreaticLevelDistribution.Mean, entity.AbovePhreaticLevelMean, + abovePhreaticLevelDistribution.GetAccuracy()); + Assert.AreEqual(abovePhreaticLevelDistribution.CoefficientOfVariation, entity.AbovePhreaticLevelCoefficientOfVariation, + abovePhreaticLevelDistribution.GetAccuracy()); + Assert.AreEqual(abovePhreaticLevelDistribution.Shift, entity.AbovePhreaticLevelShift, + abovePhreaticLevelDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution belowPhreaticLevelDistribution = data.BelowPhreaticLevel; + Assert.AreEqual(belowPhreaticLevelDistribution.Mean, entity.BelowPhreaticLevelMean, + belowPhreaticLevelDistribution.GetAccuracy()); + Assert.AreEqual(belowPhreaticLevelDistribution.CoefficientOfVariation, entity.BelowPhreaticLevelCoefficientOfVariation, + belowPhreaticLevelDistribution.GetAccuracy()); + Assert.AreEqual(belowPhreaticLevelDistribution.Shift, entity.BelowPhreaticLevelShift, + belowPhreaticLevelDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution cohesionDistribution = data.Cohesion; + Assert.AreEqual(cohesionDistribution.Mean, entity.CohesionMean, + cohesionDistribution.GetAccuracy()); + Assert.AreEqual(cohesionDistribution.CoefficientOfVariation, entity.CohesionCoefficientOfVariation, + cohesionDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution frictionAngleDistribution = data.FrictionAngle; + Assert.AreEqual(frictionAngleDistribution.Mean, entity.FrictionAngleMean, + frictionAngleDistribution.GetAccuracy()); + Assert.AreEqual(frictionAngleDistribution.CoefficientOfVariation, entity.FrictionAngleCoefficientOfVariation, + frictionAngleDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution shearStrengthRatioDistribution = data.ShearStrengthRatio; + Assert.AreEqual(shearStrengthRatioDistribution.Mean, entity.ShearStrengthRatioMean, + shearStrengthRatioDistribution.GetAccuracy()); + Assert.AreEqual(shearStrengthRatioDistribution.CoefficientOfVariation, entity.ShearStrengthRatioCoefficientOfVariation, + shearStrengthRatioDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution strengthIncreaseExponentDistribution = data.StrengthIncreaseExponent; + Assert.AreEqual(strengthIncreaseExponentDistribution.Mean, entity.StrengthIncreaseExponentMean, + strengthIncreaseExponentDistribution.GetAccuracy()); + Assert.AreEqual(strengthIncreaseExponentDistribution.CoefficientOfVariation, entity.StrengthIncreaseExponentCoefficientOfVariation, + strengthIncreaseExponentDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution popDistribution = data.Pop; + Assert.AreEqual(popDistribution.Mean, entity.PopMean, popDistribution.GetAccuracy()); + Assert.AreEqual(popDistribution.CoefficientOfVariation, entity.PopCoefficientOfVariation, popDistribution.GetAccuracy()); Assert.AreEqual(order, entity.Order); } Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensionsTest.cs =================================================================== diff -u -r3353bf211a1b34b81752a0dcdc40c153a94df1fa -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensionsTest.cs (.../MacroStabilityInwardsSoilLayer2DCreateExtensionsTest.cs) (revision 3353bf211a1b34b81752a0dcdc40c153a94df1fa) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensionsTest.cs (.../MacroStabilityInwardsSoilLayer2DCreateExtensionsTest.cs) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -28,6 +28,8 @@ using Core.Common.Base.Data; using Core.Common.TestUtil; using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.MacroStabilityInwards.Data.TestUtil.SoilProfile; using Ringtoets.MacroStabilityInwards.Primitives; using Ringtoets.MacroStabilityInwards.Primitives.TestUtil; @@ -244,22 +246,51 @@ Assert.AreEqual(data.Color.ToInt64(), Convert.ToInt64(entity.Color)); Assert.AreEqual(Convert.ToByte(data.UsePop), entity.UsePop); Assert.AreEqual(Convert.ToByte(data.ShearStrengthModel), entity.ShearStrengthModel); - Assert.AreEqual(data.AbovePhreaticLevel.Mean, entity.AbovePhreaticLevelMean); - Assert.AreEqual(data.AbovePhreaticLevel.CoefficientOfVariation, entity.AbovePhreaticLevelCoefficientOfVariation); - Assert.AreEqual(data.AbovePhreaticLevel.Shift, entity.AbovePhreaticLevelShift); - Assert.AreEqual(data.BelowPhreaticLevel.Mean, entity.BelowPhreaticLevelMean); - Assert.AreEqual(data.BelowPhreaticLevel.CoefficientOfVariation, entity.BelowPhreaticLevelCoefficientOfVariation); - Assert.AreEqual(data.BelowPhreaticLevel.Shift, entity.BelowPhreaticLevelShift); - Assert.AreEqual(data.Cohesion.Mean, entity.CohesionMean); - Assert.AreEqual(data.Cohesion.CoefficientOfVariation, entity.CohesionCoefficientOfVariation); - Assert.AreEqual(data.FrictionAngle.Mean, entity.FrictionAngleMean); - Assert.AreEqual(data.FrictionAngle.CoefficientOfVariation, entity.FrictionAngleCoefficientOfVariation); - Assert.AreEqual(data.ShearStrengthRatio.Mean, entity.ShearStrengthRatioMean); - Assert.AreEqual(data.ShearStrengthRatio.CoefficientOfVariation, entity.ShearStrengthRatioCoefficientOfVariation); - Assert.AreEqual(data.StrengthIncreaseExponent.Mean, entity.StrengthIncreaseExponentMean); - Assert.AreEqual(data.StrengthIncreaseExponent.CoefficientOfVariation, entity.StrengthIncreaseExponentCoefficientOfVariation); - Assert.AreEqual(data.Pop.Mean, entity.PopMean); - Assert.AreEqual(data.Pop.CoefficientOfVariation, entity.PopCoefficientOfVariation); + + VariationCoefficientLogNormalDistribution abovePhreaticLevelDistribution = data.AbovePhreaticLevel; + Assert.AreEqual(abovePhreaticLevelDistribution.Mean, entity.AbovePhreaticLevelMean, + abovePhreaticLevelDistribution.GetAccuracy()); + Assert.AreEqual(abovePhreaticLevelDistribution.CoefficientOfVariation, entity.AbovePhreaticLevelCoefficientOfVariation, + abovePhreaticLevelDistribution.GetAccuracy()); + Assert.AreEqual(abovePhreaticLevelDistribution.Shift, entity.AbovePhreaticLevelShift, + abovePhreaticLevelDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution belowPhreaticLevelDistribution = data.BelowPhreaticLevel; + Assert.AreEqual(belowPhreaticLevelDistribution.Mean, entity.BelowPhreaticLevelMean, + belowPhreaticLevelDistribution.GetAccuracy()); + Assert.AreEqual(belowPhreaticLevelDistribution.CoefficientOfVariation, entity.BelowPhreaticLevelCoefficientOfVariation, + belowPhreaticLevelDistribution.GetAccuracy()); + Assert.AreEqual(belowPhreaticLevelDistribution.Shift, entity.BelowPhreaticLevelShift, + belowPhreaticLevelDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution cohesionDistribution = data.Cohesion; + Assert.AreEqual(cohesionDistribution.Mean, entity.CohesionMean, + cohesionDistribution.GetAccuracy()); + Assert.AreEqual(cohesionDistribution.CoefficientOfVariation, entity.CohesionCoefficientOfVariation, + cohesionDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution frictionAngleDistribution = data.FrictionAngle; + Assert.AreEqual(frictionAngleDistribution.Mean, entity.FrictionAngleMean, + frictionAngleDistribution.GetAccuracy()); + Assert.AreEqual(frictionAngleDistribution.CoefficientOfVariation, entity.FrictionAngleCoefficientOfVariation, + frictionAngleDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution shearStrengthRatioDistribution = data.ShearStrengthRatio; + Assert.AreEqual(shearStrengthRatioDistribution.Mean, entity.ShearStrengthRatioMean, + shearStrengthRatioDistribution.GetAccuracy()); + Assert.AreEqual(shearStrengthRatioDistribution.CoefficientOfVariation, entity.ShearStrengthRatioCoefficientOfVariation, + shearStrengthRatioDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution strengthIncreaseExponentDistribution = data.StrengthIncreaseExponent; + Assert.AreEqual(strengthIncreaseExponentDistribution.Mean, entity.StrengthIncreaseExponentMean, + strengthIncreaseExponentDistribution.GetAccuracy()); + Assert.AreEqual(strengthIncreaseExponentDistribution.CoefficientOfVariation, entity.StrengthIncreaseExponentCoefficientOfVariation, + strengthIncreaseExponentDistribution.GetAccuracy()); + + VariationCoefficientLogNormalDistribution popDistribution = data.Pop; + Assert.AreEqual(popDistribution.Mean, entity.PopMean, popDistribution.GetAccuracy()); + Assert.AreEqual(popDistribution.CoefficientOfVariation, entity.PopCoefficientOfVariation, popDistribution.GetAccuracy()); + Assert.AreEqual(order, entity.Order); AssertOuterRing(soilLayer.OuterRing, entity); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo173IntegrationTest.cs =================================================================== diff -u -r686466dda6406ee2c7fb1f33faa60494878b1fc8 -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo173IntegrationTest.cs (.../MigrationTo173IntegrationTest.cs) (revision 686466dda6406ee2c7fb1f33faa60494878b1fc8) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo173IntegrationTest.cs (.../MigrationTo173IntegrationTest.cs) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -299,25 +299,25 @@ new MigrationLogMessage("17.2", newVersion, " + Toetsspoor: 'Piping'"), messages[i++]); AssertMigrationLogMessageEqual( - new MigrationLogMessage("17.2", newVersion, " - De waarde van '-0.125' voor de variatiecoëfficiënt van parameter 'd70' van ondergrondlaag 'DiameterD70Variation' is ongeldig en is veranderd naar NaN."), + new MigrationLogMessage("17.2", newVersion, " - De waarde '-0.125' voor de variatiecoëfficiënt van parameter 'd70' van ondergrondlaag 'DiameterD70Variation' is ongeldig en is veranderd naar NaN."), messages[i++]); AssertMigrationLogMessageEqual( - new MigrationLogMessage("17.2", newVersion, " - De waarde van '-1.0' voor het gemiddelde van parameter 'Doorlatendheid' van ondergrondlaag 'PermeabilityMean' is ongeldig en is veranderd naar NaN."), + new MigrationLogMessage("17.2", newVersion, " - De waarde '-1.0' voor het gemiddelde van parameter 'Doorlatendheid' van ondergrondlaag 'PermeabilityMean' is ongeldig en is veranderd naar NaN."), messages[i++]); AssertMigrationLogMessageEqual( - new MigrationLogMessage("17.2", newVersion, " - De waarde van '-1.0e-06' voor het gemiddelde van parameter 'd70' van ondergrondlaag 'DiameterD70Mean' is ongeldig en is veranderd naar NaN."), + new MigrationLogMessage("17.2", newVersion, " - De waarde '-1.0e-06' voor het gemiddelde van parameter 'd70' van ondergrondlaag 'DiameterD70Mean' is ongeldig en is veranderd naar NaN."), messages[i++]); AssertMigrationLogMessageEqual( - new MigrationLogMessage("17.2", newVersion, " - De waarde van '-10.0' voor de standaard afwijking van parameter 'Verzadigd gewicht' van ondergrondlaag 'BelowPhreaticLevelDeviation' is ongeldig en is veranderd naar NaN."), + new MigrationLogMessage("17.2", newVersion, " - De waarde '-10.0' voor de standaardafwijking van parameter 'Verzadigd gewicht' van ondergrondlaag 'BelowPhreaticLevelDeviation' is ongeldig en is veranderd naar NaN."), messages[i++]); AssertMigrationLogMessageEqual( - new MigrationLogMessage("17.2", newVersion, " - De waarde van '-10.0' voor de variatiecoëfficiënt van parameter 'Doorlatendheid' van ondergrondlaag 'PermeabilityVariation' is ongeldig en is veranderd naar NaN."), + new MigrationLogMessage("17.2", newVersion, " - De waarde '-10.0' voor de variatiecoëfficiënt van parameter 'Doorlatendheid' van ondergrondlaag 'PermeabilityVariation' is ongeldig en is veranderd naar NaN."), messages[i++]); AssertMigrationLogMessageEqual( - new MigrationLogMessage("17.2", newVersion, " - De waarde van '0.0' voor het gemiddelde van parameter 'Verzadigd gewicht' van ondergrondlaag 'BelowPhreaticLevelMean' is ongeldig en is veranderd naar NaN."), + new MigrationLogMessage("17.2", newVersion, " - De waarde '0.0' voor het gemiddelde van parameter 'Verzadigd gewicht' van ondergrondlaag 'BelowPhreaticLevelMean' is ongeldig en is veranderd naar NaN."), messages[i++]); AssertMigrationLogMessageEqual( - new MigrationLogMessage("17.2", newVersion, " - De waarde van '15.0' voor de verschuiving van parameter 'Verzadigd gewicht' van ondergrondlaag 'BelowPhreaticLevelShift' is ongeldig en is veranderd naar NaN."), + new MigrationLogMessage("17.2", newVersion, " - De waarde '15.0' voor de verschuiving van parameter 'Verzadigd gewicht' van ondergrondlaag 'BelowPhreaticLevelShift' is ongeldig en is veranderd naar NaN."), messages[i]); } Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/DistributionAssertTest.cs =================================================================== diff -u -r12d68f588f3d39996a3a34577f9ec94a87bec865 -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/DistributionAssertTest.cs (.../DistributionAssertTest.cs) (revision 12d68f588f3d39996a3a34577f9ec94a87bec865) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/DistributionAssertTest.cs (.../DistributionAssertTest.cs) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -19,8 +19,10 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Core.Common.Base.Data; +using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Probabilistics; @@ -125,6 +127,45 @@ Assert.Throws(call); } + [Test] + public void AreDistributionPropertiesEqual_IdenticalVariationCoefficientLogNormalDistributionProperties_DoesNotThrowException() + { + // Setup + var random = new Random(21); + const int nrOfDecimals = 4; + var mean = random.NextRoundedDouble(); + var coefficientOfVariation = random.NextRoundedDouble(); + var shift = random.NextRoundedDouble(); + + // Call + TestDelegate call = () => DistributionAssert.AreEqual(new VariationCoefficientLogNormalDistribution(nrOfDecimals) + { + Mean = mean, + CoefficientOfVariation = coefficientOfVariation, + Shift = shift + }, new VariationCoefficientLogNormalDistribution(nrOfDecimals) + { + Mean = mean, + CoefficientOfVariation = coefficientOfVariation, + Shift = shift + }); + + // Assert + Assert.DoesNotThrow(call); + } + + [Test] + [TestCaseSource(nameof(DifferentVariationCoefficientLogNormalDistributions))] + public void AreDistributionPropertiesEqual_DifferentVariationCoefficientLogNormalDistributionProperties_ThrowsAssertionException(VariationCoefficientLogNormalDistribution distributionOne, + VariationCoefficientLogNormalDistribution distributionTwo) + { + // Call + TestDelegate call = () => DistributionAssert.AreEqual(distributionOne, distributionTwo); + + // Assert + Assert.Throws(call); + } + #region Test data private static IEnumerable IdenticalDistributionProperties @@ -473,49 +514,50 @@ CoefficientOfVariation = (RoundedDouble) 2 }).SetName("DifferentRoundingVariationCoefficientNormalDistribution"); yield return new TestCaseData( - new VariationCoefficientLogNormalDistribution(2) + new VariationCoefficientNormalDistribution(2) { Mean = (RoundedDouble) 1, CoefficientOfVariation = (RoundedDouble) 2 }, - new VariationCoefficientLogNormalDistribution(3) + new VariationCoefficientNormalDistribution(2) { - Mean = (RoundedDouble) 1, + Mean = (RoundedDouble) 2, CoefficientOfVariation = (RoundedDouble) 2 - }).SetName("DifferentRoundingVariationCoefficientLogNormalDistribution"); + }).SetName("DifferentMeanVariationCoefficientNormalDistribution"); yield return new TestCaseData( new VariationCoefficientNormalDistribution(2) { Mean = (RoundedDouble) 1, - CoefficientOfVariation = (RoundedDouble) 2 + CoefficientOfVariation = (RoundedDouble) 1 }, new VariationCoefficientNormalDistribution(2) { - Mean = (RoundedDouble) 2, + Mean = (RoundedDouble) 1, CoefficientOfVariation = (RoundedDouble) 2 - }).SetName("DifferentMeanVariationCoefficientNormalDistribution"); + }).SetName("DifferentVariationVariationCoefficientNormalDistribution"); yield return new TestCaseData( new VariationCoefficientLogNormalDistribution(2) { Mean = (RoundedDouble) 1, CoefficientOfVariation = (RoundedDouble) 2 }, - new VariationCoefficientLogNormalDistribution(2) + new VariationCoefficientLogNormalDistribution(3) { - Mean = (RoundedDouble) 2, + Mean = (RoundedDouble) 1, CoefficientOfVariation = (RoundedDouble) 2 - }).SetName("DifferentMeanVariationCoefficientLogNormalDistribution"); + }).SetName("DifferentRoundingVariationCoefficientLogNormalDistribution"); yield return new TestCaseData( - new VariationCoefficientNormalDistribution(2) + new VariationCoefficientLogNormalDistribution(2) { Mean = (RoundedDouble) 1, - CoefficientOfVariation = (RoundedDouble) 1 + CoefficientOfVariation = (RoundedDouble) 2 }, - new VariationCoefficientNormalDistribution(2) + new VariationCoefficientLogNormalDistribution(2) { - Mean = (RoundedDouble) 1, + Mean = (RoundedDouble) 2, CoefficientOfVariation = (RoundedDouble) 2 - }).SetName("DifferentStandardDeviationVariationCoefficientNormalDistribution"); + }).SetName("DifferentMeanVariationCoefficientLogNormalDistribution"); + yield return new TestCaseData( new VariationCoefficientLogNormalDistribution(2) { @@ -526,10 +568,61 @@ { Mean = (RoundedDouble) 1, CoefficientOfVariation = (RoundedDouble) 2 - }).SetName("DifferentStandardDeviationVariationCoefficientLogNormalDistribution"); + }).SetName("DifferentVariationVariationCoefficientLogNormalDistribution"); } } + private static IEnumerable DifferentVariationCoefficientLogNormalDistributions() + { + yield return new TestCaseData( + new VariationCoefficientLogNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + CoefficientOfVariation = (RoundedDouble) 2 + }, + new VariationCoefficientLogNormalDistribution(3) + { + Mean = (RoundedDouble) 1, + CoefficientOfVariation = (RoundedDouble) 2 + }).SetName("DifferentRoundingVariationCoefficientLogNormalDistribution"); + yield return new TestCaseData( + new VariationCoefficientLogNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + CoefficientOfVariation = (RoundedDouble) 2 + }, + new VariationCoefficientLogNormalDistribution(2) + { + Mean = (RoundedDouble) 2, + CoefficientOfVariation = (RoundedDouble) 2 + }).SetName("DifferentMeanVariationCoefficientLogNormalDistribution"); + + yield return new TestCaseData( + new VariationCoefficientLogNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + CoefficientOfVariation = (RoundedDouble) 1 + }, + new VariationCoefficientLogNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + CoefficientOfVariation = (RoundedDouble) 2 + }).SetName("DifferentVariationVariationCoefficientLogNormalDistribution"); + yield return new TestCaseData( + new VariationCoefficientLogNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + CoefficientOfVariation = (RoundedDouble) 1, + Shift = (RoundedDouble) 0.5 + }, + new VariationCoefficientLogNormalDistribution(2) + { + Mean = (RoundedDouble) 1, + CoefficientOfVariation = (RoundedDouble) 1, + Shift = (RoundedDouble) 0.4 + }).SetName("DifferentShiftVariationCoefficientLogNormalDistribution"); + } + #endregion } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj =================================================================== diff -u -r63fc151e9cf722527465c1eddfa6567a90feb5e6 -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj (.../Ringtoets.Common.Data.TestUtil.Test.csproj) (revision 63fc151e9cf722527465c1eddfa6567a90feb5e6) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj (.../Ringtoets.Common.Data.TestUtil.Test.csproj) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -63,6 +63,10 @@ {3BBFD65B-B277-4E50-AE6D-BD24C3434609} Core.Common.Base + + {D749EE4C-CE50-4C17-BF01-9A953028C126} + Core.Common.TestUtil + {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/DistributionAssert.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/DistributionAssert.cs (.../DistributionAssert.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/DistributionAssert.cs (.../DistributionAssert.cs) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -113,6 +113,25 @@ AreEqualValue(expectedDistribution.CoefficientOfVariation, actualDistribution.CoefficientOfVariation); } + /// + /// Determines if the properties of the actual are the same as + /// the expected . + /// + /// The expected . + /// The actual . + /// Thrown when the following differences are found between + /// the and : + /// + /// The probabilistic distribution types. + /// The values for the mean and/or the variation. + /// The precision for the mean, variation and/or shift. + /// + public static void AreEqual(VariationCoefficientLogNormalDistribution expectedDistribution, VariationCoefficientLogNormalDistribution actualDistribution) + { + AreEqual((IVariationCoefficientDistribution)expectedDistribution, actualDistribution); + AreEqualValue(expectedDistribution.Shift, actualDistribution.Shift); + } + private static void AreEqualValue(RoundedDouble expectedValue, RoundedDouble actualValue) { Assert.AreEqual(expectedValue.NumberOfDecimalPlaces, actualValue.NumberOfDecimalPlaces); Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/DistributionTestHelper.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/DistributionTestHelper.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/DistributionTestHelper.cs (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -0,0 +1,76 @@ +// 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.Common.Data.Probabilistics; + +namespace Ringtoets.Common.Data.TestUtil +{ + /// + /// Class that can be used to test stochastic distributions + /// + public class DistributionTestHelper + { + /// + /// Asserts whether the values of a distribution are correctly set + /// to another distribution. + /// + /// The distribution to assert. + /// The distribution which was used to set the properties. + /// The expected distribution. + /// Thrown when: + /// + /// The and + /// are the same reference. + /// The values of the do not match with the + /// . + /// + public static void AssertDistributionCorrectlySet(IDistribution distributionToAssert, + IDistribution setDistribution, + IDistribution expectedDistribution) + { + Assert.AreNotSame(setDistribution, distributionToAssert); + DistributionAssert.AreEqual(expectedDistribution, distributionToAssert); + } + + /// + /// Asserts whether the values of a distribution are correctly set + /// to another distribution. + /// + /// The distribution to assert. + /// The distribution which was used to set the properties. + /// The expected distribution. + /// Thrown when: + /// + /// The and + /// are the same reference. + /// The values of the do not match with the + /// . + /// + public static void AssertDistributionCorrectlySet(IVariationCoefficientDistribution distributionToAssert, + IVariationCoefficientDistribution setDistribution, + IVariationCoefficientDistribution expectedDistribution) + { + Assert.AreNotSame(setDistribution, distributionToAssert); + DistributionAssert.AreEqual(expectedDistribution, distributionToAssert); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj =================================================================== diff -u -r63fc151e9cf722527465c1eddfa6567a90feb5e6 -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj (.../Ringtoets.Common.Data.TestUtil.csproj) (revision 63fc151e9cf722527465c1eddfa6567a90feb5e6) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj (.../Ringtoets.Common.Data.TestUtil.csproj) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -26,6 +26,7 @@ + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilLayerTransformerTest.cs =================================================================== diff -u -r117a54dfd9b5972086a1f3386923edda2e7a334b -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilLayerTransformerTest.cs (.../MacroStabilityInwardsSoilLayerTransformerTest.cs) (revision 117a54dfd9b5972086a1f3386923edda2e7a334b) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilLayerTransformerTest.cs (.../MacroStabilityInwardsSoilLayerTransformerTest.cs) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -127,7 +127,7 @@ { Mean = (RoundedDouble) belowPhreaticLevelMean, CoefficientOfVariation = (RoundedDouble) belowPhreaticLevelCoefficientOfVariation, - Shift = (RoundedDouble) abovePhreaticLevelShift + Shift = (RoundedDouble) belowPhreaticLevelShift }, data.BelowPhreaticLevel); DistributionAssert.AreEqual(new VariationCoefficientLogNormalDistribution(2) Index: Ringtoets/Piping/test/Ringtoets.Piping.Primitives.Test/PipingSoilLayerTest.cs =================================================================== diff -u -r686466dda6406ee2c7fb1f33faa60494878b1fc8 -rfba90aff5df30d1a8575d0730aba71ceac649865 --- Ringtoets/Piping/test/Ringtoets.Piping.Primitives.Test/PipingSoilLayerTest.cs (.../PipingSoilLayerTest.cs) (revision 686466dda6406ee2c7fb1f33faa60494878b1fc8) +++ Ringtoets/Piping/test/Ringtoets.Piping.Primitives.Test/PipingSoilLayerTest.cs (.../PipingSoilLayerTest.cs) (revision fba90aff5df30d1a8575d0730aba71ceac649865) @@ -94,7 +94,7 @@ StandardDeviation = distributionToSet.StandardDeviation, Shift = distributionToSet.Shift }; - AssertDistributionCorrectlySet(layer.BelowPhreaticLevel, distributionToSet, expectedDistribution); + DistributionTestHelper.AssertDistributionCorrectlySet(layer.BelowPhreaticLevel, distributionToSet, expectedDistribution); } [Test] @@ -121,7 +121,7 @@ CoefficientOfVariation = distributionToSet.CoefficientOfVariation, Shift = layer.DiameterD70.Shift }; - AssertDistributionCorrectlySet(layer.DiameterD70, distributionToSet, expectedDistribution); + DistributionTestHelper.AssertDistributionCorrectlySet(layer.DiameterD70, distributionToSet, expectedDistribution); } [Test] @@ -148,7 +148,7 @@ CoefficientOfVariation = distributionToSet.CoefficientOfVariation, Shift = layer.DiameterD70.Shift }; - AssertDistributionCorrectlySet(layer.Permeability, distributionToSet, expectedDistribution); + DistributionTestHelper.AssertDistributionCorrectlySet(layer.Permeability, distributionToSet, expectedDistribution); } [Test] @@ -182,22 +182,6 @@ Assert.AreEqual(materialName, layer.MaterialName); } - private static void AssertDistributionCorrectlySet(IDistribution distributionToAssert, - IDistribution setDistribution, - IDistribution expectedDistribution) - { - Assert.AreNotSame(setDistribution, distributionToAssert); - DistributionAssert.AreEqual(expectedDistribution, distributionToAssert); - } - - private static void AssertDistributionCorrectlySet(IVariationCoefficientDistribution distributionToAssert, - IVariationCoefficientDistribution setDistribution, - IVariationCoefficientDistribution expectedDistribution) - { - Assert.AreNotSame(setDistribution, distributionToAssert); - DistributionAssert.AreEqual(expectedDistribution, distributionToAssert); - } - [TestFixture] private class PipingSoilLayerEqualsTest : EqualsTestFixture { @@ -219,8 +203,6 @@ PipingSoilLayer baseLayer = CreateRandomLayer(seed); var random = new Random(seed); - double offset = random.NextDouble(); - yield return new TestCaseData(new PipingSoilLayer(double.NaN) { MaterialName = "Different Name",