Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SlipPlaneUpliftVanCreator.cs =================================================================== diff -u -r177ec6713fcf4dbdbc5fd2a542fb7bfa6554e1ff -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SlipPlaneUpliftVanCreator.cs (.../SlipPlaneUpliftVanCreator.cs) (revision 177ec6713fcf4dbdbc5fd2a542fb7bfa6554e1ff) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SlipPlaneUpliftVanCreator.cs (.../SlipPlaneUpliftVanCreator.cs) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -26,13 +26,13 @@ namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Creators { /// - /// Creates instances which are required by the . + /// Creates instances which are required by the . /// internal static class SlipPlaneUpliftVanCreator { /// /// Creates a based on the given , - /// which can be used in the . + /// which can be used in the . /// /// The to get the information from. /// A new with the given information from . Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SoilCreator.cs =================================================================== diff -u -r1d6eb4a980508dc55fca5a225fe777c7fd3cbd2e -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SoilCreator.cs (.../SoilCreator.cs) (revision 1d6eb4a980508dc55fca5a225fe777c7fd3cbd2e) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SoilCreator.cs (.../SoilCreator.cs) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -29,13 +29,13 @@ namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Creators { /// - /// Creates instances which are required by the . + /// Creates instances which are required by the . /// internal static class SoilCreator { /// /// Creates a based on information contained in the profile , - /// which can be used in the . + /// which can be used in the . /// /// The from /// which to take the information. Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SoilModelCreator.cs =================================================================== diff -u -rc62200ea10d37435621c8f3387c78dc911b6b7e2 -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SoilModelCreator.cs (.../SoilModelCreator.cs) (revision c62200ea10d37435621c8f3387c78dc911b6b7e2) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SoilModelCreator.cs (.../SoilModelCreator.cs) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -26,13 +26,13 @@ namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Creators { /// - /// Creates instances which are required by the . + /// Creates instances which are required by the . /// internal static class SoilModelCreator { /// /// Creates a with the given - /// which can be used in the . + /// which can be used in the . /// /// The array of to use in the . /// A new with the . Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SoilProfileCreator.cs =================================================================== diff -u -r47b5ca393079360a5050b63f9eb4a074345d9f2f -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SoilProfileCreator.cs (.../SoilProfileCreator.cs) (revision 47b5ca393079360a5050b63f9eb4a074345d9f2f) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SoilProfileCreator.cs (.../SoilProfileCreator.cs) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -31,13 +31,13 @@ namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Creators { /// - /// Creates instances which are required by the . + /// Creates instances which are required by the . /// internal static class SoilProfileCreator { /// /// Creates a with the given - /// which can be used in the . + /// which can be used in the . /// /// The soil profile to create the for. /// The data to use in the . Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/StabilityLocationCreator.cs =================================================================== diff -u -r0e2f8ccdf96680a356758e91336a384e0638e7af -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/StabilityLocationCreator.cs (.../StabilityLocationCreator.cs) (revision 0e2f8ccdf96680a356758e91336a384e0638e7af) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/StabilityLocationCreator.cs (.../StabilityLocationCreator.cs) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -28,13 +28,13 @@ namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Creators { /// - /// Creates instances which are required by the . + /// Creates instances which are required by the . /// internal static class StabilityLocationCreator { /// /// Creates a based on the given , - /// which can be used in the . + /// which can be used in the . /// /// The to get the information from. /// A new with the given information from . Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SurfaceLineCreator.cs =================================================================== diff -u -r47b5ca393079360a5050b63f9eb4a074345d9f2f -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SurfaceLineCreator.cs (.../SurfaceLineCreator.cs) (revision 47b5ca393079360a5050b63f9eb4a074345d9f2f) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/SurfaceLineCreator.cs (.../SurfaceLineCreator.cs) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -29,13 +29,13 @@ namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Creators { /// - /// Creates instances which are required by the . + /// Creates instances which are required by the . /// internal static class SurfaceLineCreator { /// /// Creates a based on information of , - /// which can be used in the . + /// which can be used in the . /// /// The from /// which to take the information. Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Kernel/IUpliftVanKernel.cs =================================================================== diff -u -ra818b067c89f222fa27f864ef9b0c26ba95f40d8 -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Kernel/IUpliftVanKernel.cs (.../IUpliftVanKernel.cs) (revision a818b067c89f222fa27f864ef9b0c26ba95f40d8) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Kernel/IUpliftVanKernel.cs (.../IUpliftVanKernel.cs) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -30,8 +30,8 @@ /// /// This interface is introduced for being able to test the conversion of: /// - /// input into kernel input; - /// kernel output into output. + /// input into kernel input; + /// kernel output into output. /// /// public interface IUpliftVanKernel Fisheye: Tag 5278b82071883876afcaa601e722f564c5815aab refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorFactory.cs =================================================================== diff -u -rd6c2f6364fcba038152ea93e0e420e03989dd35a -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorFactory.cs (.../MacroStabilityInwardsCalculatorFactory.cs) (revision d6c2f6364fcba038152ea93e0e420e03989dd35a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorFactory.cs (.../MacroStabilityInwardsCalculatorFactory.cs) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -48,7 +48,7 @@ public IUpliftVanCalculator CreateCalculator(MacroStabilityInwardsCalculatorInput input, IMacroStabilityInwardsKernelFactory factory) { - return new MacroStabilityInwardsCalculator(input, factory); + return new UpliftVanCalculator(input, factory); } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj =================================================================== diff -u -rd6c2f6364fcba038152ea93e0e420e03989dd35a -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.csproj) (revision d6c2f6364fcba038152ea93e0e420e03989dd35a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.csproj) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -49,7 +49,7 @@ - + Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/UpliftVanCalculator.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/UpliftVanCalculator.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/UpliftVanCalculator.cs (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -0,0 +1,132 @@ +// 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 Deltares.WTIStability.Data.Geo; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Creators; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernel; +using Ringtoets.MacroStabilityInwards.Primitives.MacroStabilityInwardsSoilUnderSurfaceLine; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper +{ + /// + /// Class representing an Uplift Van calculator. + /// + public class UpliftVanCalculator : IUpliftVanCalculator + { + private readonly MacroStabilityInwardsCalculatorInput input; + private readonly IMacroStabilityInwardsKernelFactory factory; + + /// + /// Creates a new instance of . + /// + /// The containing all the values required + /// for performing the Uplift Van calculation. + /// The factory responsible for creating the Uplift Van kernel. + /// Thrown when or is null. + public UpliftVanCalculator(MacroStabilityInwardsCalculatorInput input, IMacroStabilityInwardsKernelFactory factory) + { + if (input == null) + { + throw new ArgumentNullException(nameof(input), @"MacroStabilityInwardsCalculatorInput required for creating a MacroStabilityInwardsCalculator."); + } + if (factory == null) + { + throw new ArgumentNullException(nameof(factory), @"IMacroStabilityInwardsSubCalculatorFactory required for creating a MacroStabilityInwardsCalculator."); + } + this.input = input; + this.factory = factory; + } + + public MacroStabilityInwardsCalculatorResult Calculate() + { + IUpliftVanKernel upliftVanKernel = CalculateUpliftVan(); + + return new MacroStabilityInwardsCalculatorResult( + MacroStabilityInwardsSlidingCurveResultCreator.Create(upliftVanKernel.SlidingCurveResult), + MacroStabilityInwardsUpliftVanCalculationGridResultCreator.Create(upliftVanKernel.SlipPlaneResult), + new MacroStabilityInwardsCalculatorResult.ConstructionProperties + { + FactorOfStability = upliftVanKernel.FactoryOfStability, + ZValue = upliftVanKernel.ZValue, + ForbiddenZonesXEntryMin = upliftVanKernel.ForbiddenZonesXEntryMin, + ForbiddenZonesXEntryMax = upliftVanKernel.ForbiddenZonesXEntryMax, + ForbiddenZonesAutomaticallyCalculated = upliftVanKernel.ForbiddenZonesAutomaticallyCalculated, + GridAutomaticallyCalculated = upliftVanKernel.GridAutomaticallyCalculated + }); + } + + public List Validate() + { + return new List(); + } + + private IUpliftVanKernel CalculateUpliftVan() + { + IUpliftVanKernel upliftVanKernel = CreateUpliftVanKernel(); + + try + { + upliftVanKernel.Calculate(); + } + catch (Exception e) + { + // Temporary do nothing + } + + return upliftVanKernel; + } + + private IUpliftVanKernel CreateUpliftVanKernel() + { + IUpliftVanKernel upliftVanKernel = factory.CreateUpliftVanKernel(); + + upliftVanKernel.MoveGrid = input.MoveGrid; + upliftVanKernel.MaximumSliceWidth = input.MaximumSliceWidth; + + Soil[] soils = SoilCreator.Create(input.SoilProfile); + upliftVanKernel.SoilModel = SoilModelCreator.Create(soils); + + Dictionary layersWithSoils = + input.SoilProfile.Layers + .Zip(soils, (layer, soil) => new + { + layer, + soil + }) + .ToDictionary(x => x.layer, x => x.soil); + + upliftVanKernel.SoilProfile = SoilProfileCreator.Create(input.SoilProfile, layersWithSoils); + upliftVanKernel.Location = StabilityLocationCreator.Create(input); + upliftVanKernel.SurfaceLine = SurfaceLineCreator.Create(input.SurfaceLine); + upliftVanKernel.SlipPlaneUpliftVan = SlipPlaneUpliftVanCreator.Create(input); + upliftVanKernel.GridAutomaticDetermined = input.GridAutomaticDetermined; + upliftVanKernel.CreateZones = input.CreateZones; + upliftVanKernel.AutomaticForbiddenZones = input.AutomaticForbiddenZones; + upliftVanKernel.SlipPlaneMinimumDepth = input.SlipPlaneMinimumDepth; + upliftVanKernel.SlipPlaneMinimumLength = input.SlipPlaneMinimumLength; + + return upliftVanKernel; + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs =================================================================== diff -u -rd6c2f6364fcba038152ea93e0e420e03989dd35a -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs (.../MacroStabilityInwardsCalculationService.cs) (revision d6c2f6364fcba038152ea93e0e420e03989dd35a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs (.../MacroStabilityInwardsCalculationService.cs) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -34,7 +34,7 @@ namespace Ringtoets.MacroStabilityInwards.Service { /// - /// This class is responsible for invoking operations on the . Error and status information is + /// This class is responsible for invoking operations on the . Error and status information is /// logged during the execution of the operation. /// public static class MacroStabilityInwardsCalculationService Fisheye: Tag 5278b82071883876afcaa601e722f564c5815aab refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj =================================================================== diff -u -ra818b067c89f222fa27f864ef9b0c26ba95f40d8 -r5278b82071883876afcaa601e722f564c5815aab --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj) (revision a818b067c89f222fa27f864ef9b0c26ba95f40d8) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj) (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -66,7 +66,7 @@ - + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/UpliftVanCalculatorTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/UpliftVanCalculatorTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/UpliftVanCalculatorTest.cs (revision 5278b82071883876afcaa601e722f564c5815aab) @@ -0,0 +1,200 @@ +// 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 Core.Common.Base.Geometry; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Creators; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernel; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Kernel; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Result; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.MacroStabilityInwards.Primitives.MacroStabilityInwardsSoilUnderSurfaceLine; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test +{ + [TestFixture] + public class UpliftVanCalculatorTest + { + [Test] + public void Constructor_WithoutInput_ArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var factory = mocks.Stub(); + mocks.ReplayAll(); + + // Call + TestDelegate call = () => new UpliftVanCalculator(null, factory); + + // Assert + const string expectedMessage = "MacroStabilityInwardsCalculatorInput required for creating a MacroStabilityInwardsCalculator."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); + mocks.VerifyAll(); + } + + [Test] + public void Constructor_FactoryNull_ArgumentNullException() + { + // Call + var input = new MacroStabilityInwardsCalculatorInput(CreateSimpleConstructionProperties()); + TestDelegate call = () => new UpliftVanCalculator(input, null); + + // Assert + const string expectedMessage = "IMacroStabilityInwardsSubCalculatorFactory required for creating a MacroStabilityInwardsCalculator."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var mocks = new MockRepository(); + var factory = mocks.Stub(); + mocks.ReplayAll(); + + var input = new MacroStabilityInwardsCalculatorInput(CreateSimpleConstructionProperties()); + + // Call + var calculator = new UpliftVanCalculator(input, factory); + + // Assert + Assert.IsInstanceOf(calculator); + } + + [Test] + public void Calculate_CompleteValidInput_ReturnsResult() + { + // Setup + var random = new Random(11); + + var input = new MacroStabilityInwardsCalculatorInput(CreateSimpleConstructionProperties()); + var testMacroStabilityInwardsKernelFactory = new TestMacroStabilityInwardsKernelFactory(); + UpliftVanKernelStub upliftVanKernel = testMacroStabilityInwardsKernelFactory.LastCreatedUpliftVanKernel; + upliftVanKernel.FactoryOfStability = random.NextDouble(); + upliftVanKernel.ZValue = random.NextDouble(); + upliftVanKernel.ForbiddenZonesXEntryMax = random.NextDouble(); + upliftVanKernel.ForbiddenZonesXEntryMin = random.NextDouble(); + upliftVanKernel.ForbiddenZonesAutomaticallyCalculated = random.NextBoolean(); + upliftVanKernel.GridAutomaticallyCalculated = random.NextBoolean(); + upliftVanKernel.SlidingCurveResult = SlidingDualCircleTestFactory.Create(); + upliftVanKernel.SlipPlaneResult = SlipPlaneUpliftVanTestFactory.Create(); + + // Call + MacroStabilityInwardsCalculatorResult actual = new UpliftVanCalculator(input, testMacroStabilityInwardsKernelFactory).Calculate(); + + // Assert + Assert.IsNotNull(actual); + Assert.AreEqual(upliftVanKernel.FactoryOfStability, actual.FactorOfStability); + Assert.AreEqual(upliftVanKernel.ZValue, actual.ZValue); + Assert.AreEqual(upliftVanKernel.ForbiddenZonesXEntryMax, actual.ForbiddenZonesXEntryMax); + Assert.AreEqual(upliftVanKernel.ForbiddenZonesXEntryMin, actual.ForbiddenZonesXEntryMin); + Assert.AreEqual(upliftVanKernel.ForbiddenZonesAutomaticallyCalculated, actual.ForbiddenZonesAutomaticallyCalculated); + Assert.AreEqual(upliftVanKernel.GridAutomaticallyCalculated, actual.GridAutomaticallyCalculated); + MacroStabilityInwardsCalculatorResultHelper.AssertSlidingCurve(MacroStabilityInwardsSlidingCurveResultCreator.Create(upliftVanKernel.SlidingCurveResult), + actual.SlidingCurve); + MacroStabilityInwardsCalculatorResultHelper.AssertSlipPlaneGrid(MacroStabilityInwardsUpliftVanCalculationGridResultCreator.Create(upliftVanKernel.SlipPlaneResult), + actual.UpliftVanCalculationGrid); + + Assert.IsTrue(testMacroStabilityInwardsKernelFactory.LastCreatedUpliftVanKernel.Calculated); + } + + [Test] + public void Validate_Always_ReturnEmptyList() + { + // Setup + var input = new MacroStabilityInwardsCalculatorInput(CreateSimpleConstructionProperties()); + var testMacroStabilityInwardsSubCalculatorFactory = new TestMacroStabilityInwardsKernelFactory(); + + // Call + List validationResult = new UpliftVanCalculator(input, testMacroStabilityInwardsSubCalculatorFactory).Validate(); + + // Assert + CollectionAssert.IsEmpty(validationResult); + } + + private static MacroStabilityInwardsCalculatorInput.ConstructionProperties CreateSimpleConstructionProperties() + { + var random = new Random(21); + + MacroStabilityInwardsSurfaceLine surfaceLine = CreateValidSurfaceLine(); + return new MacroStabilityInwardsCalculatorInput.ConstructionProperties + { + AssessmentLevel = random.NextDouble(), + SurfaceLine = surfaceLine, + SoilProfile = CreateValidSoilProfile(surfaceLine), + LeftGrid = new MacroStabilityInwardsGrid(), + RightGrid = new MacroStabilityInwardsGrid() + }; + } + + private static MacroStabilityInwardsSoilProfileUnderSurfaceLine CreateValidSoilProfile(MacroStabilityInwardsSurfaceLine surfaceLine) + { + return new MacroStabilityInwardsSoilProfileUnderSurfaceLine(new[] + { + new MacroStabilityInwardsSoilLayerUnderSurfaceLine(new[] + { + surfaceLine.LocalGeometry.First(), + surfaceLine.LocalGeometry.Last() + + }, new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine(new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine.ConstructionProperties())), + new MacroStabilityInwardsSoilLayerUnderSurfaceLine(new[] + { + surfaceLine.LocalGeometry.First(), + surfaceLine.LocalGeometry.Last() + + }, new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine(new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine.ConstructionProperties + { + IsAquifer = true + })), + new MacroStabilityInwardsSoilLayerUnderSurfaceLine(new[] + { + surfaceLine.LocalGeometry.First(), + surfaceLine.LocalGeometry.Last() + + }, new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine(new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine.ConstructionProperties())), + new MacroStabilityInwardsSoilLayerUnderSurfaceLine(new[] + { + surfaceLine.LocalGeometry.First(), + surfaceLine.LocalGeometry.Last() + + }, new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine(new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine.ConstructionProperties())), + }, Enumerable.Empty()); + } + + private static MacroStabilityInwardsSurfaceLine CreateValidSurfaceLine() + { + var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty); + surfaceLine.SetGeometry(new[] + { + new Point3D(0, 0, 2), + new Point3D(1, 0, 8), + new Point3D(2, 0, -1) + }); + return surfaceLine; + } + } +} \ No newline at end of file