Index: src/Deltares.DSoilModel.Data.Tests/DSoilModelTransformerTests.cs =================================================================== diff -u -r133 -r134 --- src/Deltares.DSoilModel.Data.Tests/DSoilModelTransformerTests.cs (.../DSoilModelTransformerTests.cs) (revision 133) +++ src/Deltares.DSoilModel.Data.Tests/DSoilModelTransformerTests.cs (.../DSoilModelTransformerTests.cs) (revision 134) @@ -51,23 +51,20 @@ } [Test] - [TestCase(typeof(Soil), "Cohesion", 20)] - [TestCase(typeof(Soil), "BeddingAngle", 18)] - [TestCase(typeof(PreConsolidationStress), "StressValue", 0)] - public void TestStochasticPropertiesUncoupled(Type objType, string propertyName, double defaultValue) + [TestCase(typeof(Soil), "Cohesion")] + [TestCase(typeof(Soil), "BeddingAngle")] + [TestCase(typeof(PreConsolidationStress), "StressValue")] + public void TestStochasticPropertiesUncoupled(Type objType, string propertyName) { var obj = Activator.CreateInstance(objType); var deterministicProperty = obj.GetType().GetProperty(propertyName); var stochasticProperty = FindAutoStochastProperty(obj, propertyName); // reusing method that we already test - Assert.AreEqual(defaultValue, deterministicProperty.GetValue(obj, null)); - Assert.AreEqual(defaultValue, stochasticProperty.Mean); - - var changedValue = defaultValue + 1; + var changedValue = 123.456; deterministicProperty.SetValue(obj, changedValue, null); Assert.AreEqual(changedValue, deterministicProperty.GetValue(obj, null)); // deterministic property indeed changed - Assert.AreEqual(defaultValue, stochasticProperty.Mean); // but stochastic property remained its mean value + Assert.AreNotEqual(changedValue, stochasticProperty.Mean); // but stochastic property remained its mean value } } } Index: src/Deltares.DSoilModel.Data/DSoilModelTransformer.cs =================================================================== diff -u -r133 -r134 --- src/Deltares.DSoilModel.Data/DSoilModelTransformer.cs (.../DSoilModelTransformer.cs) (revision 133) +++ src/Deltares.DSoilModel.Data/DSoilModelTransformer.cs (.../DSoilModelTransformer.cs) (revision 134) @@ -22,14 +22,7 @@ { // currect exception from the rule dictated by huge amount of dependency on original property names and // changing it is way to complex and affects a lot of legacy projects - if (pcs.GetMemberName(x => x.StressValue) == property) - { - return pcs.StressStochast; - } - else - { - return null; - } + return pcs.GetMemberName(x => x.StressValue) == property ? pcs.StressStochast : null; } /// @@ -60,6 +53,15 @@ return null; } + /// + /// Project a given property to its 'design value', possibly dependent on the associated + /// random behavior of that parameter. + /// + /// The owner of the property.The parameter property name.The default value. + /// + /// Returns when given property has no stochastic + /// behavior, or the design value when it does and is handled by this transformer. + /// public double GetTransformedValue(object owner, string property, double measuredValue) { if (IsSupported(owner)) @@ -74,6 +76,15 @@ return measuredValue; } + /// + /// Projects a given 'design value' back to the parameter, updating the parameterization + /// of the random variable associated with that parameter if required. + /// + /// The owner of the property.The parameter property name.The new 'design value'. + /// + /// Returns when given property has no stochastic + /// behavior, or the back projected value when it does and is handled by this transformer. + /// public double SetTransformedValue(object owner, string property, double transformedValue) { if (IsSupported(owner))