Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs =================================================================== diff -u -r30b8231f92b90ea4b05e98e3d0285368f6dfe2e4 -rf37230ff653580eb90dd878e6ecc4f15511a11d6 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs (.../GrassCoverErosionInwardsInputTest.cs) (revision 30b8231f92b90ea4b05e98e3d0285368f6dfe2e4) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs (.../GrassCoverErosionInwardsInputTest.cs) (revision f37230ff653580eb90dd878e6ecc4f15511a11d6) @@ -129,7 +129,6 @@ } [Test] - [Combinatorial] public void DikeProfile_SetNullValue_InputSyncedToDefaults() { // Setup Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs =================================================================== diff -u -r48e1ce89dde79fee454de1157cf61b1c5525506a -rf37230ff653580eb90dd878e6ecc4f15511a11d6 --- Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision 48e1ce89dde79fee454de1157cf61b1c5525506a) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision f37230ff653580eb90dd878e6ecc4f15511a11d6) @@ -33,12 +33,19 @@ public class WaveConditionsInput { private DikeProfile dikeProfile; + private RoundedDouble upperLevel; + private RoundedDouble lowerLevel; + private RoundedDouble stepSize; /// /// Creates a new instance of . /// public WaveConditionsInput() { + upperLevel = new RoundedDouble(2); + lowerLevel = new RoundedDouble(2); + stepSize = new RoundedDouble(1); + UpdateProfileParameters(); } @@ -91,6 +98,42 @@ } } + public RoundedDouble UpperLevel + { + get + { + return upperLevel; + } + set + { + upperLevel = value.ToPrecision(upperLevel.NumberOfDecimalPlaces); + } + } + + public RoundedDouble LowerLevel + { + get + { + return lowerLevel; + } + set + { + lowerLevel = value.ToPrecision(lowerLevel.NumberOfDecimalPlaces); + } + } + + public RoundedDouble StepSize + { + get + { + return stepSize; + } + set + { + stepSize = value.ToPrecision(stepSize.NumberOfDecimalPlaces); + } + } + private void UpdateProfileParameters() { if (dikeProfile == null) Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/WaveConditionsInputTest.cs =================================================================== diff -u -r48e1ce89dde79fee454de1157cf61b1c5525506a -rf37230ff653580eb90dd878e6ecc4f15511a11d6 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/WaveConditionsInputTest.cs (.../WaveConditionsInputTest.cs) (revision 48e1ce89dde79fee454de1157cf61b1c5525506a) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Data.Test/WaveConditionsInputTest.cs (.../WaveConditionsInputTest.cs) (revision f37230ff653580eb90dd878e6ecc4f15511a11d6) @@ -45,6 +45,9 @@ Assert.AreEqual(new RoundedDouble(2), input.BreakWater.Height); Assert.IsFalse(input.UseForeshore); CollectionAssert.IsEmpty(input.ForeshoreGeometry); + Assert.AreEqual(new RoundedDouble(2), input.UpperLevel); + Assert.AreEqual(new RoundedDouble(2), input.LowerLevel); + Assert.AreEqual(new RoundedDouble(1), input.StepSize); } [Test] @@ -107,7 +110,6 @@ } [Test] - [Combinatorial] public void DikeProfile_SetNullValue_InputSyncedToDefaults() { // Setup @@ -154,5 +156,53 @@ CollectionAssert.IsEmpty(input.ForeshoreGeometry); Assert.AreEqual(originalHydraulicBoundaryLocation, input.HydraulicBoundaryLocation); } + + [Test] + public void UpperLevel_SetNewValue_ValueIsRounded() + { + // Setup + var input = new WaveConditionsInput(); + + int originalNumberOfDecimalPlaces = input.UpperLevel.NumberOfDecimalPlaces; + + // Call + input.UpperLevel = new RoundedDouble(5, 1.23456); + + // Assert + Assert.AreEqual(originalNumberOfDecimalPlaces, input.UpperLevel.NumberOfDecimalPlaces); + Assert.AreEqual(1.23, input.UpperLevel.Value); + } + + [Test] + public void LowerLevel_SetNewValue_ValueIsRounded() + { + // Setup + var input = new WaveConditionsInput(); + + int originalNumberOfDecimalPlaces = input.LowerLevel.NumberOfDecimalPlaces; + + // Call + input.LowerLevel = new RoundedDouble(5, 1.23456); + + // Assert + Assert.AreEqual(originalNumberOfDecimalPlaces, input.LowerLevel.NumberOfDecimalPlaces); + Assert.AreEqual(1.23, input.LowerLevel.Value); + } + + [Test] + public void StepSize_SetNewValue_ValueIsRounded() + { + // Setup + var input = new WaveConditionsInput(); + + int originalNumberOfDecimalPlaces = input.StepSize.NumberOfDecimalPlaces; + + // Call + input.StepSize = new RoundedDouble(5, 1.23456); + + // Assert + Assert.AreEqual(originalNumberOfDecimalPlaces, input.StepSize.NumberOfDecimalPlaces); + Assert.AreEqual(1.2, input.StepSize.Value); + } } } \ No newline at end of file