Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Kernel/MacroStabilityInwardsKernelWrapperFactory.cs =================================================================== diff -u -ra818b067c89f222fa27f864ef9b0c26ba95f40d8 -r83f824a69b1a78fc4822ac19375e60e6c9be7d87 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Kernel/MacroStabilityInwardsKernelWrapperFactory.cs (.../MacroStabilityInwardsKernelWrapperFactory.cs) (revision a818b067c89f222fa27f864ef9b0c26ba95f40d8) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Kernel/MacroStabilityInwardsKernelWrapperFactory.cs (.../MacroStabilityInwardsKernelWrapperFactory.cs) (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -22,7 +22,7 @@ namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Kernel { /// - /// Factory that creates kernels that wrap the macro stability inwards kernel. + /// Factory that creates kernels that wrap the WTI macro stability inwards kernel. /// public class MacroStabilityInwardsKernelWrapperFactory : IMacroStabilityInwardsKernelFactory { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs =================================================================== diff -u -ra818b067c89f222fa27f864ef9b0c26ba95f40d8 -r83f824a69b1a78fc4822ac19375e60e6c9be7d87 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs (.../MacroStabilityInwardsCalculator.cs) (revision a818b067c89f222fa27f864ef9b0c26ba95f40d8) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs (.../MacroStabilityInwardsCalculator.cs) (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -101,13 +101,13 @@ private IUpliftVanKernel CreateUpliftVanKernel() { - IUpliftVanKernel calculator = factory.CreateUpliftVanKernel(); + IUpliftVanKernel upliftVanKernel = factory.CreateUpliftVanKernel(); - calculator.MoveGrid = input.MoveGrid; - calculator.MaximumSliceWidth = input.MaximumSliceWidth; + upliftVanKernel.MoveGrid = input.MoveGrid; + upliftVanKernel.MaximumSliceWidth = input.MaximumSliceWidth; Soil[] soils = SoilCreator.Create(input.SoilProfile); - calculator.SoilModel = SoilModelCreator.Create(soils); + upliftVanKernel.SoilModel = SoilModelCreator.Create(soils); Dictionary layersWithSoils = input.SoilProfile.Layers @@ -118,17 +118,17 @@ }) .ToDictionary(x => x.layer, x => x.soil); - calculator.SoilProfile = SoilProfileCreator.Create(input.SoilProfile, layersWithSoils); - calculator.Location = StabilityLocationCreator.Create(input); - calculator.SurfaceLine = SurfaceLineCreator.Create(input.SurfaceLine); - calculator.SlipPlaneUpliftVan = SlipPlaneUpliftVanCreator.Create(input); - calculator.GridAutomaticDetermined = input.GridAutomaticDetermined; - calculator.CreateZones = input.CreateZones; - calculator.AutomaticForbiddenZones = input.AutomaticForbiddenZones; - calculator.SlipPlaneMinimumDepth = input.SlipPlaneMinimumDepth; - calculator.SlipPlaneMinimumLength = input.SlipPlaneMinimumLength; + 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 calculator; + return upliftVanKernel; } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Kernel/MacroStabilityInwardsKernelWrapperFactoryTest.cs =================================================================== diff -u -ra818b067c89f222fa27f864ef9b0c26ba95f40d8 -r83f824a69b1a78fc4822ac19375e60e6c9be7d87 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Kernel/MacroStabilityInwardsKernelWrapperFactoryTest.cs (.../MacroStabilityInwardsKernelWrapperFactoryTest.cs) (revision a818b067c89f222fa27f864ef9b0c26ba95f40d8) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Kernel/MacroStabilityInwardsKernelWrapperFactoryTest.cs (.../MacroStabilityInwardsKernelWrapperFactoryTest.cs) (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -21,7 +21,7 @@ using NUnit.Framework; using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernel; -using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.SubCalculator; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Kernel; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Kernel { @@ -67,7 +67,7 @@ } [Test] - public void CreateUpliftVanKernel_Always_ReturnsUpliftVanKernel() + public void CreateUpliftVanKernel_Always_ReturnsUpliftVanKernelWrapper() { // Setup IMacroStabilityInwardsKernelFactory factory = MacroStabilityInwardsKernelWrapperFactory.Instance; @@ -76,7 +76,7 @@ IUpliftVanKernel upliftVanKernel = factory.CreateUpliftVanKernel(); // Assert - Assert.IsNotNull(upliftVanKernel); + Assert.IsInstanceOf(upliftVanKernel); } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs =================================================================== diff -u -ra818b067c89f222fa27f864ef9b0c26ba95f40d8 -r83f824a69b1a78fc4822ac19375e60e6c9be7d87 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs (.../MacroStabilityInwardsCalculatorTest.cs) (revision a818b067c89f222fa27f864ef9b0c26ba95f40d8) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs (.../MacroStabilityInwardsCalculatorTest.cs) (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -29,8 +29,8 @@ 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.KernelWrapper.TestUtil.SubCalculator; using Ringtoets.MacroStabilityInwards.Primitives; using Ringtoets.MacroStabilityInwards.Primitives.MacroStabilityInwardsSoilUnderSurfaceLine; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Kernel/MacroStabilityInwardsSubCalculatorFactoryConfigTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Kernel/MacroStabilityInwardsSubCalculatorFactoryConfigTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Kernel/MacroStabilityInwardsSubCalculatorFactoryConfigTest.cs (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -0,0 +1,67 @@ +// 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.Kernel; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Kernel; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.Kernel +{ + [TestFixture] + public class MacroStabilityInwardsSubCalculatorFactoryConfigTest + { + [Test] + public void Constructor_NewInstanceCanBeDisposed() + { + // Call + var factory = new MacroStabilityInwardsSubCalculatorFactoryConfig(); + + // Assert + Assert.IsInstanceOf(factory); + Assert.DoesNotThrow(() => factory.Dispose()); + } + + [Test] + public void Constructor_SetsTestFactoryForMacroStabilityInwardsCalculatorService() + { + // Call + using (new MacroStabilityInwardsSubCalculatorFactoryConfig()) + { + // Assert + Assert.IsInstanceOf(MacroStabilityInwardsKernelWrapperFactory.Instance); + } + } + + [Test] + public void Dispose_Always_ResetsFactoryToPreviousValue() + { + // Setup + IMacroStabilityInwardsKernelFactory expectedFactory = MacroStabilityInwardsKernelWrapperFactory.Instance; + + // Call + using (new MacroStabilityInwardsSubCalculatorFactoryConfig()) {} + + // Assert + Assert.AreSame(expectedFactory, MacroStabilityInwardsKernelWrapperFactory.Instance); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Kernel/TestMacroStabilityInwardsKernelFactoryTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Kernel/TestMacroStabilityInwardsKernelFactoryTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Kernel/TestMacroStabilityInwardsKernelFactoryTest.cs (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -0,0 +1,55 @@ +// 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 NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernel; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Kernel; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.Kernel +{ + [TestFixture] + public class TestMacroStabilityInwardsKernelFactoryTest + { + [Test] + public void Constructor_ExpectedProperties() + { + // Call + var factory = new TestMacroStabilityInwardsKernelFactory(); + + // Assert + Assert.IsInstanceOf(factory); + Assert.IsNotNull(factory.LastCreatedUpliftVanKernel); + } + + [Test] + public void CreateUpliftVanKernel_Always_ReturnLastCreatedUpliftVanKernel() + { + // Setup + var factory = new TestMacroStabilityInwardsKernelFactory(); + + // Call + IUpliftVanKernel upliftVanKernel = factory.CreateUpliftVanKernel(); + + // Assert + Assert.AreSame(factory.LastCreatedUpliftVanKernel, upliftVanKernel); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Kernel/UpliftVanKernelStubTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Kernel/UpliftVanKernelStubTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Kernel/UpliftVanKernelStubTest.cs (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -0,0 +1,56 @@ +// 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 NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Kernel; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.Kernel +{ + [TestFixture] + public class UpliftVanKernelStubTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Call + var kernel = new UpliftVanKernelStub(); + + // Assert + Assert.IsFalse(kernel.Calculated); + } + + [Test] + public void Calculate_Always_SetCalculatedTrue() + { + // Setup + var kernel = new UpliftVanKernelStub(); + + // Precondition + Assert.IsFalse(kernel.Calculated); + + // Call + kernel.Calculate(); + + // Assert + Assert.IsTrue(kernel.Calculated); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj =================================================================== diff -u -rdc76c02e3487559413087637935f008147927ea0 -r83f824a69b1a78fc4822ac19375e60e6c9be7d87 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj) (revision dc76c02e3487559413087637935f008147927ea0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj) (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -58,10 +58,10 @@ - + - - + + Fisheye: Tag 83f824a69b1a78fc4822ac19375e60e6c9be7d87 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/SubCalculator/MacroStabilityInwardsSubCalculatorFactoryConfigTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 83f824a69b1a78fc4822ac19375e60e6c9be7d87 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/SubCalculator/TestMacroStabilityInwardsKernelFactoryTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 83f824a69b1a78fc4822ac19375e60e6c9be7d87 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/SubCalculator/UpliftVanKernelStubTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/TestMacroStabilityInwardsCalculatorFactoryTest.cs =================================================================== diff -u -r90e819fbef3e545d8b192653668e9a92b5a0d350 -r83f824a69b1a78fc4822ac19375e60e6c9be7d87 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/TestMacroStabilityInwardsCalculatorFactoryTest.cs (.../TestMacroStabilityInwardsCalculatorFactoryTest.cs) (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/TestMacroStabilityInwardsCalculatorFactoryTest.cs (.../TestMacroStabilityInwardsCalculatorFactoryTest.cs) (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -20,7 +20,7 @@ // All rights reserved. using NUnit.Framework; -using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.SubCalculator; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Kernel; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test { Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernel/MacroStabilityInwardsSubCalculatorFactoryConfig.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernel/MacroStabilityInwardsSubCalculatorFactoryConfig.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernel/MacroStabilityInwardsSubCalculatorFactoryConfig.cs (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -0,0 +1,67 @@ +// 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 Ringtoets.MacroStabilityInwards.KernelWrapper.Kernel; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Kernel +{ + /// + /// This class can be used to set a temporary + /// for while testing. + /// Disposing an instance of this class will revert the + /// . + /// + /// + /// The following is an example for how to use this class: + /// + /// using(new MacroStabilityInwardsCalculationServiceConfig()) { + /// var testFactory = (TestMacroStabilityInwardsSubCalculatorFactory) MacroStabilityInwardsCalculationService.SubCalculatorFactory; + /// + /// // Perform tests with testFactory + /// } + /// + /// + public class MacroStabilityInwardsSubCalculatorFactoryConfig : IDisposable + { + private readonly IMacroStabilityInwardsKernelFactory previousFactory; + + /// + /// Creates a new instance of . + /// Sets a to + /// + /// + public MacroStabilityInwardsSubCalculatorFactoryConfig() + { + previousFactory = MacroStabilityInwardsKernelWrapperFactory.Instance; + MacroStabilityInwardsKernelWrapperFactory.Instance = new TestMacroStabilityInwardsKernelFactory(); + } + + /// + /// Reverts the to the value + /// it had at time of construction of the . + /// + public void Dispose() + { + MacroStabilityInwardsKernelWrapperFactory.Instance = previousFactory; + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernel/TestMacroStabilityInwardsKernelFactory.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernel/TestMacroStabilityInwardsKernelFactory.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernel/TestMacroStabilityInwardsKernelFactory.cs (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -0,0 +1,49 @@ +// 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 Ringtoets.MacroStabilityInwards.KernelWrapper.Kernel; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Kernel +{ + /// + /// Factory that creates macro stability inwards kernels that can be used for testing purposes. + /// + public class TestMacroStabilityInwardsKernelFactory : IMacroStabilityInwardsKernelFactory + { + /// + /// Creates a new instance of . + /// + public TestMacroStabilityInwardsKernelFactory() + { + LastCreatedUpliftVanKernel = new UpliftVanKernelStub(); + } + + /// + /// The last created Uplift Van kernel. + /// + public UpliftVanKernelStub LastCreatedUpliftVanKernel { get; } + + public IUpliftVanKernel CreateUpliftVanKernel() + { + return LastCreatedUpliftVanKernel; + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernel/UpliftVanKernelStub.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernel/UpliftVanKernelStub.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernel/UpliftVanKernelStub.cs (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -0,0 +1,83 @@ +// 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 Deltares.WTIStability; +using Deltares.WTIStability.Data.Geo; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernel; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Kernel +{ + /// + /// Class that represents an Uplift Van kernel stub. + /// + public class UpliftVanKernelStub : IUpliftVanKernel + { + /// + /// Gets a value indicating whether was called or not. + /// + public bool Calculated { get; private set; } + + public SoilModel SoilModel { get; set; } + + public SoilProfile2D SoilProfile { get; set; } + + public StabilityLocation Location { get; set; } + + public bool MoveGrid { get; set; } + + public double MaximumSliceWidth { get; set; } + + public SurfaceLine2 SurfaceLine { get; set; } + + public SlipPlaneUpliftVan SlipPlaneUpliftVan { get; set; } + + public bool GridAutomaticDetermined { get; set; } + + public bool CreateZones { get; set; } + + public bool AutomaticForbiddenZones { get; set; } + + public double SlipPlaneMinimumDepth { get; set; } + + public double SlipPlaneMinimumLength { get; set; } + + public double FactoryOfStability { get; set; } + + public double ZValue { get; set; } + + public double ForbiddenZonesXEntryMin { get; set; } + + public double ForbiddenZonesXEntryMax { get; set; } + + public bool ForbiddenZonesAutomaticallyCalculated { get; set; } + + public bool GridAutomaticallyCalculated { get; set; } + + public SlidingDualCircle SlidingCurveResult { get; set; } + + public SlipPlaneUpliftVan SlipPlaneResult { get; set; } + + public void Calculate() + { + Calculated = true; + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj =================================================================== diff -u -rdc76c02e3487559413087637935f008147927ea0 -r83f824a69b1a78fc4822ac19375e60e6c9be7d87 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj) (revision dc76c02e3487559413087637935f008147927ea0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj) (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -64,10 +64,10 @@ - + - - + + Fisheye: Tag 83f824a69b1a78fc4822ac19375e60e6c9be7d87 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/MacroStabilityInwardsSubCalculatorFactoryConfig.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 83f824a69b1a78fc4822ac19375e60e6c9be7d87 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/TestMacroStabilityInwardsKernelFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 83f824a69b1a78fc4822ac19375e60e6c9be7d87 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/UpliftVanKernelStub.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/SubCalculator/PipingSubCalculatorFactoryTest.cs =================================================================== diff -u -rf85a7a802a40cf50b055e0464fa6845c6f5c826c -r83f824a69b1a78fc4822ac19375e60e6c9be7d87 --- Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/SubCalculator/PipingSubCalculatorFactoryTest.cs (.../PipingSubCalculatorFactoryTest.cs) (revision f85a7a802a40cf50b055e0464fa6845c6f5c826c) +++ Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/SubCalculator/PipingSubCalculatorFactoryTest.cs (.../PipingSubCalculatorFactoryTest.cs) (revision 83f824a69b1a78fc4822ac19375e60e6c9be7d87) @@ -76,7 +76,7 @@ IHeaveCalculator calculator = factory.CreateHeaveCalculator(); // Assert - Assert.IsInstanceOf(calculator); + Assert.IsInstanceOf(calculator); } [Test] @@ -89,7 +89,7 @@ IUpliftCalculator calculator = factory.CreateUpliftCalculator(); // Assert - Assert.IsInstanceOf(calculator); + Assert.IsInstanceOf(calculator); } [Test] @@ -102,7 +102,7 @@ ISellmeijerCalculator calculator = factory.CreateSellmeijerCalculator(); // Assert - Assert.IsInstanceOf(calculator); + Assert.IsInstanceOf(calculator); } [Test] @@ -115,7 +115,7 @@ IEffectiveThicknessCalculator calculator = factory.CreateEffectiveThicknessCalculator(); // Assert - Assert.IsInstanceOf(calculator); + Assert.IsInstanceOf(calculator); } [Test] @@ -128,7 +128,7 @@ IPiezoHeadCalculator calculator = factory.CreatePiezometricHeadAtExitCalculator(); // Assert - Assert.IsInstanceOf(calculator); + Assert.IsInstanceOf(calculator); } } } \ No newline at end of file