Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs =================================================================== diff -u -r3c8d7c8c4f5ad6992d9a3443a78c084227632c0c -r173a4723b6e66c6931657148a6e9f18a8f4a5a05 --- Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision 3c8d7c8c4f5ad6992d9a3443a78c084227632c0c) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision 173a4723b6e66c6931657148a6e9f18a8f4a5a05) @@ -103,6 +103,7 @@ throw new ArgumentOutOfRangeException(null, string.Format(RingtoetsCommonDataResources.Orientation_Value_needs_to_be_in_Range_0_, orientationValidityRange)); } + orientation = newOrientation; } } @@ -308,6 +309,7 @@ { boundary = new RoundedDouble(boundary.NumberOfDecimalPlaces, 1000); } + return boundary; } @@ -317,6 +319,7 @@ { boundary = new RoundedDouble(boundary.NumberOfDecimalPlaces, -50); } + return boundary; } Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputContextProperties.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r173a4723b6e66c6931657148a6e9f18a8f4a5a05 --- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputContextProperties.cs (.../WaveConditionsInputContextProperties.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputContextProperties.cs (.../WaveConditionsInputContextProperties.cs) (revision 173a4723b6e66c6931657148a6e9f18a8f4a5a05) @@ -69,26 +69,39 @@ private const int foreshoreGeometryPropertyIndex = 13; private const int revetmentTypePropertyIndex = 14; + private readonly Func getNormativeAssessmentLevelFunc; private readonly IObservablePropertyChangeHandler propertyChangeHandler; /// /// Creates a new instance of . /// /// The for which the properties are shown. - /// The handler responsible for handling effects of a property change. + /// for obtaining the normative assessment level. + /// The handler responsible for handling effects of a property change. /// Thrown when any parameter is null. - protected WaveConditionsInputContextProperties(T context, IObservablePropertyChangeHandler handler) + protected WaveConditionsInputContextProperties(T context, + Func getNormativeAssessmentLevelFunc, + IObservablePropertyChangeHandler propertyChangeHandler) { if (context == null) { throw new ArgumentNullException(nameof(context)); } - if (handler == null) + + if (getNormativeAssessmentLevelFunc == null) { - throw new ArgumentNullException(nameof(handler)); + throw new ArgumentNullException(nameof(getNormativeAssessmentLevelFunc)); } - propertyChangeHandler = handler; + + if (propertyChangeHandler == null) + { + throw new ArgumentNullException(nameof(propertyChangeHandler)); + } + Data = context; + + this.getNormativeAssessmentLevelFunc = getNormativeAssessmentLevelFunc; + this.propertyChangeHandler = propertyChangeHandler; } [PropertyOrder(assessmentLevelPropertyIndex)] @@ -99,7 +112,7 @@ { get { - return data.WrappedData.AssessmentLevel; + return getNormativeAssessmentLevelFunc(); } } @@ -111,7 +124,7 @@ { get { - return data.WrappedData.UpperBoundaryDesignWaterLevel; + return WaveConditionsInputHelper.GetUpperBoundaryDesignWaterLevel(getNormativeAssessmentLevelFunc()); } } @@ -217,9 +230,9 @@ { get { - return data.WrappedData.ForeshoreProfile == null ? null : - new Point2D( - new RoundedDouble(0, data.WrappedData.ForeshoreProfile.WorldReferencePoint.X), + return data.WrappedData.ForeshoreProfile == null + ? null + : new Point2D(new RoundedDouble(0, data.WrappedData.ForeshoreProfile.WorldReferencePoint.X), new RoundedDouble(0, data.WrappedData.ForeshoreProfile.WorldReferencePoint.Y)); } } @@ -249,9 +262,8 @@ { get { - return data.WrappedData.ForeshoreProfile == null ? - new UseBreakWaterProperties() : - new UseBreakWaterProperties(data.WrappedData, propertyChangeHandler); + return data.WrappedData.ForeshoreProfile == null +? new UseBreakWaterProperties() : new UseBreakWaterProperties(data.WrappedData, propertyChangeHandler); } } Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PropertyClasses/WaveConditionsInputContextPropertiesTest.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r173a4723b6e66c6931657148a6e9f18a8f4a5a05 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PropertyClasses/WaveConditionsInputContextPropertiesTest.cs (.../WaveConditionsInputContextPropertiesTest.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PropertyClasses/WaveConditionsInputContextPropertiesTest.cs (.../WaveConditionsInputContextPropertiesTest.cs) (revision 173a4723b6e66c6931657148a6e9f18a8f4a5a05) @@ -78,7 +78,7 @@ } [Test] - public void Constructor_WithoutContext_ThrowsArgumentNullException() + public void Constructor_DataNull_ThrowsArgumentNullException() { // Call TestDelegate test = () => new TestWaveConditionsInputContextProperties(null, handler); @@ -89,7 +89,7 @@ } [Test] - public void Constructor_WithoutHandler_ThrowsArgumentNullException() + public void Constructor_PropertyChangeHandlerNull_ThrowsArgumentNullException() { // Setup mockRepository.ReplayAll(); @@ -104,7 +104,7 @@ // Assert var exception = Assert.Throws(test); - Assert.AreEqual("handler", exception.ParamName); + Assert.AreEqual("propertyChangeHandler", exception.ParamName); mockRepository.VerifyAll(); }