Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/IWaternetCalculator.cs =================================================================== diff -u -re2fce8d8e6cf66d649e62ca10b22536f44c266c2 -rfc7a77a30ababe1d51f8fd39fa0fa599eb8011cd --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/IWaternetCalculator.cs (.../IWaternetCalculator.cs) (revision e2fce8d8e6cf66d649e62ca10b22536f44c266c2) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/IWaternetCalculator.cs (.../IWaternetCalculator.cs) (revision fc7a77a30ababe1d51f8fd39fa0fa599eb8011cd) @@ -19,6 +19,8 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; + namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet { /// Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Output/WaternetCalculatorResult.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Output/WaternetCalculatorResult.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Output/WaternetCalculatorResult.cs (revision fc7a77a30ababe1d51f8fd39fa0fa599eb8011cd) @@ -0,0 +1,63 @@ +// 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 System.Collections.Generic; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output +{ + /// + /// This class contains the results of a Waternet calculation. + /// + public class WaternetCalculatorResult + { + /// + /// Creates a new instance of . + /// + /// The phreatic lines. + /// The waternet lines. + /// Thrown when + /// or is null. + internal WaternetCalculatorResult(WaternetPhreaticLineResult[] phreaticLines, WaternetLineResult[] waternetLines) + { + if (phreaticLines == null) + { + throw new ArgumentNullException(nameof(phreaticLines)); + } + if (waternetLines == null) + { + throw new ArgumentNullException(nameof(waternetLines)); + } + PhreaticLines = phreaticLines; + WaternetLines = waternetLines; + } + + /// + /// Gets the phreatic lines. + /// + public IEnumerable PhreaticLines { get; } + + /// + /// Gets the waternet lines. + /// + public IEnumerable WaternetLines { get; } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Output/WaternetLineResult.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Output/WaternetLineResult.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Output/WaternetLineResult.cs (revision fc7a77a30ababe1d51f8fd39fa0fa599eb8011cd) @@ -0,0 +1,75 @@ +// 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 System.Collections.Generic; +using Core.Common.Base.Geometry; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output +{ + /// + /// The waternet line result of a Waternet calculation. + /// + public class WaternetLineResult + { + /// + /// Creates a new instance of . + /// + /// The name of the line. + /// The geometry of the line. + /// The associated phreatic line. + /// Thrown when any parameter + /// is null. + internal WaternetLineResult(string name, Point2D[] geometry, WaternetPhreaticLineResult phreaticLine) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (geometry == null) + { + throw new ArgumentNullException(nameof(geometry)); + } + if (phreaticLine == null) + { + throw new ArgumentNullException(nameof(phreaticLine)); + } + Name = name; + Geometry = geometry; + PhreaticLine = phreaticLine; + } + + /// + /// Gets the name of the line. + /// + public string Name { get; } + + /// + /// Gets the geometry of the line. + /// + public IEnumerable Geometry { get; } + + /// + /// Gets the associated phreatic line. + /// + public WaternetPhreaticLineResult PhreaticLine { get; } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Output/WaternetPhreaticLineResult.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Output/WaternetPhreaticLineResult.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Output/WaternetPhreaticLineResult.cs (revision fc7a77a30ababe1d51f8fd39fa0fa599eb8011cd) @@ -0,0 +1,64 @@ +// 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 System.Collections.Generic; +using Core.Common.Base.Geometry; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output +{ + /// + /// The phreatic line result of a Waternet calculation. + /// + public class WaternetPhreaticLineResult + { + /// + /// Creates a new instance of . + /// + /// The name of the line. + /// The geometry of the line. + /// Thrown when + /// or is null. + internal WaternetPhreaticLineResult(string name, Point2D[] geometry) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (geometry == null) + { + throw new ArgumentNullException(nameof(geometry)); + } + Name = name; + Geometry = geometry; + } + + /// + /// Gets the name of the line. + /// + public string Name { get; } + + /// + /// Gets the geometry of the line. + /// + public IEnumerable Geometry { get; } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj =================================================================== diff -u -r0e47d3eddb8f503448a0aae5edf1114202e6e557 -rfc7a77a30ababe1d51f8fd39fa0fa599eb8011cd --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.csproj) (revision 0e47d3eddb8f503448a0aae5edf1114202e6e557) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.csproj) (revision fc7a77a30ababe1d51f8fd39fa0fa599eb8011cd) @@ -60,6 +60,9 @@ + + + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/Output/WaternetCalculatorResultTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/Output/WaternetCalculatorResultTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/Output/WaternetCalculatorResultTest.cs (revision fc7a77a30ababe1d51f8fd39fa0fa599eb8011cd) @@ -0,0 +1,68 @@ +// 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 NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Calculators.Waternet.Output +{ + [TestFixture] + public class WaternetCalculatorResultTest + { + [Test] + public void Constructor_PhreaticLinesNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new WaternetCalculatorResult(null, new WaternetLineResult[0]); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("phreaticLines", exception.ParamName); + } + + [Test] + public void Constructor_WaternetLinesNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new WaternetCalculatorResult(new WaternetPhreaticLineResult[0], null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("waternetLines", exception.ParamName); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var phreaticLines = new WaternetPhreaticLineResult[0]; + var waternetLines = new WaternetLineResult[0]; + + // Call + var result = new WaternetCalculatorResult(phreaticLines, waternetLines); + + // Assert + Assert.AreSame(phreaticLines, result.PhreaticLines); + Assert.AreSame(waternetLines, result.WaternetLines); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/Output/WaternetLineResultTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/Output/WaternetLineResultTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/Output/WaternetLineResultTest.cs (revision fc7a77a30ababe1d51f8fd39fa0fa599eb8011cd) @@ -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; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Calculators.Waternet.Output +{ + [TestFixture] + public class WaternetLineResultTest + { + [Test] + public void Constructor_NameNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new WaternetLineResult(null, new Point2D[0], new WaternetPhreaticLineResult("test", new Point2D[0])); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("name", exception.ParamName); + } + + [Test] + public void Constructor_GeometryNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new WaternetLineResult("test", null, new WaternetPhreaticLineResult("test", new Point2D[0])); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("geometry", exception.ParamName); + } + + [Test] + public void Constructor_PhreaticLineNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new WaternetLineResult("test", new Point2D[0], null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("phreaticLine", exception.ParamName); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + const string name = "Line"; + var geometry = new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + }; + var phreaticLine = new WaternetPhreaticLineResult("test", new Point2D[0]); + + // Call + var waternetLine = new WaternetLineResult(name, geometry, phreaticLine); + + // Assert + Assert.AreEqual(name, waternetLine.Name); + Assert.AreSame(geometry, waternetLine.Geometry); + Assert.AreSame(phreaticLine, waternetLine.PhreaticLine); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/Output/WaternetPhreaticLineResultTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/Output/WaternetPhreaticLineResultTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/Output/WaternetPhreaticLineResultTest.cs (revision fc7a77a30ababe1d51f8fd39fa0fa599eb8011cd) @@ -0,0 +1,73 @@ +// 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.KernelWrapper.Calculators.Waternet.Output; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Calculators.Waternet.Output +{ + [TestFixture] + public class WaternetPhreaticLineResultTest + { + [Test] + public void Constructor_NameNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new WaternetPhreaticLineResult(null, new Point2D[0]); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("name", exception.ParamName); + } + + [Test] + public void Constructor_GeometryNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new WaternetPhreaticLineResult("test", null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("geometry", exception.ParamName); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + const string name = "Line"; + var geometry = new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + }; + + // Call + var phreaticLine = new WaternetPhreaticLineResult(name, geometry); + + // Assert + Assert.AreEqual(name, phreaticLine.Name); + Assert.AreSame(geometry, phreaticLine.Geometry); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj =================================================================== diff -u -r0e47d3eddb8f503448a0aae5edf1114202e6e557 -rfc7a77a30ababe1d51f8fd39fa0fa599eb8011cd --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj) (revision 0e47d3eddb8f503448a0aae5edf1114202e6e557) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj) (revision fc7a77a30ababe1d51f8fd39fa0fa599eb8011cd) @@ -78,6 +78,9 @@ + + +