Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructuresInputContextProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructuresInputContextProperties.cs (.../ClosingStructuresInputContextProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructuresInputContextProperties.cs (.../ClosingStructuresInputContextProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -179,7 +179,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.InsideWaterLevel, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -211,7 +210,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.StandardDeviation, data.WrappedData.DrainCoefficient, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -291,7 +289,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.ThresholdHeightOpenWeir, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -310,7 +307,6 @@ return new ConfirmingLogNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.AreaFlowApertures, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -390,7 +386,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.LevelCrestStructureNotClosing, - data.Calculation, data.WrappedData, PropertyChangeHandler); } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/ChangeHandlers/ObservablePropertyChangeHandler.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/src/Ringtoets.Common.Forms/ChangeHandlers/ObservablePropertyChangeHandler.cs (.../ObservablePropertyChangeHandler.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/ChangeHandlers/ObservablePropertyChangeHandler.cs (.../ObservablePropertyChangeHandler.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -40,6 +40,10 @@ public ObservablePropertyChangeHandler(ICalculation calculation) { + if (calculation == null) + { + throw new ArgumentNullException(nameof(calculation)); + } this.calculation = calculation; } @@ -53,10 +57,6 @@ { throw new ArgumentNullException(nameof(calculationInput)); } - if (calculation == null) - { - throw new ArgumentNullException(nameof(calculation)); - } if (setValue == null) { throw new ArgumentNullException(nameof(setValue)); Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingDistributionPropertiesBase.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingDistributionPropertiesBase.cs (.../ConfirmingDistributionPropertiesBase.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingDistributionPropertiesBase.cs (.../ConfirmingDistributionPropertiesBase.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -26,7 +26,6 @@ using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; -using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Probabilistics; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -35,60 +34,52 @@ /// /// Properties class for implementations of . /// - public abstract class ConfirmingDistributionPropertiesBase : ObjectProperties + public abstract class ConfirmingDistributionPropertiesBase : ObjectProperties where TDistribution : IDistribution - where TCalculationInput : ICalculationInput + where TPropertyOwner : IObservable { private const string meanPropertyName = nameof(Mean); private const string standardDeviationPropertyName = nameof(StandardDeviation); private readonly bool isMeanReadOnly; private readonly bool isStandardDeviationReadOnly; - private readonly TCalculationInput calculationInput; - private readonly ICalculation calculation; + private readonly TPropertyOwner propertyOwner; private readonly IObservablePropertyChangeHandler changeHandler; /// /// Creates a new instance of . /// /// Indicates which properties, if any, should be marked as read-only. - /// The data of the to create the properties for. - /// The calculation the belongs to. - /// The calculation input the belongs to. + /// The data of the to create the properties for. + /// The owner of the property. /// The handler responsible for handling effects of a property change. - /// Thrown when is null + /// Thrown when is null /// or when any number of properties in this class is editable and any other parameter is null. protected ConfirmingDistributionPropertiesBase(DistributionPropertiesReadOnly propertiesReadOnly, - TDistribution data, - ICalculation calculation, - TCalculationInput calculationInput, + TDistribution distribution, + TPropertyOwner propertyOwner, IObservablePropertyChangeHandler handler) { - if (data == null) + if (distribution == null) { - throw new ArgumentNullException(nameof(data)); + throw new ArgumentNullException(nameof(distribution)); } if (!propertiesReadOnly.HasFlag(DistributionPropertiesReadOnly.All)) { - if (calculation == null) + if (propertyOwner == null) { - throw new ArgumentException(@"Calculation required if changes are possible.", nameof(calculation)); + throw new ArgumentException(@"PropertyOwner required if changes are possible.", nameof(propertyOwner)); } - if (calculationInput == null) - { - throw new ArgumentException(@"CalculationInput required if changes are possible.", nameof(calculationInput)); - } if (handler == null) { throw new ArgumentException(@"Change handler required if changes are possible.", nameof(handler)); } } - Data = data; + Data = distribution; isMeanReadOnly = propertiesReadOnly.HasFlag(DistributionPropertiesReadOnly.Mean); isStandardDeviationReadOnly = propertiesReadOnly.HasFlag(DistributionPropertiesReadOnly.StandardDeviation); - this.calculationInput = calculationInput; - this.calculation = calculation; + this.propertyOwner = propertyOwner; changeHandler = handler; } @@ -151,10 +142,10 @@ return $"{Mean} ({RingtoetsCommonFormsResources.NormalDistribution_StandardDeviation_DisplayName} = {StandardDeviation})"; } - private void ChangePropertyAndNotify(SetObservablePropertyValueDelegate setPropertyValue, + private void ChangePropertyAndNotify(SetObservablePropertyValueDelegate setPropertyValue, RoundedDouble value) { - IEnumerable affectedObjects = changeHandler.SetPropertyValueAfterConfirmation(calculationInput, + IEnumerable affectedObjects = changeHandler.SetPropertyValueAfterConfirmation(propertyOwner, value, setPropertyValue); NotifyAffectedObjects(affectedObjects); Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingLogNormalDistributionProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingLogNormalDistributionProperties.cs (.../ConfirmingLogNormalDistributionProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingLogNormalDistributionProperties.cs (.../ConfirmingLogNormalDistributionProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; @@ -33,28 +34,26 @@ /// An implementation for /// properties. /// - public class ConfirmingLogNormalDistributionProperties - : ConfirmingDistributionPropertiesBase - where TCalculationInput : ICalculationInput + public class ConfirmingLogNormalDistributionProperties + : ConfirmingDistributionPropertiesBase + where TPropertyOwner : IObservable { /// /// Creates a new instance of . /// /// Indicates which properties, if any, should be /// marked as read-only. /// The to create the properties for. - /// The calculation the belongs to. - /// The calculation input the belongs to. + /// The owner of the property. /// Optional handler that is used to handle property changes. /// Thrown when is null /// or when any number of properties in this class is editable and any other parameter is null. public ConfirmingLogNormalDistributionProperties( DistributionPropertiesReadOnly propertiesReadOnly, LogNormalDistribution distribution, - ICalculation calculation, - TCalculationInput calculationInput, + TPropertyOwner propertyOwner, IObservablePropertyChangeHandler handler) - : base(propertiesReadOnly, distribution, calculation, calculationInput, handler) {} + : base(propertiesReadOnly, distribution, propertyOwner, handler) {} public override string DistributionType { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingNormalDistributionProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingNormalDistributionProperties.cs (.../ConfirmingNormalDistributionProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingNormalDistributionProperties.cs (.../ConfirmingNormalDistributionProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; @@ -33,28 +34,26 @@ /// An implementation for /// properties. /// - public class ConfirmingNormalDistributionProperties - : ConfirmingDistributionPropertiesBase - where TCalculationInput : ICalculationInput + public class ConfirmingNormalDistributionProperties + : ConfirmingDistributionPropertiesBase + where TPropertyOwner : IObservable { /// /// Creates a new instance of . /// /// Indicates which properties, if any, should be /// marked as read-only. /// The to create the properties for. - /// The calculation the belongs to. - /// The calculation input the belongs to. + /// The owner of the property. /// Optional handler that is used to handle property changes. /// Thrown when is null /// or when any number of properties in this class is editable and any other parameter is null. public ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly propertiesReadOnly, NormalDistribution distribution, - ICalculation calculation, - TCalculationInput calculationInput, + TPropertyOwner propertyOwner, IObservablePropertyChangeHandler handler) : - base(propertiesReadOnly, distribution, calculation, calculationInput, handler) {} + base(propertiesReadOnly, distribution, propertyOwner, handler) {} public override string DistributionType { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingVariationCoefficientDistributionPropertiesBase.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingVariationCoefficientDistributionPropertiesBase.cs (.../ConfirmingVariationCoefficientDistributionPropertiesBase.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingVariationCoefficientDistributionPropertiesBase.cs (.../ConfirmingVariationCoefficientDistributionPropertiesBase.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -26,7 +26,6 @@ using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; -using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Common.Forms.Properties; @@ -35,60 +34,53 @@ /// /// Properties class for implementations of . /// - public abstract class ConfirmingVariationCoefficientDistributionPropertiesBase : ObjectProperties + public abstract class ConfirmingVariationCoefficientDistributionPropertiesBase : ObjectProperties where TDistribution : IVariationCoefficientDistribution - where TCalculationInput : ICalculationInput + where TPropertyOwner : IObservable { private const string meanPropertyName = nameof(Mean); private readonly string variationCoefficientPropertyName = nameof(CoefficientOfVariation); private readonly bool isMeanReadOnly; private readonly bool isVariationCoefficientReadOnly; - private readonly TCalculationInput calculationInput; - private readonly ICalculation calculation; + private readonly TPropertyOwner propertyOwner; private readonly IObservablePropertyChangeHandler changeHandler; /// /// Creates a new instance of . /// /// Indicates which properties, if any, should be marked as read-only. - /// The data of the to create the properties for. - /// The calculation the belongs to. - /// The calculation input the belongs to. + /// The data of the to create the properties for. + /// The owner of the property. /// The handler responsible for handling effects of a property change. - /// Thrown when is null + /// Thrown when is null /// or when any number of properties in this class is editable and any other parameter is null. - protected ConfirmingVariationCoefficientDistributionPropertiesBase(VariationCoefficientDistributionPropertiesReadOnly propertiesReadOnly, - TDistribution data, - ICalculation calculation, - TCalculationInput calculationInput, - IObservablePropertyChangeHandler handler) + protected ConfirmingVariationCoefficientDistributionPropertiesBase( + VariationCoefficientDistributionPropertiesReadOnly propertiesReadOnly, + TDistribution distribution, + TPropertyOwner propertyOwner, + IObservablePropertyChangeHandler handler) { - if (data == null) + if (distribution == null) { - throw new ArgumentNullException(nameof(data)); + throw new ArgumentNullException(nameof(distribution)); } if (!propertiesReadOnly.HasFlag(VariationCoefficientDistributionPropertiesReadOnly.All)) { - if (calculation == null) + if (propertyOwner == null) { - throw new ArgumentException(@"Calculation required if changes are possible.", nameof(calculation)); + throw new ArgumentException(@"PropertyOwner required if changes are possible.", nameof(propertyOwner)); } - if (calculationInput == null) - { - throw new ArgumentException(@"CalculationInput required if changes are possible.", nameof(calculationInput)); - } if (handler == null) { throw new ArgumentException(@"Change handler required if changes are possible.", nameof(handler)); } } - Data = data; + Data = distribution; isMeanReadOnly = propertiesReadOnly.HasFlag(VariationCoefficientDistributionPropertiesReadOnly.Mean); isVariationCoefficientReadOnly = propertiesReadOnly.HasFlag(VariationCoefficientDistributionPropertiesReadOnly.CoefficientOfVariation); - this.calculationInput = calculationInput; - this.calculation = calculation; + this.propertyOwner = propertyOwner; changeHandler = handler; } @@ -157,10 +149,10 @@ $"{Mean} ({Resources.Distribution_VariationCoefficient_DisplayName} = {CoefficientOfVariation})"; } - private void ChangePropertyAndNotify(SetObservablePropertyValueDelegate setPropertyValue, + private void ChangePropertyAndNotify(SetObservablePropertyValueDelegate setPropertyValue, RoundedDouble value) { - IEnumerable affectedObjects = changeHandler.SetPropertyValueAfterConfirmation(calculationInput, + IEnumerable affectedObjects = changeHandler.SetPropertyValueAfterConfirmation(propertyOwner, value, setPropertyValue); NotifyAffectedObjects(affectedObjects); Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingVariationCoefficientLogNormalDistributionProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingVariationCoefficientLogNormalDistributionProperties.cs (.../ConfirmingVariationCoefficientLogNormalDistributionProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingVariationCoefficientLogNormalDistributionProperties.cs (.../ConfirmingVariationCoefficientLogNormalDistributionProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -20,10 +20,10 @@ // All rights reserved. using System; +using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; -using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Common.Forms.Properties; @@ -32,28 +32,26 @@ /// /// An implementation for . /// - public class ConfirmingVariationCoefficientLogNormalDistributionProperties - : ConfirmingVariationCoefficientDistributionPropertiesBase - where TCalculationInput : ICalculationInput + public class ConfirmingVariationCoefficientLogNormalDistributionProperties + : ConfirmingVariationCoefficientDistributionPropertiesBase + where TPropertyOwner : IObservable { /// /// Creates a new instance of . /// /// Indicates which properties, if any, should be /// marked as read-only. /// The to create the properties for. - /// The calculation the belongs to. - /// The calculation input the belongs to. + /// The owner of the property. /// Optional handler that is used to handle property changes. /// Thrown when is null /// or when any number of properties in this class is editable and any other parameter is null. public ConfirmingVariationCoefficientLogNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly propertiesReadOnly, VariationCoefficientLogNormalDistribution distribution, - ICalculation calculation, - TCalculationInput calculationInput, + TPropertyOwner propertyOwner, IObservablePropertyChangeHandler handler) - : base(propertiesReadOnly, distribution, calculation, calculationInput, handler) {} + : base(propertiesReadOnly, distribution, propertyOwner, handler) {} public override string DistributionType { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingVariationCoefficientNormalDistributionProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingVariationCoefficientNormalDistributionProperties.cs (.../ConfirmingVariationCoefficientNormalDistributionProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/ConfirmingVariationCoefficientNormalDistributionProperties.cs (.../ConfirmingVariationCoefficientNormalDistributionProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -20,10 +20,10 @@ // All rights reserved. using System; +using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; -using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Common.Forms.Properties; @@ -32,28 +32,26 @@ /// /// An implementation for . /// - public class ConfirmingVariationCoefficientNormalDistributionProperties - : ConfirmingVariationCoefficientDistributionPropertiesBase - where TCalculationInput : ICalculationInput + public class ConfirmingVariationCoefficientNormalDistributionProperties + : ConfirmingVariationCoefficientDistributionPropertiesBase + where TPropertyOwner : IObservable { /// - /// Creates a new instance of . + /// Creates a new instance of . /// /// Indicates which properties, if any, should be /// marked as read-only. /// The to create the properties for. - /// The calculation the belongs to. - /// The calculation input the belongs to. + /// The owner of the property. /// Optional handler that is used to handle property changes. /// Thrown when is null /// or when any number of properties in this class is editable and any other parameter is null. public ConfirmingVariationCoefficientNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly propertiesReadOnly, VariationCoefficientNormalDistribution distribution, - ICalculation calculation, - TCalculationInput calculationInput, + TPropertyOwner propertyOwner, IObservablePropertyChangeHandler handler) - : base(propertiesReadOnly, distribution, calculation, calculationInput, handler) {} + : base(propertiesReadOnly, distribution, propertyOwner, handler) {} public override string DistributionType { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/StructuresInputBaseProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/StructuresInputBaseProperties.cs (.../StructuresInputBaseProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/StructuresInputBaseProperties.cs (.../StructuresInputBaseProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -148,7 +148,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.StandardDeviation, data.WrappedData.ModelFactorSuperCriticalFlow, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -398,7 +397,6 @@ return new ConfirmingLogNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.FlowWidthAtBottomProtection, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -416,7 +414,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.WidthFlowApertures, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -434,7 +431,6 @@ return new ConfirmingVariationCoefficientLogNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.None, data.WrappedData.StorageStructureArea, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -452,7 +448,6 @@ return new ConfirmingLogNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.AllowedLevelIncreaseStorage, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -470,7 +465,6 @@ return new ConfirmingVariationCoefficientLogNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.None, data.WrappedData.CriticalOvertoppingDischarge, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -527,7 +521,7 @@ { return data.WrappedData.ForeshoreProfile == null ? new UseBreakWaterProperties() : - new UseBreakWaterProperties(data.WrappedData, data.Calculation, PropertyChangeHandler); + new UseBreakWaterProperties(data.WrappedData, PropertyChangeHandler); } } @@ -540,7 +534,7 @@ { get { - return new UseForeshoreProperties(data.WrappedData, data.Calculation, PropertyChangeHandler); + return new UseForeshoreProperties(data.WrappedData, PropertyChangeHandler); } } @@ -581,7 +575,6 @@ return new ConfirmingVariationCoefficientLogNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.CoefficientOfVariation, data.WrappedData.StormDuration, - data.Calculation, data.WrappedData, PropertyChangeHandler); } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/UseBreakWaterProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/UseBreakWaterProperties.cs (.../UseBreakWaterProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/UseBreakWaterProperties.cs (.../UseBreakWaterProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -27,7 +27,6 @@ using Core.Common.Gui.Attributes; using Core.Common.Utils; using Core.Common.Utils.Attributes; -using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Forms.Properties; using Ringtoets.Common.Forms.TypeConverters; @@ -37,49 +36,41 @@ /// /// ViewModel of . /// - public class UseBreakWaterProperties - where TCalculationInput : ICalculationInput, IUseBreakWater + public class UseBreakWaterProperties + where TPropertyOwner : IUseBreakWater { private const int useBreakWaterPropertyIndex = 1; private const int breakWaterTypePropertyIndex = 2; private const int breakWaterHeightPropertyIndex = 3; - private readonly TCalculationInput data; - private readonly ICalculation calculation; + private readonly TPropertyOwner data; private readonly IObservablePropertyChangeHandler changeHandler; /// - /// Creates a new instance of , in which + /// Creates a new instance of , in which /// all the properties are read-only and empty. /// public UseBreakWaterProperties() { } /// - /// Creates a new instance of in which the + /// Creates a new instance of in which the /// properties are editable. /// /// The data to use for the properties. - /// The calculation to which the belongs. /// Optional handler that is used to handle property changes. /// Thrown when any input parameter is null. public UseBreakWaterProperties( - TCalculationInput useBreakWaterData, - ICalculation calculation, + TPropertyOwner useBreakWaterData, IObservablePropertyChangeHandler handler) { if (useBreakWaterData == null) { throw new ArgumentNullException(nameof(useBreakWaterData)); } - if (calculation == null) - { - throw new ArgumentNullException(nameof(calculation)); - } if (handler == null) { throw new ArgumentNullException(nameof(handler)); } data = useBreakWaterData; - this.calculation = calculation; changeHandler = handler; } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/UseForeshoreProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/UseForeshoreProperties.cs (.../UseForeshoreProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/UseForeshoreProperties.cs (.../UseForeshoreProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -28,7 +28,6 @@ using Core.Common.Gui.Attributes; using Core.Common.Gui.Converters; using Core.Common.Utils.Attributes; -using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Forms.Properties; @@ -37,40 +36,33 @@ /// /// ViewModel of . /// - public class UseForeshoreProperties where TCalculationInput : ICalculationInput, IUseForeshore + public class UseForeshoreProperties + where TPropertyOwner : IUseForeshore { private const int useForeshorePropertyIndex = 1; private const int coordinatesPropertyIndex = 2; - private readonly TCalculationInput data; + private readonly TPropertyOwner data; private readonly IObservablePropertyChangeHandler changeHandler; - private readonly ICalculation calculation; /// - /// Creates a new instance of . + /// Creates a new instance of . /// /// The data to use for the properties. - /// The calculation to which the belongs. /// Optional handler that is used to handle property changes. /// Thrown when any input parameter is null. public UseForeshoreProperties( - TCalculationInput useForeshoreData, - ICalculation calculation, + TPropertyOwner useForeshoreData, IObservablePropertyChangeHandler handler) { if (useForeshoreData == null) { throw new ArgumentNullException(nameof(useForeshoreData)); } - if (calculation == null) - { - throw new ArgumentNullException(nameof(calculation)); - } if (handler == null) { throw new ArgumentNullException(nameof(handler)); } data = useForeshoreData; - this.calculation = calculation; changeHandler = handler; } Fisheye: Tag b41ef82a44c84f0211937d1b7f22794ad8a45941 refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ChangeHandlers/CalculationInputPropertyChangeHandlerTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ChangeHandlers/ObservablePropertyChangeHandlerTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ChangeHandlers/ObservablePropertyChangeHandlerTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ChangeHandlers/ObservablePropertyChangeHandlerTest.cs (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -0,0 +1,240 @@ +// Copyright (C) Stichting Deltares 2016. 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; +using System.Collections.Generic; +using Core.Common.Base; +using NUnit.Extensions.Forms; +using NUnit.Framework; +using Ringtoets.Common.Forms.ChangeHandlers; +using Ringtoets.Common.Forms.PropertyClasses; +using Ringtoets.Common.Forms.TestUtil; + +namespace Ringtoets.Common.Forms.Test.ChangeHandlers +{ + [TestFixture] + public class ObservablePropertyChangeHandlerTest : NUnitFormTest + { + [Test] + public void Constructor_WithCalculation_Expectedvalues() + { + // Call + var changeHandler = new ObservablePropertyChangeHandler(new TestCalculation()); + + // Assert + Assert.IsInstanceOf(changeHandler); + } + + [Test] + public void Constructor_CalculationNull_ThrowArgumentNullException() + { + // Call + TestDelegate test = () => new ObservablePropertyChangeHandler(null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("calculation", exception.ParamName); + } + + [Test] + public void SetPropertyValueAfterConfirmation_CalculationInputNull_ThrowArgumentNullException() + { + // Setup + var changeHandler = new ObservablePropertyChangeHandler(new TestCalculation()); + + // Call + TestDelegate test = () => changeHandler.SetPropertyValueAfterConfirmation((TestCalculationInput)null, 3, (input, value) => { }); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("calculationInput", exception.ParamName); + } + + [Test] + public void SetPropertyValueAfterConfirmation_SetValueNull_ThrowArgumentNullException() + { + // Setup + var changeHandler = new ObservablePropertyChangeHandler(new TestCalculation()); + + // Call + TestDelegate test = () => changeHandler.SetPropertyValueAfterConfirmation(new TestCalculationInput(), + 3, + null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("setValue", exception.ParamName); + } + + [Test] + [TestCaseSource(nameof(ChangePropertyTestCases))] + public void SetPropertyValueAfterConfirmation_IfConfirmationRequiredThenGiven_SetValueCalledAffectedObjectsReturned(ChangePropertyTestCase testCase) + { + // Setup + bool dialogBoxWillBeShown = testCase.Calculation.HasOutput; + + string title = ""; + string message = ""; + if (dialogBoxWillBeShown) + { + DialogBoxHandler = (name, wnd) => + { + var tester = new MessageBoxTester(wnd); + title = tester.Title; + message = tester.Text; + + tester.ClickOk(); + }; + } + + var calculationInput = new TestCalculationInput(); + var propertySet = 0; + + var changeHandler = new ObservablePropertyChangeHandler(testCase.Calculation); + + // Precondition + Assert.AreEqual(dialogBoxWillBeShown, testCase.Calculation.HasOutput); + + // Call + var affectedObjects = changeHandler.SetPropertyValueAfterConfirmation( + calculationInput, + 3, + (f, v) => propertySet++); + + // Assert + var expectedAffectedObjects = new List(); + + if (dialogBoxWillBeShown) + { + Assert.AreEqual("Bevestigen", title); + string expectedMessage = "Als u een parameter in deze berekening wijzigt, zal de uitvoer van deze berekening verwijderd worden." + + Environment.NewLine + Environment.NewLine + + "Weet u zeker dat u wilt doorgaan?"; + Assert.AreEqual(expectedMessage, message); + + expectedAffectedObjects.Add(testCase.Calculation); + } + expectedAffectedObjects.Add(calculationInput); + CollectionAssert.AreEquivalent(expectedAffectedObjects, affectedObjects); + Assert.AreEqual(1, propertySet); + Assert.IsFalse(testCase.Calculation.HasOutput); + } + + [Test] + public void SetPropertyValueAfterConfirmation_ConfirmationRequiredButNotGiven_SetValueNotCalledNoAffectedObjectsReturned() + { + // Setup + DialogBoxHandler = (name, wnd) => + { + var tester = new MessageBoxTester(wnd); + tester.ClickCancel(); + }; + + TestCalculation calculation = CalculationTestHelper.CreateCalculationWithOutput(); + + var propertySet = 0; + + var changeHandler = new ObservablePropertyChangeHandler(calculation); + + // Precondition + Assert.IsTrue(calculation.HasOutput); + + // Call + var affectedObjects = changeHandler.SetPropertyValueAfterConfirmation( + new TestCalculationInput(), + 3, + (f, v) => propertySet++); + + // Assert + Assert.AreEqual(0, propertySet); + CollectionAssert.IsEmpty(affectedObjects); + Assert.IsTrue(calculation.HasOutput); + } + + [Test] + public void SetPropertyValueAfterConfirmation_ConfirmationRequiredAndGivenExceptionInSetValue_ExceptionBubbled() + { + // Setup + DialogBoxHandler = (name, wnd) => + { + var tester = new MessageBoxTester(wnd); + tester.ClickOk(); + }; + + TestCalculation calculation = CalculationTestHelper.CreateCalculationWithOutput(); + + var changeHandler = new ObservablePropertyChangeHandler(calculation); + var expectedException = new Exception(); + + // Call + TestDelegate test = () => changeHandler.SetPropertyValueAfterConfirmation( + new TestCalculationInput(), + 3, + (f, v) => { throw expectedException; }); + + // Assert + var exception = Assert.Throws(test); + Assert.AreSame(expectedException, exception); + } + + [Test] + public void SetPropertyValueAfterConfirmation_ConfirmationNotRequiredExceptionInSetValue_ExceptionBubbled() + { + // Setup + TestCalculation calculation = CalculationTestHelper.CreateCalculationWithoutOutput(); + + var changeHandler = new ObservablePropertyChangeHandler(calculation); + var expectedException = new Exception(); + + // Call + TestDelegate test = () => changeHandler.SetPropertyValueAfterConfirmation( + new TestCalculationInput(), + 3, + (f, v) => { throw expectedException; }); + + // Assert + var exception = Assert.Throws(test); + Assert.AreSame(expectedException, exception); + } + + public class ChangePropertyTestCase + { + public ChangePropertyTestCase(TestCalculation calculation) + { + Calculation = calculation; + } + + public TestCalculation Calculation { get; } + } + + private static IEnumerable ChangePropertyTestCases() + { + yield return new TestCaseData( + new ChangePropertyTestCase(CalculationTestHelper.CreateCalculationWithOutput()) + ).SetName("SetPropertyValueAfterConfirmation calculation with output"); + + yield return new TestCaseData( + new ChangePropertyTestCase(CalculationTestHelper.CreateCalculationWithoutOutput()) + ).SetName("SetPropertyValueAfterConfirmation calculation without output"); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingDistributionPropertiesBaseTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingDistributionPropertiesBaseTest.cs (.../ConfirmingDistributionPropertiesBaseTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingDistributionPropertiesBaseTest.cs (.../ConfirmingDistributionPropertiesBaseTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -66,51 +66,29 @@ // Assert string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("data", paramName); + Assert.AreEqual("distribution", paramName); } - + [Test] [TestCase(DistributionPropertiesReadOnly.Mean)] [TestCase(DistributionPropertiesReadOnly.StandardDeviation)] [TestCase(DistributionPropertiesReadOnly.None)] - public void Constructor_NoCalculationSetWhileChangesPossible_ThrowArgumentException( + public void Constructor_NoPropertyOwnerSetWhileChangesPossible_ThrowArgumentException( DistributionPropertiesReadOnly flags) { // Setup var mocks = new MockRepository(); var distribution = mocks.Stub(); - mocks.ReplayAll(); - - // Call - TestDelegate call = () => new SimpleDistributionProperties(flags, distribution, null, null, null); - - // Assert - var message = "Calculation required if changes are possible."; - var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message); - Assert.AreEqual("calculation", exception.ParamName); - mocks.VerifyAll(); - } - - [Test] - [TestCase(DistributionPropertiesReadOnly.Mean)] - [TestCase(DistributionPropertiesReadOnly.StandardDeviation)] - [TestCase(DistributionPropertiesReadOnly.None)] - public void Constructor_NoInputSetWhileChangesPossible_ThrowArgumentException( - DistributionPropertiesReadOnly flags) - { - // Setup - var mocks = new MockRepository(); - var distribution = mocks.Stub(); var calculation = mocks.Stub(); mocks.ReplayAll(); // Call TestDelegate call = () => new SimpleDistributionProperties(flags, distribution, calculation, null, null); // Assert - var message = "CalculationInput required if changes are possible."; + var message = "PropertyOwner required if changes are possible."; var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message); - Assert.AreEqual("calculationInput", exception.ParamName); + Assert.AreEqual("propertyOwner", exception.ParamName); mocks.VerifyAll(); } @@ -371,7 +349,7 @@ public SimpleDistributionProperties(DistributionPropertiesReadOnly propertiesReadOnly, IDistribution distribution, ICalculation calculation, ICalculationInput input, IObservablePropertyChangeHandler handler) - : base(propertiesReadOnly, distribution, calculation, input, handler) {} + : base(propertiesReadOnly, distribution, input, handler) {} public override string DistributionType { Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingLogNormalDistributionPropertiesTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingLogNormalDistributionPropertiesTest.cs (.../ConfirmingLogNormalDistributionPropertiesTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingLogNormalDistributionPropertiesTest.cs (.../ConfirmingLogNormalDistributionPropertiesTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -19,9 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.ComponentModel; -using Core.Common.Base; using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; @@ -47,7 +45,6 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var input = mocks.Stub(); var handler = mocks.Stub(); mockRepository.ReplayAll(); @@ -56,7 +53,7 @@ // Call var properties = new ConfirmingLogNormalDistributionProperties( - DistributionPropertiesReadOnly.None, distribution, calculation, input, handler); + DistributionPropertiesReadOnly.None, distribution, input, handler); // Assert Assert.IsInstanceOf>(properties); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingVariationCoefficientDistributionPropertiesBaseTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingVariationCoefficientDistributionPropertiesBaseTest.cs (.../ConfirmingVariationCoefficientDistributionPropertiesBaseTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingVariationCoefficientDistributionPropertiesBaseTest.cs (.../ConfirmingVariationCoefficientDistributionPropertiesBaseTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -46,7 +46,7 @@ mocks.ReplayAll(); // Call - var properties = new SimpleDistributionProperties(VariationCoefficientDistributionPropertiesReadOnly.All, distribution, null, null, null); + var properties = new SimpleDistributionProperties(VariationCoefficientDistributionPropertiesReadOnly.All, distribution, null, null); // Assert Assert.IsInstanceOf>(properties); @@ -62,18 +62,18 @@ VariationCoefficientDistributionPropertiesReadOnly flags) { // Call - TestDelegate call = () => new SimpleDistributionProperties(flags, null, null, null, null); + TestDelegate call = () => new SimpleDistributionProperties(flags, null, null, null); // Assert string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("data", paramName); + Assert.AreEqual("distribution", paramName); } [Test] [TestCase(VariationCoefficientDistributionPropertiesReadOnly.Mean)] [TestCase(VariationCoefficientDistributionPropertiesReadOnly.CoefficientOfVariation)] [TestCase(VariationCoefficientDistributionPropertiesReadOnly.None)] - public void Constructor_NoCalculationSetWhileChangesPossible_ThrowArgumentException( + public void Constructor_NoPropertyOwnerSetWhileChangesPossible_ThrowArgumentException( VariationCoefficientDistributionPropertiesReadOnly flags) { // Setup @@ -82,54 +82,30 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => new SimpleDistributionProperties(flags, distribution, null, null, null); + TestDelegate call = () => new SimpleDistributionProperties(flags, distribution, null, null); // Assert - var message = "Calculation required if changes are possible."; + var message = "PropertyOwner required if changes are possible."; var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message); - Assert.AreEqual("calculation", exception.ParamName); + Assert.AreEqual("propertyOwner", exception.ParamName); mocks.VerifyAll(); } [Test] [TestCase(VariationCoefficientDistributionPropertiesReadOnly.Mean)] [TestCase(VariationCoefficientDistributionPropertiesReadOnly.CoefficientOfVariation)] [TestCase(VariationCoefficientDistributionPropertiesReadOnly.None)] - public void Constructor_NoInputSetWhileChangesPossible_ThrowArgumentException( - VariationCoefficientDistributionPropertiesReadOnly flags) - { - // Setup - var mocks = new MockRepository(); - var distribution = mocks.Stub(); - var calculation = mocks.Stub(); - mocks.ReplayAll(); - - // Call - TestDelegate call = () => new SimpleDistributionProperties(flags, distribution, calculation, null, null); - - // Assert - var message = "CalculationInput required if changes are possible."; - var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message); - Assert.AreEqual("calculationInput", exception.ParamName); - mocks.VerifyAll(); - } - - [Test] - [TestCase(VariationCoefficientDistributionPropertiesReadOnly.Mean)] - [TestCase(VariationCoefficientDistributionPropertiesReadOnly.CoefficientOfVariation)] - [TestCase(VariationCoefficientDistributionPropertiesReadOnly.None)] public void Constructor_NoHandlerSetWhileChangesPossible_ThrowArgumentException( VariationCoefficientDistributionPropertiesReadOnly flags) { // Setup var mocks = new MockRepository(); var distribution = mocks.Stub(); - var calculation = mocks.Stub(); var input = mocks.Stub(); mocks.ReplayAll(); // Call - TestDelegate call = () => new SimpleDistributionProperties(flags, distribution, calculation, input, null); + TestDelegate call = () => new SimpleDistributionProperties(flags, distribution, input, null); // Assert var message = "Change handler required if changes are possible."; @@ -148,13 +124,12 @@ // Setup var mocks = new MockRepository(); var distribution = mocks.Stub(); - var calculation = mocks.Stub(); var input = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); // Call - var properties = new SimpleDistributionProperties(propertiesReadOnly, distribution, calculation, input, handler); + var properties = new SimpleDistributionProperties(propertiesReadOnly, distribution, input, handler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -193,12 +168,11 @@ // Setup var mocks = new MockRepository(); var distribution = mocks.Stub(); - var calculation = mocks.Stub(); var input = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); - var properties = new SimpleDistributionProperties(propertiesReadOnly, distribution, calculation, input, handler); + var properties = new SimpleDistributionProperties(propertiesReadOnly, distribution, input, handler); // Call bool meanIsReadOnly = properties.DynamicReadOnlyValidationMethod("Mean"); @@ -221,12 +195,11 @@ distribution.Mean = new RoundedDouble(1, 1.1); distribution.CoefficientOfVariation = new RoundedDouble(2, 2.2); - var calculation = mocks.Stub(); var input = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); - var properties = new SimpleDistributionProperties(VariationCoefficientDistributionPropertiesReadOnly.None, distribution, calculation, input, handler); + var properties = new SimpleDistributionProperties(VariationCoefficientDistributionPropertiesReadOnly.None, distribution, input, handler); // Call properties.Data = distribution; @@ -248,15 +221,13 @@ // Setup var mocks = new MockRepository(); var distribution = mocks.Stub(); - var calculation = mocks.Stub(); var input = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); var properties = new SimpleDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.All, distribution, - calculation, input, handler); @@ -276,7 +247,6 @@ // Setup var mocks = new MockRepository(); var distribution = mocks.Stub(); - var calculation = mocks.Stub(); var input = mocks.Stub(); var observerableMock = mocks.StrictMock(); observerableMock.Expect(o => o.NotifyObservers()); @@ -292,7 +262,6 @@ var properties = new SimpleDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.None, distribution, - calculation, input, handler); @@ -312,12 +281,11 @@ // Setup var mocks = new MockRepository(); var distribution = mocks.Stub(); - var calculation = mocks.Stub(); var input = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); - var properties = new SimpleDistributionProperties(propertiesReadOnly, distribution, calculation, input, handler); + var properties = new SimpleDistributionProperties(propertiesReadOnly, distribution, input, handler); // Call TestDelegate test = () => properties.CoefficientOfVariation = new RoundedDouble(2, 20); @@ -335,7 +303,6 @@ // Setup var mocks = new MockRepository(); var distribution = mocks.Stub(); - var calculation = mocks.Stub(); var input = mocks.Stub(); var observerableMock = mocks.StrictMock(); observerableMock.Expect(o => o.NotifyObservers()); @@ -348,7 +315,7 @@ observerableMock }); - var properties = new SimpleDistributionProperties(VariationCoefficientDistributionPropertiesReadOnly.None, distribution, calculation, input, handler) + var properties = new SimpleDistributionProperties(VariationCoefficientDistributionPropertiesReadOnly.None, distribution, input, handler) { Data = distribution }; @@ -364,9 +331,9 @@ private class SimpleDistributionProperties : ConfirmingVariationCoefficientDistributionPropertiesBase { public SimpleDistributionProperties(VariationCoefficientDistributionPropertiesReadOnly propertiesReadOnly, - IVariationCoefficientDistribution distribution, ICalculation calculation, + IVariationCoefficientDistribution distribution, ICalculationInput input, IObservablePropertyChangeHandler handler) - : base(propertiesReadOnly, distribution, calculation, input, handler) {} + : base(propertiesReadOnly, distribution, input, handler) {} public override string DistributionType { Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingVariationCoefficientLogNormalDistributionPropertiesTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingVariationCoefficientLogNormalDistributionPropertiesTest.cs (.../ConfirmingVariationCoefficientLogNormalDistributionPropertiesTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingVariationCoefficientLogNormalDistributionPropertiesTest.cs (.../ConfirmingVariationCoefficientLogNormalDistributionPropertiesTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -45,7 +45,6 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var input = mocks.Stub(); var handler = mocks.Stub(); mockRepository.ReplayAll(); @@ -54,7 +53,7 @@ // Call var properties = new ConfirmingVariationCoefficientLogNormalDistributionProperties( - VariationCoefficientDistributionPropertiesReadOnly.None, distribution, calculation, input, handler); + VariationCoefficientDistributionPropertiesReadOnly.None, distribution, input, handler); // Assert Assert.IsInstanceOf>(properties); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingVariationCoefficientNormalDistributionPropertiesTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingVariationCoefficientNormalDistributionPropertiesTest.cs (.../ConfirmingVariationCoefficientNormalDistributionPropertiesTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConfirmingVariationCoefficientNormalDistributionPropertiesTest.cs (.../ConfirmingVariationCoefficientNormalDistributionPropertiesTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -45,7 +45,6 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var input = mocks.Stub(); var handler = mocks.Stub(); mockRepository.ReplayAll(); @@ -54,7 +53,7 @@ // Call var properties = new ConfirmingVariationCoefficientNormalDistributionProperties( - VariationCoefficientDistributionPropertiesReadOnly.None, distribution, calculation, input, handler); + VariationCoefficientDistributionPropertiesReadOnly.None, distribution, input, handler); // Assert Assert.IsInstanceOf>(properties); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConformingNormalDistributionPropertiesTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConformingNormalDistributionPropertiesTest.cs (.../ConformingNormalDistributionPropertiesTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/ConformingNormalDistributionPropertiesTest.cs (.../ConformingNormalDistributionPropertiesTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -19,9 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.ComponentModel; -using Core.Common.Base; using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; @@ -47,7 +45,6 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var input = mocks.Stub(); var handler = mocks.Stub(); mockRepository.ReplayAll(); @@ -56,7 +53,7 @@ // Call var properties = new ConfirmingNormalDistributionProperties( - DistributionPropertiesReadOnly.None, distribution, calculation, input, handler); + DistributionPropertiesReadOnly.None, distribution, input, handler); // Assert Assert.IsInstanceOf>(properties); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseBreakWaterPropertiesTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseBreakWaterPropertiesTest.cs (.../UseBreakWaterPropertiesTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseBreakWaterPropertiesTest.cs (.../UseBreakWaterPropertiesTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -98,7 +98,6 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); @@ -108,7 +107,7 @@ }; // Call - var properties = new UseBreakWaterProperties(testUseBreakWater, calculation, handler); + var properties = new UseBreakWaterProperties(testUseBreakWater, handler); // Assert var dynamicPropertyBag = new DynamicPropertyBag(properties); @@ -147,12 +146,11 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); // Call - TestDelegate test = () => new UseBreakWaterProperties(null, calculation, handler); + TestDelegate test = () => new UseBreakWaterProperties(null, handler); // Assert string paramName = Assert.Throws(test).ParamName; @@ -161,49 +159,24 @@ } [Test] - public void Constructor_CalculationNull_ThrowsArgumentNullException() - { - // Setup - TestUseBreakWater testUseBreakWater = new TestUseBreakWater(); - - var mocks = new MockRepository(); - var handler = mocks.Stub(); - mocks.ReplayAll(); - - // Call - TestDelegate test = () => new UseBreakWaterProperties(testUseBreakWater, null, handler); - - // Assert - string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("calculation", paramName); - mocks.VerifyAll(); - } - - [Test] public void Constructor_HandlerNull_ThrowsArgumentNullException() { // Setup TestUseBreakWater testUseBreakWater = new TestUseBreakWater(); - var mocks = new MockRepository(); - var calculation = mocks.Stub(); - mocks.ReplayAll(); - // Call - TestDelegate test = () => new UseBreakWaterProperties(testUseBreakWater, calculation, null); + TestDelegate test = () => new UseBreakWaterProperties(testUseBreakWater, null); // Assert string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("handler", paramName); - mocks.VerifyAll(); } [Test] public void Constructor_WithUseBreakWaterData_ExpectedValues() { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); @@ -214,7 +187,7 @@ }; // Call - var properties = new UseBreakWaterProperties(useBreakWaterData, calculation, handler); + var properties = new UseBreakWaterProperties(useBreakWaterData, handler); // Assert Assert.IsTrue(properties.UseBreakWater); @@ -269,7 +242,6 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var observable = mocks.StrictMock(); observable.Expect(o => o.NotifyObservers()); mocks.ReplayAll(); @@ -282,7 +254,7 @@ observable }); - var properties = new UseBreakWaterProperties(input, calculation, handler); + var properties = new UseBreakWaterProperties(input, handler); // Call setProperty(properties); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseForeshorePropertiesTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseForeshorePropertiesTest.cs (.../UseForeshorePropertiesTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/UseForeshorePropertiesTest.cs (.../UseForeshorePropertiesTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -43,12 +43,11 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); // Call - TestDelegate test = () => new UseForeshoreProperties(null, calculation, handler); + TestDelegate test = () => new UseForeshoreProperties(null, handler); // Assert string paramName = Assert.Throws(test).ParamName; @@ -57,35 +56,16 @@ } [Test] - public void Constructor_CalculationNull_ThrowsArgumentNullException() - { - // Setup - TestUseForeshore testUseForeshore = new TestUseForeshore(); - - var mocks = new MockRepository(); - var handler = mocks.Stub(); - mocks.ReplayAll(); - - // Call - TestDelegate test = () => new UseForeshoreProperties(testUseForeshore, null, handler); - - // Assert - string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("calculation", paramName); - } - - [Test] public void Constructor_HandlerNull_ThrowsArgumentNullException() { // Setup TestUseForeshore testUseForeshore = new TestUseForeshore(); var mocks = new MockRepository(); - var calculation = mocks.Stub(); mocks.ReplayAll(); // Call - TestDelegate test = () => new UseForeshoreProperties(testUseForeshore, calculation, null); + TestDelegate test = () => new UseForeshoreProperties(testUseForeshore, null); // Assert string paramName = Assert.Throws(test).ParamName; @@ -99,7 +79,6 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); @@ -110,7 +89,7 @@ }; // Call - var properties = new UseForeshoreProperties(useForeshoreData, calculation, handler); + var properties = new UseForeshoreProperties(useForeshoreData, handler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -135,14 +114,13 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); var useForeshoreData = new TestUseForeshore(); // Call - var properties = new UseForeshoreProperties(useForeshoreData, calculation, handler); + var properties = new UseForeshoreProperties(useForeshoreData, handler); // Assert Assert.IsFalse(properties.UseForeshore); @@ -154,7 +132,6 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); @@ -164,7 +141,7 @@ }; // Call - var properties = new UseForeshoreProperties(useForeshoreData, calculation, handler); + var properties = new UseForeshoreProperties(useForeshoreData, handler); // Assert Assert.IsTrue(properties.UseForeshore); @@ -177,7 +154,6 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var handler = mocks.Stub(); mocks.ReplayAll(); @@ -192,7 +168,7 @@ }; // Call - var properties = new UseForeshoreProperties(useForeshoreData, calculation, handler); + var properties = new UseForeshoreProperties(useForeshoreData, handler); // Assert Assert.IsTrue(properties.UseForeshore); @@ -215,7 +191,6 @@ { // Setup var mocks = new MockRepository(); - var calculation = mocks.Stub(); var observable = mocks.StrictMock(); observable.Expect(o => o.NotifyObservers()); mocks.ReplayAll(); @@ -228,7 +203,7 @@ observable }); - var properties = new UseForeshoreProperties(input, calculation, handler); + var properties = new UseForeshoreProperties(input, handler); // Call setProperty(properties); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -rc663c013202dfc25dfff35b26a355f164e46ebfa -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision c663c013202dfc25dfff35b26a355f164e46ebfa) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -63,7 +63,7 @@ Properties\GlobalAssembly.cs - + Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsInputContextProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsInputContextProperties.cs (.../GrassCoverErosionInwardsInputContextProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsInputContextProperties.cs (.../GrassCoverErosionInwardsInputContextProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -153,7 +153,7 @@ return data.WrappedData.DikeProfile == null ? new UseBreakWaterProperties() : new UseBreakWaterProperties( - data.WrappedData, data.Calculation, propertyChangeHandler); + data.WrappedData, propertyChangeHandler); } } @@ -168,7 +168,6 @@ { return new UseForeshoreProperties( data.WrappedData, - data.Calculation, propertyChangeHandler); } } @@ -237,7 +236,6 @@ return new ConfirmingLogNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.CriticalFlowRate, - data.Calculation, data.WrappedData, propertyChangeHandler); } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructuresInputContextProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructuresInputContextProperties.cs (.../HeightStructuresInputContextProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PropertyClasses/HeightStructuresInputContextProperties.cs (.../HeightStructuresInputContextProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -101,7 +101,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.LevelCrestStructure, - data.Calculation, data.WrappedData, PropertyChangeHandler); } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/DesignVariableProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/DesignVariableProperties.cs (.../DesignVariableProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/DesignVariableProperties.cs (.../DesignVariableProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -45,16 +45,16 @@ /// Indicates which properties, if any, should be marked as read-only. /// The data of the to create the properties for. /// The calculation the belongs to. - /// The calculation input the belongs to. + /// The calculation input the belongs to. /// The handler responsible for handling effects of a property change. /// Thrown when is null /// or when any number of properties in this class is editable and any other parameter is null. protected DesignVariableProperties(DistributionPropertiesReadOnly propertiesReadOnly, DesignVariable designVariable, PipingCalculationScenario calculation, - PipingInput calculationInput, + PipingInput propertyOwner, IObservablePropertyChangeHandler handler) - : base(propertiesReadOnly, GetDistribution(designVariable), calculation, calculationInput, handler) + : base(propertiesReadOnly, GetDistribution(designVariable), propertyOwner, handler) { DesignVariable = designVariable; } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/LogNormalDistributionDesignVariableProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/LogNormalDistributionDesignVariableProperties.cs (.../LogNormalDistributionDesignVariableProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/LogNormalDistributionDesignVariableProperties.cs (.../LogNormalDistributionDesignVariableProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -48,19 +48,19 @@ /// Indicates which properties, if any, should be marked as read-only. /// The to create the properties for. /// The calculation the belongs to. - /// The calculation input the belongs to. + /// The calculation input the belongs to. /// The handler responsible for handling effects of a property change. /// Thrown when is null /// or when any number of properties in this class is editable and any other parameter is null. public LogNormalDistributionDesignVariableProperties(DistributionPropertiesReadOnly propertiesReadOnly, DesignVariable designVariable, PipingCalculationScenario calculation, - PipingInput calculationInput, + PipingInput propertyOwner, IObservablePropertyChangeHandler handler) : base(propertiesReadOnly, designVariable, calculation, - calculationInput, + propertyOwner, handler) {} public override string DistributionType { get; } = RingtoetsCommonFormsResources.DistributionType_LogNormal; Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/NormalDistributionDesignVariableProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/NormalDistributionDesignVariableProperties.cs (.../NormalDistributionDesignVariableProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/NormalDistributionDesignVariableProperties.cs (.../NormalDistributionDesignVariableProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -40,19 +40,19 @@ /// Indicates which properties, if any, should be marked as read-only. /// The to create the properties for. /// The calculation the belongs to. - /// The calculation input the belongs to. + /// The calculation input the belongs to. /// The handler responsible for handling effects of a property change. /// Thrown when is null /// or when any number of properties in this class is editable and any other parameter is null. public NormalDistributionDesignVariableProperties(DistributionPropertiesReadOnly propertiesReadOnly, DesignVariable designVariable, PipingCalculationScenario calculation, - PipingInput calculationInput, + PipingInput propertyOwner, IObservablePropertyChangeHandler handler) : base(propertiesReadOnly, designVariable, calculation, - calculationInput, + propertyOwner, handler) {} public override string DistributionType { get; } = RingtoetsCommonFormsResources.DistributionType_Normal; Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/ShiftedLogNormalDistributionDesignVariableProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/ShiftedLogNormalDistributionDesignVariableProperties.cs (.../ShiftedLogNormalDistributionDesignVariableProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/ShiftedLogNormalDistributionDesignVariableProperties.cs (.../ShiftedLogNormalDistributionDesignVariableProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -51,16 +51,16 @@ /// Indicates which properties, if any, should be marked as read-only. /// The to create the properties for. /// The calculation the belongs to. - /// The calculation input the belongs to. + /// The calculation input the belongs to. /// The handler responsible for handling effects of a property change. /// Thrown when is null /// or when any number of properties in this class is editable and any other parameter is null. public ShiftedLogNormalDistributionDesignVariableProperties(DistributionPropertiesReadOnly propertiesReadOnly, DesignVariable designVariable, PipingCalculationScenario calculation, - PipingInput calculationInput, + PipingInput propertyOwner, IObservablePropertyChangeHandler handler) - : base(propertiesReadOnly, designVariable, calculation, calculationInput, handler) {} + : base(propertiesReadOnly, designVariable, calculation, propertyOwner, handler) {} [PropertyOrder(4)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Probabilistics_Shift_Symbol))] Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/DesignVariablePropertiesTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/DesignVariablePropertiesTest.cs (.../DesignVariablePropertiesTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/DesignVariablePropertiesTest.cs (.../DesignVariablePropertiesTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -120,9 +120,9 @@ public SimpleDesignVariableProperties(DistributionPropertiesReadOnly propertiesReadOnly, DesignVariable designVariable, PipingCalculationScenario calculation, - PipingInput calculationInput, + PipingInput propertyOwner, IObservablePropertyChangeHandler handler) - : base(propertiesReadOnly, designVariable, calculation, calculationInput, handler) {} + : base(propertiesReadOnly, designVariable, calculation, propertyOwner, handler) {} public override string DistributionType { get; } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs (.../PipingCalculationsViewTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs (.../PipingCalculationsViewTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -81,11 +81,6 @@ [Test] public void Constructor_DefaultValues() { - // Setup - var mocks = new MockRepository(); - var handler = mocks.Stub(); - mocks.ReplayAll(); - // Call using (var pipingCalculationsView = new PipingCalculationsView()) { @@ -96,7 +91,6 @@ Assert.IsNull(pipingCalculationsView.PipingFailureMechanism); Assert.IsNull(pipingCalculationsView.AssessmentSection); } - mocks.VerifyAll(); } [Test] @@ -153,43 +147,6 @@ } [Test] - public void ParameteredConstructor_ValidHandler_DataGridViewCorrectlyInitialized() - { - // Setup - var mocks = new MockRepository(); - var handler = mocks.Stub(); - mocks.ReplayAll(); - - // Call - using (var pipingCalculationsView = new PipingCalculationsView()) - { - testForm.Controls.Add(pipingCalculationsView); - testForm.Show(); - - var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - - // Assert - Assert.IsFalse(dataGridView.AutoGenerateColumns); - Assert.AreEqual(9, dataGridView.ColumnCount); - - foreach (var column in dataGridView.Columns.OfType()) - { - Assert.AreEqual("This", column.ValueMember); - Assert.AreEqual("DisplayName", column.DisplayMember); - } - - var soilProfilesCombobox = (DataGridViewComboBoxColumn) dataGridView.Columns[stochasticSoilProfilesColumnIndex]; - var soilProfilesComboboxItems = soilProfilesCombobox.Items; - Assert.AreEqual(0, soilProfilesComboboxItems.Count); // Row dependent - - var hydraulicBoundaryLocationCombobox = (DataGridViewComboBoxColumn) dataGridView.Columns[selectableHydraulicBoundaryLocationsColumnIndex]; - var hydraulicBoundaryLocationComboboxItems = hydraulicBoundaryLocationCombobox.Items; - Assert.AreEqual(0, hydraulicBoundaryLocationComboboxItems.Count); // Row dependent - } - mocks.VerifyAll(); - } - - [Test] public void Data_SetToNull_DoesNotThrow() { // Setup Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingCalculationsViewInfoTest.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingCalculationsViewInfoTest.cs (.../PipingCalculationsViewInfoTest.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingCalculationsViewInfoTest.cs (.../PipingCalculationsViewInfoTest.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -91,7 +91,6 @@ public void GetViewName_Always_ReturnsCalculationGroupName() { // Setup - var handler = mocks.Stub(); mocks.ReplayAll(); var calculationsView = new PipingCalculationsView(); @@ -159,7 +158,6 @@ // Setup var assessmentSection = mocks.Stub(); assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); - var handler = mocks.Stub(); mocks.ReplayAll(); var view = new PipingCalculationsView() @@ -184,7 +182,6 @@ { new PipingFailureMechanism() }); - var handler = mocks.Stub(); mocks.ReplayAll(); var view = new PipingCalculationsView() @@ -210,7 +207,6 @@ { failureMechanism }); - var handler = mocks.Stub(); mocks.ReplayAll(); var view = new PipingCalculationsView() @@ -230,7 +226,6 @@ public void CloseForData_ViewNotCorrespondingToRemovedFailureMechanism_ReturnsFalse() { // Setup - var handler = mocks.Stub(); mocks.ReplayAll(); var view = new PipingCalculationsView(); @@ -250,7 +245,6 @@ public void CloseForData_ViewCorrespondingToRemovedFailureMechanism_ReturnsTrue() { // Setup - var handler = mocks.Stub(); mocks.ReplayAll(); var view = new PipingCalculationsView(); @@ -271,7 +265,6 @@ { // Setup var assessmentSection = mocks.Stub(); - var handler = mocks.Stub(); mocks.ReplayAll(); var view = new PipingCalculationsView(); @@ -293,7 +286,6 @@ { // Setup var assessmentSection = mocks.Stub(); - var handler = mocks.Stub(); mocks.ReplayAll(); var view = new PipingCalculationsView(); Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputContextProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputContextProperties.cs (.../WaveConditionsInputContextProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputContextProperties.cs (.../WaveConditionsInputContextProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -251,7 +251,7 @@ { return data.WrappedData.ForeshoreProfile == null ? new UseBreakWaterProperties() : - new UseBreakWaterProperties(data.WrappedData, data.Calculation, propertyChangeHandler); + new UseBreakWaterProperties(data.WrappedData, propertyChangeHandler); } } @@ -264,7 +264,7 @@ { get { - return new UseForeshoreProperties(data.WrappedData, data.Calculation, propertyChangeHandler); + return new UseForeshoreProperties(data.WrappedData, propertyChangeHandler); } } Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresInputContextProperties.cs =================================================================== diff -u -r277048d204ab4cfad4aa5de4d57ef38b56642c25 -rb41ef82a44c84f0211937d1b7f22794ad8a45941 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresInputContextProperties.cs (.../StabilityPointStructuresInputContextProperties.cs) (revision 277048d204ab4cfad4aa5de4d57ef38b56642c25) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresInputContextProperties.cs (.../StabilityPointStructuresInputContextProperties.cs) (revision b41ef82a44c84f0211937d1b7f22794ad8a45941) @@ -213,7 +213,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.InsideWaterLevelFailureConstruction, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -231,7 +230,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.InsideWaterLevel, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -263,7 +261,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.StandardDeviation, data.WrappedData.DrainCoefficient, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -347,7 +344,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.LevelCrestStructure, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -365,7 +361,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.ThresholdHeightOpenWeir, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -383,7 +378,6 @@ return new ConfirmingVariationCoefficientNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.CoefficientOfVariation, data.WrappedData.FlowVelocityStructureClosable, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -402,7 +396,6 @@ return new ConfirmingLogNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.AreaFlowApertures, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -421,7 +414,6 @@ return new ConfirmingVariationCoefficientLogNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.None, data.WrappedData.ConstructiveStrengthLinearLoadModel, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -440,7 +432,6 @@ return new ConfirmingVariationCoefficientLogNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.None, data.WrappedData.ConstructiveStrengthQuadraticLoadModel, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -459,7 +450,6 @@ return new ConfirmingVariationCoefficientLogNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.None, data.WrappedData.StabilityLinearLoadModel, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -478,7 +468,6 @@ return new ConfirmingVariationCoefficientLogNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.None, data.WrappedData.StabilityQuadraticLoadModel, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -518,7 +507,6 @@ return new ConfirmingVariationCoefficientLogNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.None, data.WrappedData.FailureCollisionEnergy, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -536,7 +524,6 @@ return new ConfirmingVariationCoefficientNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.None, data.WrappedData.ShipMass, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -554,7 +541,6 @@ return new ConfirmingVariationCoefficientNormalDistributionProperties( VariationCoefficientDistributionPropertiesReadOnly.None, data.WrappedData.ShipVelocity, - data.Calculation, data.WrappedData, PropertyChangeHandler); } @@ -611,7 +597,6 @@ return new ConfirmingNormalDistributionProperties( DistributionPropertiesReadOnly.None, data.WrappedData.BankWidth, - data.Calculation, data.WrappedData, PropertyChangeHandler); }