Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlice.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlice.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlice.cs (revision f7f2fb5812d9a3c71a95f13140e8dd22f85768fa) @@ -0,0 +1,86 @@ +// 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.Geometry; + +namespace Ringtoets.MacroStabilityInwards.Primitives.Output +{ + /// + /// The slice result of a macro stability calculation. + /// + public class MacroStabilityInwardsSlice + { + /// + /// Creates a new instance of . + /// + /// The top left point of the slice. + /// The top right point of the slice. + /// The bottom left point of the slice. + /// The bottom right point of the slice. + /// Thrown when any parameter is null. + public MacroStabilityInwardsSlice(Point2D topLeftPoint, Point2D topRightPoint, + Point2D bottomLeftPoint, Point2D bottomRightPoint) + { + if (topLeftPoint == null) + { + throw new ArgumentNullException(nameof(topLeftPoint)); + } + if (topRightPoint == null) + { + throw new ArgumentNullException(nameof(topRightPoint)); + } + if (bottomLeftPoint == null) + { + throw new ArgumentNullException(nameof(bottomLeftPoint)); + } + if (bottomRightPoint == null) + { + throw new ArgumentNullException(nameof(bottomRightPoint)); + } + + TopLeftPoint = topLeftPoint; + TopRightPoint = topRightPoint; + BottomLeftPoint = bottomLeftPoint; + BottomRightPoint = bottomRightPoint; + } + + /// + /// Gets the top left point of the slice. + /// + public Point2D TopLeftPoint { get; } + + /// + /// Gets the top right point of the slice. + /// + public Point2D TopRightPoint { get; } + + /// + /// Gets the bottom left point of the slice. + /// + public Point2D BottomLeftPoint { get; } + + /// + /// Gets the bottom right point of the slice. + /// + public Point2D BottomRightPoint { get; } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj =================================================================== diff -u -r1f741e6208690a17217cea730557aa10f09bd8ec -rf7f2fb5812d9a3c71a95f13140e8dd22f85768fa --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.csproj) (revision 1f741e6208690a17217cea730557aa10f09bd8ec) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ringtoets.MacroStabilityInwards.Primitives.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.csproj) (revision f7f2fb5812d9a3c71a95f13140e8dd22f85768fa) @@ -54,6 +54,7 @@ + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSliceTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSliceTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSliceTest.cs (revision f7f2fb5812d9a3c71a95f13140e8dd22f85768fa) @@ -0,0 +1,95 @@ +// 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.Geometry; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.Primitives.Output; + +namespace Ringtoets.MacroStabilityInwards.Primitives.Test.Output +{ + [TestFixture] + public class MacroStabilityInwardsSliceTest + { + [Test] + public void Constructor_TopLeftPointNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new MacroStabilityInwardsSlice(null, new Point2D(0, 0), new Point2D(0, 0), new Point2D(0, 0)); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("topLeftPoint", exception.ParamName); + } + + [Test] + public void Constructor_TopRightPointNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new MacroStabilityInwardsSlice(new Point2D(0, 0), null, new Point2D(0, 0), new Point2D(0, 0)); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("topRightPoint", exception.ParamName); + } + + [Test] + public void Constructor_BottomLeftPointNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new MacroStabilityInwardsSlice(new Point2D(0, 0), new Point2D(0, 0), null, new Point2D(0, 0)); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("bottomLeftPoint", exception.ParamName); + } + + [Test] + public void Constructor_BottomRightPointNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new MacroStabilityInwardsSlice(new Point2D(0, 0), new Point2D(0, 0), new Point2D(0, 0), null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("bottomRightPoint", exception.ParamName); + } + + [Test] + public void Constructor_WithCoordinates_ExpectedValues() + { + // Setup + var topLeftPoint = new Point2D(0, 0); + var topRightPoint = new Point2D(1, 1); + var bottomLeftPoint = new Point2D(2, 2); + var bottomRightPoint = new Point2D(3, 3); + + // Call + var slice = new MacroStabilityInwardsSlice(topLeftPoint, topRightPoint, bottomLeftPoint, bottomRightPoint); + + // Assert + Assert.AreEqual(topLeftPoint, slice.TopLeftPoint); + Assert.AreEqual(topRightPoint, slice.TopRightPoint); + Assert.AreEqual(bottomLeftPoint, slice.BottomLeftPoint); + Assert.AreEqual(bottomRightPoint, slice.BottomRightPoint); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj =================================================================== diff -u -r1ed3d9d4658bd127779e9e818d73cb2e478c6b78 -rf7f2fb5812d9a3c71a95f13140e8dd22f85768fa --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.Test.csproj) (revision 1ed3d9d4658bd127779e9e818d73cb2e478c6b78) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Ringtoets.MacroStabilityInwards.Primitives.Test.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.Test.csproj) (revision f7f2fb5812d9a3c71a95f13140e8dd22f85768fa) @@ -64,6 +64,7 @@ +