Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsLocationInputExtremeProperties.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -rbdaed3150f9e329be3111d04bc88c1f09762d11e --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsLocationInputExtremeProperties.cs (.../MacroStabilityInwardsLocationInputExtremeProperties.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsLocationInputExtremeProperties.cs (.../MacroStabilityInwardsLocationInputExtremeProperties.cs) (revision bdaed3150f9e329be3111d04bc88c1f09762d11e) @@ -36,15 +36,19 @@ public class MacroStabilityInwardsLocationInputExtremeProperties : MacroStabilityInwardsLocationInputBaseProperties { private const int penetrationLengthPropertyIndex = 3; + private MacroStabilityInwardsInput macroStabilityInwardsInput; /// /// Creates a new instance of . /// /// The data of the properties. /// The handler responsible for handling effects of a property change. /// Thrown when any parameter is null. - public MacroStabilityInwardsLocationInputExtremeProperties(MacroStabilityInwardsLocationInputExtreme data, IObservablePropertyChangeHandler handler) - : base(data, handler) {} + public MacroStabilityInwardsLocationInputExtremeProperties(MacroStabilityInwardsInput data, IObservablePropertyChangeHandler handler) + : base((MacroStabilityInwardsLocationInputExtreme) data?.LocationInputExtreme, handler) + { + macroStabilityInwardsInput = data; + } [PropertyOrder(penetrationLengthPropertyIndex)] [ResourcesCategory(typeof(Resources), nameof(Resources.Waterstresses_DisplayName))] Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsWaterStressesProperties.cs =================================================================== diff -u -r6bc00629e040056b2b26403394091870ce77df78 -rbdaed3150f9e329be3111d04bc88c1f09762d11e --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsWaterStressesProperties.cs (.../MacroStabilityInwardsWaterStressesProperties.cs) (revision 6bc00629e040056b2b26403394091870ce77df78) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsWaterStressesProperties.cs (.../MacroStabilityInwardsWaterStressesProperties.cs) (revision bdaed3150f9e329be3111d04bc88c1f09762d11e) @@ -273,7 +273,7 @@ { get { - return new MacroStabilityInwardsLocationInputExtremeProperties((MacroStabilityInwardsLocationInputExtreme) data.LocationInputExtreme, propertyChangeHandler); + return new MacroStabilityInwardsLocationInputExtremeProperties(data, propertyChangeHandler); } } Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsLocationInputExtremePropertiesTest.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -rbdaed3150f9e329be3111d04bc88c1f09762d11e --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsLocationInputExtremePropertiesTest.cs (.../MacroStabilityInwardsLocationInputExtremePropertiesTest.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsLocationInputExtremePropertiesTest.cs (.../MacroStabilityInwardsLocationInputExtremePropertiesTest.cs) (revision bdaed3150f9e329be3111d04bc88c1f09762d11e) @@ -39,8 +39,8 @@ [TestFixture] public class MacroStabilityInwardsLocationInputExtremePropertiesTest { - private const int expectedwaterLevelPolderPropertyIndex = 0; - private const int expecteOffsetPropertyIndex = 1; + private const int expectedWaterLevelPolderPropertyIndex = 0; + private const int expectedOffsetPropertyIndex = 1; private const int expectedPenetrationLengthPropertyIndex = 2; [Test] @@ -51,14 +51,14 @@ var changeHandler = mocks.Stub(); mocks.ReplayAll(); - var input = new MacroStabilityInwardsLocationInputExtreme(); + var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call var properties = new MacroStabilityInwardsLocationInputExtremeProperties(input, changeHandler); // Assert Assert.IsInstanceOf>(properties); - Assert.AreSame(input, properties.Data); + Assert.AreSame(input.LocationInputExtreme, properties.Data); mocks.VerifyAll(); } @@ -71,7 +71,7 @@ var changeHandler = mocks.Stub(); mocks.ReplayAll(); - var input = new MacroStabilityInwardsLocationInputExtreme(); + var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call var properties = new MacroStabilityInwardsLocationInputExtremeProperties(input, changeHandler); @@ -83,14 +83,14 @@ const string waterStressesCategory = "Waterspanningen"; - PropertyDescriptor waterLevelPolderProperty = dynamicProperties[expectedwaterLevelPolderPropertyIndex]; + PropertyDescriptor waterLevelPolderProperty = dynamicProperties[expectedWaterLevelPolderPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( waterLevelPolderProperty, waterStressesCategory, "Polderpeil [m+NAP]", "Het niveau van het oppervlaktewater binnen een beheersgebied."); - PropertyDescriptor offsetProperty = dynamicProperties[expecteOffsetPropertyIndex]; + PropertyDescriptor offsetProperty = dynamicProperties[expectedOffsetPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( offsetProperty, waterStressesCategory, @@ -116,13 +116,13 @@ var changeHandler = mocks.Stub(); mocks.ReplayAll(); - var input = new MacroStabilityInwardsLocationInputExtreme(); + var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call var properties = new MacroStabilityInwardsLocationInputExtremeProperties(input, changeHandler); // Assert - Assert.AreEqual(input.PenetrationLength, properties.PenetrationLength); + Assert.AreEqual(input.LocationInputExtreme.PenetrationLength, properties.PenetrationLength); mocks.VerifyAll(); } @@ -132,7 +132,7 @@ { // Given var calculationItem = new MacroStabilityInwardsCalculationScenario(); - var input = (MacroStabilityInwardsLocationInputExtreme) calculationItem.InputParameters.LocationInputExtreme; + MacroStabilityInwardsInput input = calculationItem.InputParameters; var handler = new ObservablePropertyChangeHandler(calculationItem, calculationItem.InputParameters); var properties = new MacroStabilityInwardsLocationInputExtremeProperties(input, handler); @@ -144,8 +144,8 @@ properties.PenetrationLength = (RoundedDouble) penetrationLength; // Then - Assert.AreEqual(penetrationLength, input.PenetrationLength, - input.PenetrationLength.GetAccuracy()); + Assert.AreEqual(penetrationLength, input.LocationInputExtreme.PenetrationLength, + input.LocationInputExtreme.PenetrationLength.GetAccuracy()); } [Test] @@ -175,7 +175,7 @@ observable }); - var properties = new MacroStabilityInwardsLocationInputExtremeProperties((MacroStabilityInwardsLocationInputExtreme) input.LocationInputExtreme, handler); + var properties = new MacroStabilityInwardsLocationInputExtremeProperties(input, handler); // Call setProperty(properties);