Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Converters/MacroStabilityInwardsWaternetConverter.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Converters/MacroStabilityInwardsWaternetConverter.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Converters/MacroStabilityInwardsWaternetConverter.cs (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -0,0 +1,70 @@ +// 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 System.Linq; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; +using Ringtoets.MacroStabilityInwards.Primitives; + +namespace Ringtoets.MacroStabilityInwards.CalculatedInput.Converters +{ + /// + /// Converter to convert + /// into . + /// + internal static class MacroStabilityInwardsWaternetConverter + { + /// + /// Converts into . + /// + /// The result to convert. + /// The converter + /// Thrown when + /// is null. + public static MacroStabilityInwardsWaternet Convert(WaternetCalculatorResult calculatorResult) + { + if (calculatorResult == null) + { + throw new ArgumentNullException(nameof(calculatorResult)); + } + + IDictionary phreaticLineLookup = calculatorResult.PhreaticLines + .ToDictionary(pl => pl, ConvertPhreaticLine); + + return new MacroStabilityInwardsWaternet(phreaticLineLookup.Values, calculatorResult.WaternetLines + .Select(wl => ConvertWaternetLine(wl, phreaticLineLookup))); + } + + private static MacroStabilityInwardsWaternetLine ConvertWaternetLine(WaternetLineResult waternetLine, + IDictionary phreaticLines) + { + return new MacroStabilityInwardsWaternetLine(waternetLine.Name, + waternetLine.Geometry, + phreaticLines[waternetLine.PhreaticLine]); + } + + private static MacroStabilityInwardsPhreaticLine ConvertPhreaticLine(WaternetPhreaticLineResult phreaticLine) + { + return new MacroStabilityInwardsPhreaticLine(phreaticLine.Name, phreaticLine.Geometry); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Properties/AssemblyInfo.cs =================================================================== diff -u -r999f55a8115ed9277efd65972d64a70d30669904 -r38b96b5fe034945cfa33600ec134e21507b40922 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 999f55a8115ed9277efd65972d64a70d30669904) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -20,8 +20,10 @@ // All rights reserved. using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Ringtoets.MacroStabilityInwards.CalculatedInput")] [assembly: AssemblyProduct("Ringtoets.MacroStabilityInwards.CalculatedInput")] -[assembly: Guid("d0887613-858e-4eed-9320-8c5a09170761")] \ No newline at end of file +[assembly: Guid("d0887613-858e-4eed-9320-8c5a09170761")] +[assembly: InternalsVisibleTo("Ringtoets.MacroStabilityInwards.CalculatedInput.Test")] \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Ringtoets.MacroStabilityInwards.CalculatedInput.csproj =================================================================== diff -u -rcfa7dc2bce5e37f5677d9c8772b68599f9e26a0c -r38b96b5fe034945cfa33600ec134e21507b40922 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Ringtoets.MacroStabilityInwards.CalculatedInput.csproj (.../Ringtoets.MacroStabilityInwards.CalculatedInput.csproj) (revision cfa7dc2bce5e37f5677d9c8772b68599f9e26a0c) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Ringtoets.MacroStabilityInwards.CalculatedInput.csproj (.../Ringtoets.MacroStabilityInwards.CalculatedInput.csproj) (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -41,6 +41,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs =================================================================== diff -u -rb976e43b1c5480a6bcb004c58c307d69ebe9f4a2 -r38b96b5fe034945cfa33600ec134e21507b40922 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs (.../WaternetCalculationService.cs) (revision b976e43b1c5480a6bcb004c58c307d69ebe9f4a2) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs (.../WaternetCalculationService.cs) (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -83,9 +83,15 @@ calculatorInput, MacroStabilityInwardsKernelWrapperFactory.Instance); - WaternetCalculatorResult result = calculator.Calculate(); - - return null; + try + { + WaternetCalculatorResult result = calculator.Calculate(); + return MacroStabilityInwardsWaternetConverter.Convert(result); + } + catch (WaternetCalculatorException) + { + return null; + } } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Converters/MacroStabilityInwardsWaternetConverterTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Converters/MacroStabilityInwardsWaternetConverterTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Converters/MacroStabilityInwardsWaternetConverterTest.cs (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -0,0 +1,60 @@ +// 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.Linq; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.CalculatedInput.Converters; +using Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Calculators.Waternet.Output; +using Ringtoets.MacroStabilityInwards.Primitives; + +namespace Ringtoets.MacroStabilityInwards.CalculatedInput.Test.Converters +{ + [TestFixture] + public class MacroStabilityInwardsWaternetConverterTest + { + [Test] + public void Convert_WaternetCalculatorResultNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => MacroStabilityInwardsWaternetConverter.Convert(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("calculatorResult", exception.ParamName); + } + + [Test] + public void Convert_WithResult_ReturnMacroStabilityInwardsWaternet() + { + // Setup + WaternetCalculatorResult result = WaternetCalculatorResultTestFactory.Create(); + + // Call + MacroStabilityInwardsWaternet converted = MacroStabilityInwardsWaternetConverter.Convert(result); + + // Assert + CalculatorOutputAssert.AssertWaternet(result, converted); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test.csproj =================================================================== diff -u -rb976e43b1c5480a6bcb004c58c307d69ebe9f4a2 -r38b96b5fe034945cfa33600ec134e21507b40922 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test.csproj (.../Ringtoets.MacroStabilityInwards.CalculatedInput.Test.csproj) (revision b976e43b1c5480a6bcb004c58c307d69ebe9f4a2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test.csproj (.../Ringtoets.MacroStabilityInwards.CalculatedInput.Test.csproj) (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -54,6 +54,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/WaternetCalculationServiceTest.cs =================================================================== diff -u -rb976e43b1c5480a6bcb004c58c307d69ebe9f4a2 -r38b96b5fe034945cfa33600ec134e21507b40922 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/WaternetCalculationServiceTest.cs (.../WaternetCalculationServiceTest.cs) (revision b976e43b1c5480a6bcb004c58c307d69ebe9f4a2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/WaternetCalculationServiceTest.cs (.../WaternetCalculationServiceTest.cs) (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -20,15 +20,13 @@ // All rights reserved. using System; -using System.Linq; using NUnit.Framework; using Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.TestUtil; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Input; -using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Calculators; using Ringtoets.MacroStabilityInwards.Primitives; @@ -65,6 +63,43 @@ } } + [Test] + public void CalculateExtreme_CalculationRan_ReturnMacroStabilityInwardsWaternet() + { + // Setup + MacroStabilityInwardsCalculationScenario testCalculation = MacroStabilityInwardsCalculationScenarioFactory.CreateMacroStabilityInwardsCalculationScenarioWithValidInput(); + + using (new MacroStabilityInwardsCalculatorFactoryConfig()) + { + var calculatorFactory = (TestMacroStabilityInwardsCalculatorFactory)MacroStabilityInwardsCalculatorFactory.Instance; + + // Call + MacroStabilityInwardsWaternet output = WaternetCalculationService.CalculateExtreme(testCalculation.InputParameters); + + // Assert + CalculatorOutputAssert.AssertWaternet(calculatorFactory.LastCreatedWaternetCalculator.Output, output); + } + } + + [Test] + public void CalculateExtreme_ErrorInCalculation_ReturnNull() + { + // Setup + MacroStabilityInwardsCalculationScenario testCalculation = MacroStabilityInwardsCalculationScenarioFactory.CreateMacroStabilityInwardsCalculationScenarioWithValidInput(); + + using (new MacroStabilityInwardsCalculatorFactoryConfig()) + { + var calculatorFactory = (TestMacroStabilityInwardsCalculatorFactory)MacroStabilityInwardsCalculatorFactory.Instance; + calculatorFactory.LastCreatedWaternetCalculator.ThrowExceptionOnCalculate = true; + + // Call + MacroStabilityInwardsWaternet output = WaternetCalculationService.CalculateExtreme(testCalculation.InputParameters); + + // Assert + Assert.IsNull(output); + } + } + private static void AssertInput(IMacroStabilityInwardsWaternetInput originalInput, TestMacroStabilityInwardsCalculatorFactory factory) { WaternetCalculatorInput actualInput = factory.LastCreatedWaternetCalculator.Input; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/CalculatorInputAssert.cs =================================================================== diff -u -rb976e43b1c5480a6bcb004c58c307d69ebe9f4a2 -r38b96b5fe034945cfa33600ec134e21507b40922 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/CalculatorInputAssert.cs (.../CalculatorInputAssert.cs) (revision b976e43b1c5480a6bcb004c58c307d69ebe9f4a2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/CalculatorInputAssert.cs (.../CalculatorInputAssert.cs) (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -27,7 +27,7 @@ namespace Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil { /// - /// Class for asserting Uplift Van calculator input. + /// Class for asserting calculator input. /// public static class CalculatorInputAssert { Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/CalculatorOutputAssert.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/CalculatorOutputAssert.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/CalculatorOutputAssert.cs (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -0,0 +1,65 @@ +// 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.Linq; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; +using Ringtoets.MacroStabilityInwards.Primitives; + +namespace Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil +{ + /// + /// Class for asserting calculator output. + /// + public static class CalculatorOutputAssert + { + /// + /// Asserts whether corresponds to . + /// + /// The original . + /// The actual . + /// Thrown when + /// does not correspond to . + public static void AssertWaternet(WaternetCalculatorResult original, MacroStabilityInwardsWaternet actual) + { + WaternetPhreaticLineResult[] originalPhreaticLines = original.PhreaticLines.ToArray(); + WaternetLineResult[] originalWaternetLines = original.WaternetLines.ToArray(); + MacroStabilityInwardsPhreaticLine[] actualPhreaticLines = actual.PhreaticLines.ToArray(); + MacroStabilityInwardsWaternetLine[] actualWaternetLines = actual.WaternetLines.ToArray(); + + Assert.AreEqual(originalPhreaticLines.Length, actualPhreaticLines.Length); + Assert.AreEqual(originalWaternetLines.Length, actualWaternetLines.Length); + + for (var i = 0; i < originalPhreaticLines.Length; i++) + { + Assert.AreEqual(originalPhreaticLines[i].Name, actualPhreaticLines[i].Name); + CollectionAssert.AreEqual(originalPhreaticLines[i].Geometry, actualPhreaticLines[i].Geometry); + } + + for (var i = 0; i < originalWaternetLines.Length; i++) + { + Assert.AreEqual(originalWaternetLines[i].Name, actualWaternetLines[i].Name); + CollectionAssert.AreEqual(originalWaternetLines[i].Geometry, actualWaternetLines[i].Geometry); + Assert.AreEqual(originalWaternetLines[i].PhreaticLine.Name, actualWaternetLines[i].PhreaticLine.Name); + } + } + } +} Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil.csproj =================================================================== diff -u -rb976e43b1c5480a6bcb004c58c307d69ebe9f4a2 -r38b96b5fe034945cfa33600ec134e21507b40922 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil.csproj) (revision b976e43b1c5480a6bcb004c58c307d69ebe9f4a2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil/Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil.csproj) (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -50,6 +50,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Calculators/Waternet/Output/WaternetCalculatorResultTestFactoryTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Calculators/Waternet/Output/WaternetCalculatorResultTestFactoryTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Calculators/Waternet/Output/WaternetCalculatorResultTestFactoryTest.cs (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -0,0 +1,65 @@ +// 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.Collections.Generic; +using System.Linq; +using Core.Common.Base.Geometry; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Calculators.Waternet.Output; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.Calculators.Waternet.Output +{ + [TestFixture] + public class WaternetCalculatorResultTestFactoryTest + { + [Test] + public void Create_Always_ReturnWaternetCalculatorResult() + { + // Call + WaternetCalculatorResult result = WaternetCalculatorResultTestFactory.Create(); + + // Assert + WaternetPhreaticLineResult[] phreaticLines = result.PhreaticLines.ToArray(); + WaternetLineResult[] waternetLines = result.WaternetLines.ToArray(); + Assert.AreEqual(1, phreaticLines.Length); + Assert.AreEqual(1, waternetLines.Length); + + WaternetPhreaticLineResult phreaticLine = phreaticLines[0]; + + Assert.AreEqual("Line 1", phreaticLine.Name); + CollectionAssert.AreEqual(new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + }, phreaticLine.Geometry); + + WaternetLineResult waternetLine = waternetLines[0]; + Assert.AreEqual("Line 2", waternetLine.Name); + CollectionAssert.AreEqual(new[] + { + new Point2D(2, 2), + new Point2D(3, 3) + }, waternetLine.Geometry); + Assert.AreSame(phreaticLine, waternetLine.PhreaticLine); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj =================================================================== diff -u -r0c1db0b8d8ed69192d22aa164be95f2c6c21aaf2 -r38b96b5fe034945cfa33600ec134e21507b40922 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj) (revision 0c1db0b8d8ed69192d22aa164be95f2c6c21aaf2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj) (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -59,6 +59,7 @@ + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/Waternet/Input/WaternetCalculatorInputTestFactory.cs =================================================================== diff -u -r4061c28197adfa0f3dc171c74fbe300ecb3a89c4 -r38b96b5fe034945cfa33600ec134e21507b40922 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/Waternet/Input/WaternetCalculatorInputTestFactory.cs (.../WaternetCalculatorInputTestFactory.cs) (revision 4061c28197adfa0f3dc171c74fbe300ecb3a89c4) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/Waternet/Input/WaternetCalculatorInputTestFactory.cs (.../WaternetCalculatorInputTestFactory.cs) (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -34,6 +34,10 @@ /// public static class WaternetCalculatorInputTestFactory { + /// + /// Creates a new . + /// + /// The created . public static WaternetCalculatorInput CreateCompleteCalculatorInput() { var random = new Random(21); @@ -63,6 +67,10 @@ }); } + /// + /// Creates a new . + /// + /// The created . public static WaternetCalculatorInput CreateValidCalculatorInput() { MacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLine(); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/Waternet/Output/WaternetCalculatorResultTestFactory.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/Waternet/Output/WaternetCalculatorResultTestFactory.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/Waternet/Output/WaternetCalculatorResultTestFactory.cs (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -0,0 +1,57 @@ +// 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.Geometry; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Calculators.Waternet.Output +{ + /// + /// Factory to create simple instances that can be used for testing. + /// + public static class WaternetCalculatorResultTestFactory + { + /// + /// Creates a new . + /// + /// The created . + public static WaternetCalculatorResult Create() + { + var phreaticLine = new WaternetPhreaticLineResult("Line 1", new [] + { + new Point2D(0, 0), + new Point2D(1, 1) + }); + + return new WaternetCalculatorResult(new[] + { + phreaticLine + }, new[] + { + new WaternetLineResult("Line 2", new[] + { + new Point2D(2, 2), + new Point2D(3, 3) + }, phreaticLine) + }); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj =================================================================== diff -u -r0c1db0b8d8ed69192d22aa164be95f2c6c21aaf2 -r38b96b5fe034945cfa33600ec134e21507b40922 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj) (revision 0c1db0b8d8ed69192d22aa164be95f2c6c21aaf2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj) (revision 38b96b5fe034945cfa33600ec134e21507b40922) @@ -64,6 +64,7 @@ +