Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsGrid.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsGrid.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsGrid.cs (revision 9ca04c726ce0c9ce7c4bcc65d3fd2ba62ac918b1) @@ -0,0 +1,121 @@ +// 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.MacroStabilityInwards.Data +{ + /// + /// A grid used in the . + /// + public class MacroStabilityInwardsGrid + { + private RoundedDouble xLeft; + private RoundedDouble xRight; + private RoundedDouble zTop; + private RoundedDouble zBottom; + + /// + /// Creates a new instance of . + /// + public MacroStabilityInwardsGrid() + { + xLeft = new RoundedDouble(2); + xRight = new RoundedDouble(2); + zTop = new RoundedDouble(2); + zBottom = new RoundedDouble(2); + } + + /// + /// Gets or sets the x left of the grid. + /// [m] + /// + public RoundedDouble XLeft + { + get + { + return xLeft; + } + set + { + xLeft = value.ToPrecision(xLeft.NumberOfDecimalPlaces); + } + } + + /// + /// Gets or sets the x right of the grid. + /// [m] + /// + public RoundedDouble XRight + { + get + { + return xRight; + } + set + { + xRight = value.ToPrecision(xRight.NumberOfDecimalPlaces); + } + } + + /// + /// Gets or sets the z top of the grid. + /// [m+NAP] + /// + public RoundedDouble ZTop + { + get + { + return zTop; + } + set + { + zTop = value.ToPrecision(ZTop.NumberOfDecimalPlaces); + } + } + + /// + /// Gets or sets the z bottom of the grid. + /// [m+NAP] + /// + public RoundedDouble ZBottom + { + get + { + return zBottom; + } + set + { + zBottom = value.ToPrecision(zBottom.NumberOfDecimalPlaces); + } + } + + /// + /// Gets or set the number of horizontal points. + /// + public int NumberOfHorizontalPoints { get; set; } + + /// + /// Gets or sets the number of vertical points. + /// + public int NumberOfVerticalpoints { get; set; } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/Ringtoets.MacroStabilityInwards.Data.csproj =================================================================== diff -u -ra2fcfdc2e2c0c42a15983c86fc95a3cf38a3751c -r9ca04c726ce0c9ce7c4bcc65d3fd2ba62ac918b1 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/Ringtoets.MacroStabilityInwards.Data.csproj (.../Ringtoets.MacroStabilityInwards.Data.csproj) (revision a2fcfdc2e2c0c42a15983c86fc95a3cf38a3751c) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/Ringtoets.MacroStabilityInwards.Data.csproj (.../Ringtoets.MacroStabilityInwards.Data.csproj) (revision 9ca04c726ce0c9ce7c4bcc65d3fd2ba62ac918b1) @@ -39,6 +39,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsGridTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsGridTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsGridTest.cs (revision 9ca04c726ce0c9ce7c4bcc65d3fd2ba62ac918b1) @@ -0,0 +1,80 @@ +// 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 System; +using Core.Common.Base.Data; +using NUnit.Framework; + +namespace Ringtoets.MacroStabilityInwards.Data.Test +{ + [TestFixture] + public class MacroStabilityInwardsGridTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Call + var grid = new MacroStabilityInwardsGrid(); + + // Assert + Assert.AreEqual(0, grid.XLeft.Value); + Assert.AreEqual(2, grid.XLeft.NumberOfDecimalPlaces); + + Assert.AreEqual(0, grid.XRight.Value); + Assert.AreEqual(2, grid.XRight.NumberOfDecimalPlaces); + + Assert.AreEqual(0, grid.ZTop.Value); + Assert.AreEqual(2, grid.ZTop.NumberOfDecimalPlaces); + + Assert.AreEqual(0, grid.ZBottom.Value); + Assert.AreEqual(2, grid.ZBottom.NumberOfDecimalPlaces); + + Assert.AreEqual(0, grid.NumberOfHorizontalPoints); + Assert.AreEqual(0, grid.NumberOfVerticalpoints); + } + + [Test] + public void Constructor_PropertiesSet_ExpectedValues() + { + // Setup + var random = new Random(); + double xLeft = random.Next(); + double xRight = random.Next(); + double zTop = random.Next(); + double zBottom = random.Next(); + + // call + var grid = new MacroStabilityInwardsGrid + { + XLeft = (RoundedDouble) xLeft, + XRight = (RoundedDouble) xRight, + ZTop = (RoundedDouble) zTop, + ZBottom = (RoundedDouble) zBottom + }; + + // Assert + Assert.AreEqual(new RoundedDouble(2, xLeft), grid.XLeft); + Assert.AreEqual(new RoundedDouble(2, xRight), grid.XRight); + Assert.AreEqual(new RoundedDouble(2, zTop), grid.ZTop); + Assert.AreEqual(new RoundedDouble(2, zBottom), grid.ZBottom); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/Ringtoets.MacroStabilityInwards.Data.Test.csproj =================================================================== diff -u -r7b7bd75dc1c1327386c9be96b5d480565bb8ecd6 -r9ca04c726ce0c9ce7c4bcc65d3fd2ba62ac918b1 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/Ringtoets.MacroStabilityInwards.Data.Test.csproj (.../Ringtoets.MacroStabilityInwards.Data.Test.csproj) (revision 7b7bd75dc1c1327386c9be96b5d480565bb8ecd6) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/Ringtoets.MacroStabilityInwards.Data.Test.csproj (.../Ringtoets.MacroStabilityInwards.Data.Test.csproj) (revision 9ca04c726ce0c9ce7c4bcc65d3fd2ba62ac918b1) @@ -63,6 +63,7 @@ +