Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Data/Ringtoets.Revetment.Data.csproj =================================================================== diff -u -r8b7420d9b5ced2565ae07009fc8b5af8e1b8d5e7 -r8d4b9f33c5cc447619dc028293676e78003783e3 --- Ringtoets/Revetment/src/Ringtoets.Revetment.Data/Ringtoets.Revetment.Data.csproj (.../Ringtoets.Revetment.Data.csproj) (revision 8b7420d9b5ced2565ae07009fc8b5af8e1b8d5e7) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Data/Ringtoets.Revetment.Data.csproj (.../Ringtoets.Revetment.Data.csproj) (revision 8d4b9f33c5cc447619dc028293676e78003783e3) @@ -20,6 +20,7 @@ + Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInputHelper.cs =================================================================== diff -u --- Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInputHelper.cs (revision 0) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInputHelper.cs (revision 8d4b9f33c5cc447619dc028293676e78003783e3) @@ -0,0 +1,44 @@ +// Copyright (C) Stichting Deltares 2017. 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 Core.Common.Base.Data; + +namespace Ringtoets.Revetment.Data +{ + /// + /// Class containing helper methods related to . + /// + public static class WaveConditionsInputHelper + { + private const double designWaterLevelSubstraction = 0.01; + + /// + /// Gets an upper boundary based on the provided assessment level (that can be used while + /// determining water levels for wave condition calculations). + /// + /// The assessment level at stake. + /// The corresponding design water level upper boundary. + public static RoundedDouble GetUpperBoundaryDesignWaterLevel(RoundedDouble assessmentLevel) + { + return new RoundedDouble(2, assessmentLevel - designWaterLevelSubstraction); + } + } +} \ No newline at end of file Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/Ringtoets.Revetment.Data.Test.csproj =================================================================== diff -u -r8b7420d9b5ced2565ae07009fc8b5af8e1b8d5e7 -r8d4b9f33c5cc447619dc028293676e78003783e3 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/Ringtoets.Revetment.Data.Test.csproj (.../Ringtoets.Revetment.Data.Test.csproj) (revision 8b7420d9b5ced2565ae07009fc8b5af8e1b8d5e7) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/Ringtoets.Revetment.Data.Test.csproj (.../Ringtoets.Revetment.Data.Test.csproj) (revision 8d4b9f33c5cc447619dc028293676e78003783e3) @@ -18,6 +18,7 @@ + Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/WaveConditionsInputHelperTest.cs =================================================================== diff -u --- Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/WaveConditionsInputHelperTest.cs (revision 0) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/WaveConditionsInputHelperTest.cs (revision 8d4b9f33c5cc447619dc028293676e78003783e3) @@ -0,0 +1,44 @@ +// Copyright (C) Stichting Deltares 2017. 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 Core.Common.Base.Data; +using NUnit.Framework; + +namespace Ringtoets.Revetment.Data.Test +{ + [TestFixture] + public class WaveConditionsInputHelperTest + { + [TestCase(-0.5, -0.51)] + [TestCase(0.0, -0.01)] + [TestCase(0.5, 0.49)] + [TestCase(double.NaN, double.NaN)] + public void GetUpperBoundaryDesignWaterLevel_DifferentAssessmentLevels_ReturnsExpectedUpperBoundary(double assessmentLevel, double expectedUpperBoundary) + { + // Call + RoundedDouble upperBoundary = WaveConditionsInputHelper.GetUpperBoundaryDesignWaterLevel((RoundedDouble) assessmentLevel); + + // Assert + Assert.AreEqual(2, upperBoundary.NumberOfDecimalPlaces); + Assert.AreEqual(expectedUpperBoundary, upperBoundary); + } + } +} \ No newline at end of file