Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsHydraulicBoundaryLocation.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsHydraulicBoundaryLocation.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsHydraulicBoundaryLocation.cs (revision bfe7019fdb71a01bf3c89176c53a546f615fe47e) @@ -0,0 +1,70 @@ +// 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 Core.Common.Base.Data; +using Ringtoets.HydraRing.Data; + +namespace Ringtoets.GrassCoverErosionOutwards.Data +{ + /// + /// Hydraulic boundary location for the . + /// + public class GrassCoverErosionOutwardsHydraulicBoundaryLocation + { + private RoundedDouble sectionSpecificWaterLevel; + + /// + /// Creates a new instance of . + /// + /// The + /// this specific water level applies to. + public GrassCoverErosionOutwardsHydraulicBoundaryLocation(HydraulicBoundaryLocation hydraulicBoundaryLocation) + { + if (hydraulicBoundaryLocation == null) + { + throw new ArgumentNullException("hydraulicBoundaryLocation"); + } + HydraulicBoundaryLocation = hydraulicBoundaryLocation; + sectionSpecificWaterLevel = new RoundedDouble(2, double.NaN); + } + + /// + /// Gets the . + /// + public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; private set; } + + /// + /// Gets or sets the section specific water level of . + /// + public RoundedDouble SectionSpecificWaterLevel + { + get + { + return sectionSpecificWaterLevel; + } + set + { + sectionSpecificWaterLevel = value.ToPrecision(sectionSpecificWaterLevel.NumberOfDecimalPlaces); + } + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Ringtoets.GrassCoverErosionOutwards.Data.csproj =================================================================== diff -u -r75b6f60a2d13f7a3a57c17356513f2c66ee3a759 -rbfe7019fdb71a01bf3c89176c53a546f615fe47e --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Ringtoets.GrassCoverErosionOutwards.Data.csproj (.../Ringtoets.GrassCoverErosionOutwards.Data.csproj) (revision 75b6f60a2d13f7a3a57c17356513f2c66ee3a759) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Ringtoets.GrassCoverErosionOutwards.Data.csproj (.../Ringtoets.GrassCoverErosionOutwards.Data.csproj) (revision bfe7019fdb71a01bf3c89176c53a546f615fe47e) @@ -48,7 +48,7 @@ True Resources.resx - + Fisheye: Tag bfe7019fdb71a01bf3c89176c53a546f615fe47e refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/SectionSpecificHydraulicBoundaryLocation.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsHydraulicBoundaryLocationTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsHydraulicBoundaryLocationTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsHydraulicBoundaryLocationTest.cs (revision bfe7019fdb71a01bf3c89176c53a546f615fe47e) @@ -0,0 +1,77 @@ +// 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 Core.Common.Base.Data; +using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.HydraRing.Data; + +namespace Ringtoets.GrassCoverErosionOutwards.Data.Test +{ + [TestFixture] + public class GrassCoverErosionOutwardsHydraulicBoundaryLocationTest + { + [Test] + public void Constructor_NullHydraulicBoundaryLocation_ThrowsArgumentNullException() + { + // Setup + + // Call + TestDelegate test = () => new GrassCoverErosionOutwardsHydraulicBoundaryLocation(null); + + // Assert + var paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("hydraulicBoundaryLocation", paramName); + } + + [Test] + public void Constructor_ValidArguments_PropertiesAsExpected() + { + // Setup + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 0.0, 0.0); + + // Call + var grassCoverErosionOutwardsHydraulicBoundaryLocation = new GrassCoverErosionOutwardsHydraulicBoundaryLocation(hydraulicBoundaryLocation); + + // Assert + Assert.AreSame(hydraulicBoundaryLocation, grassCoverErosionOutwardsHydraulicBoundaryLocation.HydraulicBoundaryLocation); + Assert.IsNaN(grassCoverErosionOutwardsHydraulicBoundaryLocation.SectionSpecificWaterLevel); + Assert.AreEqual(2, grassCoverErosionOutwardsHydraulicBoundaryLocation.SectionSpecificWaterLevel.NumberOfDecimalPlaces); + } + + [Test] + public void SetProperties_ValidParameters_ReturnsExpectedValues() + { + // Setup + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 0.0, 0.0); + var grassCoverErosionOutwardsHydraulicBoundaryLocation = new GrassCoverErosionOutwardsHydraulicBoundaryLocation(hydraulicBoundaryLocation); + + // Call + var sectionSpecificWaterLevel = (RoundedDouble) 1.23456; + grassCoverErosionOutwardsHydraulicBoundaryLocation.SectionSpecificWaterLevel = sectionSpecificWaterLevel; + + // Assert + Assert.AreEqual(sectionSpecificWaterLevel, grassCoverErosionOutwardsHydraulicBoundaryLocation.SectionSpecificWaterLevel, + grassCoverErosionOutwardsHydraulicBoundaryLocation.SectionSpecificWaterLevel.GetAccuracy()); + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/Ringtoets.GrassCoverErosionOutwards.Data.Test.csproj =================================================================== diff -u -r75b6f60a2d13f7a3a57c17356513f2c66ee3a759 -rbfe7019fdb71a01bf3c89176c53a546f615fe47e --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/Ringtoets.GrassCoverErosionOutwards.Data.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Data.Test.csproj) (revision 75b6f60a2d13f7a3a57c17356513f2c66ee3a759) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/Ringtoets.GrassCoverErosionOutwards.Data.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Data.Test.csproj) (revision bfe7019fdb71a01bf3c89176c53a546f615fe47e) @@ -52,7 +52,7 @@ - + Fisheye: Tag bfe7019fdb71a01bf3c89176c53a546f615fe47e refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/SectionSpecificHydraulicBoundaryLocationTest.cs'. Fisheye: No comparison available. Pass `N' to diff?