Index: Riskeer/Piping/src/Riskeer.Piping.Data/Properties/Resources.Designer.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/Piping/src/Riskeer.Piping.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/Piping/src/Riskeer.Piping.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -22,7 +22,6 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -82,7 +81,7 @@ } /// - /// Looks up a localized string similar to De waarde moet binnen het bereik {0} liggen.. + /// Looks up a localized string similar to De waarde van volumiek gewicht van water moet binnen het bereik {0} liggen.. /// public static string GeneralPipingInput_WaterVolumetricWeight_must_be_in_Range_0_ { get { @@ -113,8 +112,8 @@ /// public static string PipingFailureMechanismScenarioConfigurationType_PerFailureMechanismSection_DisplayName { get { - return ResourceManager.GetString("PipingFailureMechanismScenarioConfigurationType_PerFailureMechanismSection_Displa" + - "yName", resourceCulture); + return ResourceManager.GetString(("PipingFailureMechanismScenarioConfigurationType_PerFailureMechanismSection_Displa" + + "yName"), resourceCulture); } } Index: Riskeer/Piping/src/Riskeer.Piping.Data/Properties/Resources.resx =================================================================== diff -u -r943dcd0f78d271e0c3975767bdb0f24163c72b3a -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/Piping/src/Riskeer.Piping.Data/Properties/Resources.resx (.../Resources.resx) (revision 943dcd0f78d271e0c3975767bdb0f24163c72b3a) +++ Riskeer/Piping/src/Riskeer.Piping.Data/Properties/Resources.resx (.../Resources.resx) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -1,17 +1,17 @@  - @@ -130,7 +130,7 @@ Het gespecificeerde punt moet op het profiel liggen (bereik {0}). - De waarde moet binnen het bereik {0} liggen. + De waarde van het volumiek gewicht van water moet binnen het bereik {0} liggen. naam Index: Riskeer/Piping/test/Riskeer.Piping.Data.Test/GeneralPipingInputTest.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/Piping/test/Riskeer.Piping.Data.Test/GeneralPipingInputTest.cs (.../GeneralPipingInputTest.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/Piping/test/Riskeer.Piping.Data.Test/GeneralPipingInputTest.cs (.../GeneralPipingInputTest.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 @@ -91,7 +91,7 @@ TestDelegate test = () => inputParameters.WaterVolumetricWeight = (RoundedDouble) newValue; // Assert - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, "De waarde moet binnen het bereik [0,00, 20,00] liggen."); + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, "De waarde van het volumiek gewicht van water moet binnen het bereik [0,00, 20,00] liggen."); } [Test] Index: Riskeer/Piping/test/Riskeer.Piping.Forms.Test/PropertyClasses/CalculationsState/PipingFailureMechanismPropertiesTest.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/Piping/test/Riskeer.Piping.Forms.Test/PropertyClasses/CalculationsState/PipingFailureMechanismPropertiesTest.cs (.../PipingFailureMechanismPropertiesTest.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/Piping/test/Riskeer.Piping.Forms.Test/PropertyClasses/CalculationsState/PipingFailureMechanismPropertiesTest.cs (.../PipingFailureMechanismPropertiesTest.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 @@ -258,11 +258,11 @@ var properties = new PipingFailureMechanismProperties(failureMechanism, handler); - // Call + // Call void Call() => properties.WaterVolumetricWeight = roundedValue; // Assert - const string expectedMessage = "De waarde moet binnen het bereik [0,00, 20,00] liggen."; + const string expectedMessage = "De waarde van het volumiek gewicht van water moet binnen het bereik [0,00, 20,00] liggen."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage); Assert.IsTrue(handler.Called); @@ -294,7 +294,7 @@ var properties = new PipingFailureMechanismProperties(failureMechanism, handler); - // Call + // Call properties.WaterVolumetricWeight = roundedValue; // Assert Index: Riskeer/Revetment/src/Riskeer.Revetment.Data/GeneralWaveConditionsInput.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/Revetment/src/Riskeer.Revetment.Data/GeneralWaveConditionsInput.cs (.../GeneralWaveConditionsInput.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/Revetment/src/Riskeer.Revetment.Data/GeneralWaveConditionsInput.cs (.../GeneralWaveConditionsInput.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/GeneralWaveImpactAsphaltCoverWaveConditionsInput.cs =================================================================== diff -u --- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/GeneralWaveImpactAsphaltCoverWaveConditionsInput.cs (revision 0) +++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/GeneralWaveImpactAsphaltCoverWaveConditionsInput.cs (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -0,0 +1,85 @@ +// Copyright (C) Stichting Deltares and State of the Netherlands 2026. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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 Core.Common.Base.Data; +using Riskeer.WaveImpactAsphaltCover.Data.Properties; + +namespace Riskeer.WaveImpactAsphaltCover.Data +{ + /// + /// The general input parameters that apply to each wave impact asphalt cover wave conditions calculation. + /// + public class GeneralWaveImpactAsphaltCoverWaveConditionsInput + { + private const int numberOfDecimalPlaces = 2; + + private static readonly Range cValidityRange = + new Range(new RoundedDouble(numberOfDecimalPlaces), + new RoundedDouble(numberOfDecimalPlaces, 2.0)); + + private RoundedDouble c; + + /// + /// Creates a new instance of . + /// + public GeneralWaveImpactAsphaltCoverWaveConditionsInput() + { + A = new RoundedDouble(numberOfDecimalPlaces, 1.0); + B = new RoundedDouble(numberOfDecimalPlaces); + c = new RoundedDouble(numberOfDecimalPlaces); + } + + /// + /// Gets the 'a' parameter used in wave impact asphalt cover wave conditions calculations. + /// + public RoundedDouble A { get; } + + /// + /// Gets the 'b' parameter used in wave impact asphalt cover wave conditions calculations. + /// + public RoundedDouble B { get; } + + /// + /// Gets or sets the 'c' parameter used in wave impact asphalt cover wave conditions calculations. + /// Thrown when value is set to or falls out of range [0, 2]. + /// + public RoundedDouble C + { + get + { + return c; + } + set + { + RoundedDouble newValue = value.ToPrecision(numberOfDecimalPlaces); + + if (!cValidityRange.InRange(newValue)) + { + throw new ArgumentOutOfRangeException(nameof(value), string.Format(Resources.GeneralWaveImpactAsphaltCoverWaveConditionsInput_C_must_be_in_Range_0_, + cValidityRange)); + } + + c = newValue; + } + } + } +} \ No newline at end of file Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/Properties/Resources.Designer.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 @@ -22,7 +22,6 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -31,8 +30,8 @@ namespace Riskeer.WaveImpactAsphaltCover.Data.Properties { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -44,15 +43,15 @@ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -66,7 +65,7 @@ return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -80,7 +79,7 @@ resourceCulture = value; } } - + /// /// Looks up a localized string similar to AGK. /// @@ -89,7 +88,7 @@ return ResourceManager.GetString("WaveImpactAsphaltCoverFailureMechanism_Code", resourceCulture); } } - + /// /// Looks up a localized string similar to Golfklappen op asfaltbekleding. /// @@ -98,5 +97,14 @@ return ResourceManager.GetString("WaveImpactAsphaltCoverFailureMechanism_DisplayName", resourceCulture); } } + + /// + /// Looks up a localized string similar to De waarde van asfalt parameter C moet binnen het bereik {0} liggen.. + /// + public static string GeneralWaveImpactAsphaltCoverWaveConditionsInput_C_must_be_in_Range_0_ { + get { + return ResourceManager.GetString("WaveImpactAsphaltParamC_must_be_in_Range_0_", resourceCulture); + } + } } } Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/Properties/Resources.resx =================================================================== diff -u -rc2a04321c2aa2333a8324ad13f1fe753f51c62a3 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/Properties/Resources.resx (.../Resources.resx) (revision c2a04321c2aa2333a8324ad13f1fe753f51c62a3) +++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/Properties/Resources.resx (.../Resources.resx) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -1,17 +1,17 @@  - @@ -123,4 +123,7 @@ Golfklappen op asfaltbekleding + + De waarde van parameter 'c' moet binnen het bereik {0} liggen. + \ No newline at end of file Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/WaveImpactAsphaltCoverFailureMechanism.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/WaveImpactAsphaltCoverFailureMechanism.cs (.../WaveImpactAsphaltCoverFailureMechanism.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Data/WaveImpactAsphaltCoverFailureMechanism.cs (.../WaveImpactAsphaltCoverFailureMechanism.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 @@ -25,7 +25,6 @@ using Riskeer.Common.Data.Calculation; using Riskeer.Common.Data.DikeProfiles; using Riskeer.Common.Data.FailureMechanism; -using Riskeer.Revetment.Data; using Riskeer.WaveImpactAsphaltCover.Data.Properties; using RiskeerCommonDataResources = Riskeer.Common.Data.Properties.Resources; @@ -49,7 +48,7 @@ Name = RiskeerCommonDataResources.HydraulicBoundaryConditions_DisplayName }; ForeshoreProfiles = new ForeshoreProfileCollection(); - GeneralInput = new GeneralWaveConditionsInput(1.0, 0.0, 0.0); + GeneralInput = new GeneralWaveImpactAsphaltCoverWaveConditionsInput(); CalculationsInputComments = new Comment(); } @@ -61,7 +60,7 @@ /// /// Gets the general wave conditions input parameters that apply to each calculation. /// - public GeneralWaveConditionsInput GeneralInput { get; } + public GeneralWaveImpactAsphaltCoverWaveConditionsInput GeneralInput { get; } public IEnumerable Calculations => CalculationsGroup.GetCalculations().OfType(); Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PropertyClasses/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismProperties.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PropertyClasses/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismProperties.cs (.../WaveImpactAsphaltCoverFailureMechanismProperties.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PropertyClasses/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismProperties.cs (.../WaveImpactAsphaltCoverFailureMechanismProperties.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 @@ -20,9 +20,12 @@ // All rights reserved. using System; +using System.Collections.Generic; +using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Util.Attributes; using Core.Gui.Attributes; +using Riskeer.Common.Forms.PropertyClasses; using Riskeer.WaveImpactAsphaltCover.Data; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; using RiskeerRevetmentFormsResources = Riskeer.Revetment.Forms.Properties.Resources; @@ -40,17 +43,28 @@ private const int bPropertyIndex = 4; private const int cPropertyIndex = 5; + private readonly IFailureMechanismPropertyChangeHandler propertyChangeHandler; + /// /// Creates a new instance of . /// /// The instance to show the properties of. - /// Thrown when is null. - public WaveImpactAsphaltCoverFailureMechanismProperties(WaveImpactAsphaltCoverFailureMechanism data) : base(data, new ConstructionProperties + /// Handler responsible for handling effects of a property change. + /// Thrown when any parameter is null. + public WaveImpactAsphaltCoverFailureMechanismProperties(WaveImpactAsphaltCoverFailureMechanism data, IFailureMechanismPropertyChangeHandler handler) : base(data, new ConstructionProperties { NamePropertyIndex = namePropertyIndex, CodePropertyIndex = codePropertyIndex - }) {} + }) + { + if (handler == null) + { + throw new ArgumentNullException(nameof(handler)); + } + propertyChangeHandler = handler; + } + #region Model settings [PropertyOrder(aPropertyIndex)] @@ -87,8 +101,25 @@ { return data.GeneralInput.C; } + set + { + IEnumerable affectedObjects = propertyChangeHandler.SetPropertyValueAfterConfirmation( + data, + value, + (f, v) => f.GeneralInput.C = v); + + NotifyAffectedObjects(affectedObjects); + } } + private static void NotifyAffectedObjects(IEnumerable affectedObjects) + { + foreach (IObservable affectedObject in affectedObjects) + { + affectedObject.NotifyObservers(); + } + } + #endregion } } \ No newline at end of file Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 @@ -80,7 +80,7 @@ { yield return new PropertyInfo { - CreateInstance = context => new HydraulicLoadsStateFailureMechanismProperties(context.WrappedData) + CreateInstance = context => new HydraulicLoadsStateFailureMechanismProperties(context.WrappedData, new FailureMechanismPropertyChangeHandler()) }; yield return new PropertyInfo { Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverWaveConditionsCalculationService.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverWaveConditionsCalculationService.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationService.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverWaveConditionsCalculationService.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationService.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 @@ -40,9 +40,9 @@ public class WaveImpactAsphaltCoverWaveConditionsCalculationService : WaveConditionsCalculationServiceBase { /// - /// Performs a wave conditions calculation for the wave impact on asphalt failure mechanism based on the supplied - /// and sets - /// if the calculation was successful. + /// Performs a wave conditions calculation for the wave impact on asphalt failure mechanism based on the supplied + /// and sets + /// if the calculation was successful. /// Error and status information is logged during the execution of the operation. /// /// The that holds all the information required to perform the calculation. @@ -58,13 +58,13 @@ /// the required data cannot be read from the hydraulic boundary settings database. /// /// - /// Thrown when the target probability or + /// Thrown when the target probability or /// calculated probability falls outside the [0.0, 1.0] range and is not . /// Thrown when an error occurs during parsing of the Hydra-Ring output. /// Thrown when an error occurs during the calculation. public void Calculate(WaveImpactAsphaltCoverWaveConditionsCalculation calculation, IAssessmentSection assessmentSection, - GeneralWaveConditionsInput generalWaveConditionsInput) + GeneralWaveImpactAsphaltCoverWaveConditionsInput generalWaveConditionsInput) { if (calculation == null) { Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Data.Test/GeneralWaveImpactAsphaltCoverWaveConditionsInputTest.cs =================================================================== diff -u --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Data.Test/GeneralWaveImpactAsphaltCoverWaveConditionsInputTest.cs (revision 0) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Data.Test/GeneralWaveImpactAsphaltCoverWaveConditionsInputTest.cs (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -0,0 +1,83 @@ +// Copyright (C) Stichting Deltares and State of the Netherlands 2026. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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 Core.Common.Base.Data; +using Core.Common.TestUtil; +using NUnit.Framework; +using Riskeer.Common.Data.TestUtil; + +namespace Riskeer.WaveImpactAsphaltCover.Data.Test +{ + [TestFixture] + public class GeneralWaveImpactAsphaltCoverWaveConditionsInputTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Call + var generalInput = new GeneralWaveImpactAsphaltCoverWaveConditionsInput(); + + // Assert + Assert.AreEqual(1.0, generalInput.A, generalInput.A.GetAccuracy()); + Assert.AreEqual(2, generalInput.A.NumberOfDecimalPlaces); + Assert.AreEqual(0.0, generalInput.B, generalInput.B.GetAccuracy()); + Assert.AreEqual(2, generalInput.B.NumberOfDecimalPlaces); + Assert.AreEqual(0.0, generalInput.C, generalInput.C.GetAccuracy()); + Assert.AreEqual(2, generalInput.C.NumberOfDecimalPlaces); + } + + [Test] + [TestCase(1.69)] + [TestCase(-0.004)] + [TestCase(2.004)] + public void C_SetValidValue_ValueSet(double newValue) + { + // Setup + var generalInput = new GeneralWaveImpactAsphaltCoverWaveConditionsInput(); + + // Call + generalInput.C = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, generalInput.C, generalInput.C.GetAccuracy()); + } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(-0.005)] + [TestCase(2.005)] + public void C_SetInvalidValue_ThrowArgumentException(double newValue) + { + // Setup + var generalInput = new GeneralWaveImpactAsphaltCoverWaveConditionsInput(); + + // Call + TestDelegate test = () => generalInput.C = (RoundedDouble) newValue; + + // Assert + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, + "De waarde van parameter 'c' moet binnen het bereik [0,00, 2,00] liggen."); + } + } +} \ No newline at end of file Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContextTest.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContextTest.cs (.../WaveImpactAsphaltCoverFailureMechanismContextTest.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContextTest.cs (.../WaveImpactAsphaltCoverFailureMechanismContextTest.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PropertyClasses/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismPropertiesTest.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PropertyClasses/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismPropertiesTest.cs (.../WaveImpactAsphaltCoverFailureMechanismPropertiesTest.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PropertyClasses/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismPropertiesTest.cs (.../WaveImpactAsphaltCoverFailureMechanismPropertiesTest.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 @@ -19,10 +19,17 @@ // 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.Base.Data; +using Core.Common.TestUtil; using Core.Gui.TestUtil; using NUnit.Framework; -using Riskeer.Revetment.Data; +using Rhino.Mocks; +using Riskeer.Common.Data.TestUtil; +using Riskeer.Common.Forms.ChangeHandlers; +using Riskeer.Common.Forms.TestUtil; using Riskeer.WaveImpactAsphaltCover.Data; using Riskeer.WaveImpactAsphaltCover.Forms.PropertyClasses; using Riskeer.WaveImpactAsphaltCover.Forms.PropertyClasses.HydraulicLoadsState; @@ -45,25 +52,36 @@ var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); // Call - var properties = new WaveImpactAsphaltCoverFailureMechanismProperties(failureMechanism); + var properties = new WaveImpactAsphaltCoverFailureMechanismProperties(failureMechanism, new FailureMechanismPropertyChangeHandler()); // Assert Assert.IsInstanceOf(properties); Assert.AreSame(failureMechanism, properties.Data); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); - GeneralWaveConditionsInput generalWaveConditionsInput = failureMechanism.GeneralInput; + GeneralWaveImpactAsphaltCoverWaveConditionsInput generalWaveConditionsInput = failureMechanism.GeneralInput; Assert.AreEqual(generalWaveConditionsInput.A, properties.A); Assert.AreEqual(generalWaveConditionsInput.B, properties.B); Assert.AreEqual(generalWaveConditionsInput.C, properties.C); } [Test] + public void Constructor_ChangeHandlerNull_ThrowArgumentNullException() + { + // Call + void Call() => new WaveImpactAsphaltCoverFailureMechanismProperties(new WaveImpactAsphaltCoverFailureMechanism(), null); + + // Assert + var exception = Assert.Throws(Call); + Assert.AreEqual("handler", exception.ParamName); + } + + [Test] public void Constructor_Always_PropertiesHaveExpectedAttributeValues() { // Call - var properties = new WaveImpactAsphaltCoverFailureMechanismProperties(new WaveImpactAsphaltCoverFailureMechanism()); + var properties = new WaveImpactAsphaltCoverFailureMechanismProperties(new WaveImpactAsphaltCoverFailureMechanism(), new FailureMechanismPropertyChangeHandler()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -104,8 +122,81 @@ PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(cProperty, modelSettingsCategory, "c [-]", - "De waarde van de parameter 'c' in de berekening voor golfcondities.", - true); + "De waarde van de parameter 'c' in de berekening voor golfcondities."); } + + [Test] + [SetCulture("nl-NL")] + [TestCase(double.NaN)] + [TestCase(double.NegativeInfinity)] + [TestCase(double.PositiveInfinity)] + [TestCase(-0.005)] + [TestCase(2.005)] + public void C_SetInvalidValue_ThrowArgumentExceptionAndDoesNotUpdateObservers(double value) + { + // Setup + var mocks = new MockRepository(); + var observable = mocks.StrictMock(); + mocks.ReplayAll(); + + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + var roundedValue = (RoundedDouble) value; + + var handler = new FailureMechanismSetPropertyValueAfterConfirmationParameterTester( + failureMechanism, + roundedValue, + new[] + { + observable + }); + + var properties = new WaveImpactAsphaltCoverFailureMechanismProperties(failureMechanism, handler); + + // Call + void Call() => properties.C = roundedValue; + + // Assert + const string expectedMessage = "De waarde van parameter 'c' moet binnen het bereik [0,00, 2,00] liggen."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage); + Assert.IsTrue(handler.Called); + + mocks.VerifyAll(); + } + + [Test] + [TestCase(1.5)] + [TestCase(-0.004)] + [TestCase(2.004)] + public void C_SetValidValue_SetsValueRoundedAndUpdatesObservers(double value) + { + // Setup + var mocks = new MockRepository(); + var observable = mocks.StrictMock(); + observable.Expect(o => o.NotifyObservers()); + mocks.ReplayAll(); + + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + var roundedValue = (RoundedDouble) value; + + var handler = new FailureMechanismSetPropertyValueAfterConfirmationParameterTester( + failureMechanism, + roundedValue, + new[] + { + observable + }); + + var properties = new WaveImpactAsphaltCoverFailureMechanismProperties(failureMechanism, handler); + + // Call + properties.C = roundedValue; + + // Assert + Assert.AreEqual(value, failureMechanism.GeneralInput.C, + failureMechanism.GeneralInput.C.GetAccuracy()); + Assert.IsTrue(handler.Called); + + mocks.VerifyAll(); + } } } \ No newline at end of file Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Integration.Test/WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Integration.Test/WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Integration.Test/WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 @@ -213,7 +213,7 @@ var waterLevelIndex = 0; foreach (WaveConditionsCosineCalculationInput actualInput in waveConditionsInputs) { - GeneralWaveConditionsInput generalInput = waveImpactAsphaltCoverFailureMechanism.GeneralInput; + GeneralWaveImpactAsphaltCoverWaveConditionsInput generalInput = waveImpactAsphaltCoverFailureMechanism.GeneralInput; WaveConditionsInput input = calculation.InputParameters; var expectedInput = new WaveConditionsCosineCalculationInput(1, Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Service.Test/WaveImpactAsphaltCoverWaveConditionsCalculationServiceTest.cs =================================================================== diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -r077c94e96c670b9d802e0d696339da12955ed1f9 --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Service.Test/WaveImpactAsphaltCoverWaveConditionsCalculationServiceTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationServiceTest.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Service.Test/WaveImpactAsphaltCoverWaveConditionsCalculationServiceTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationServiceTest.cs) (revision 077c94e96c670b9d802e0d696339da12955ed1f9) @@ -6,7 +6,7 @@ // 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 @@ -280,7 +280,7 @@ var waterLevelIndex = 0; foreach (WaveConditionsCosineCalculationInput actualInput in waveConditionsInputs) { - GeneralWaveConditionsInput generalInput = waveImpactAsphaltCoverFailureMechanism.GeneralInput; + GeneralWaveImpactAsphaltCoverWaveConditionsInput generalInput = waveImpactAsphaltCoverFailureMechanism.GeneralInput; WaveConditionsInput input = calculation.InputParameters; var expectedInput = new WaveConditionsCosineCalculationInput(1,