Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs =================================================================== diff -u -r14ce61e9643e427122685384157ec22ddb9b4422 -r90e819fbef3e545d8b192653668e9a92b5a0d350 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs (.../MacroStabilityInwardsCalculator.cs) (revision 14ce61e9643e427122685384157ec22ddb9b4422) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs (.../MacroStabilityInwardsCalculator.cs) (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) @@ -62,19 +62,19 @@ public MacroStabilityInwardsCalculatorResult Calculate() { - IUpliftVanKernel upliftVanCalculator = CalculateUpliftVan(); + IUpliftVanKernel upliftVanKernel = CalculateUpliftVan(); return new MacroStabilityInwardsCalculatorResult( - MacroStabilityInwardsSlidingCurveResultCreator.Create(upliftVanCalculator.SlidingCurveResult), - MacroStabilityInwardsUpliftVanCalculationGridResultCreator.Create(upliftVanCalculator.SlipPlaneResult), + MacroStabilityInwardsSlidingCurveResultCreator.Create(upliftVanKernel.SlidingCurveResult), + MacroStabilityInwardsUpliftVanCalculationGridResultCreator.Create(upliftVanKernel.SlipPlaneResult), new MacroStabilityInwardsCalculatorResult.ConstructionProperties { - FactorOfStability = upliftVanCalculator.FactoryOfStability, - ZValue = upliftVanCalculator.ZValue, - ForbiddenZonesXEntryMin = upliftVanCalculator.ForbiddenZonesXEntryMin, - ForbiddenZonesXEntryMax = upliftVanCalculator.ForbiddenZonesXEntryMax, - ForbiddenZonesAutomaticallyCalculated = upliftVanCalculator.ForbiddenZonesAutomaticallyCalculated, - GridAutomaticallyCalculated = upliftVanCalculator.GridAutomaticallyCalculated + FactorOfStability = upliftVanKernel.FactoryOfStability, + ZValue = upliftVanKernel.ZValue, + ForbiddenZonesXEntryMin = upliftVanKernel.ForbiddenZonesXEntryMin, + ForbiddenZonesXEntryMax = upliftVanKernel.ForbiddenZonesXEntryMax, + ForbiddenZonesAutomaticallyCalculated = upliftVanKernel.ForbiddenZonesAutomaticallyCalculated, + GridAutomaticallyCalculated = upliftVanKernel.GridAutomaticallyCalculated }); } @@ -85,23 +85,24 @@ private IUpliftVanKernel CalculateUpliftVan() { - IUpliftVanKernel upliftVanCalculator = CreateUpliftVanCalculator(); + IUpliftVanKernel upliftVanKernel = CreateUpliftVanKernel(); try { - upliftVanCalculator.Calculate(); + upliftVanKernel.Calculate(); } catch (Exception e) { // Temporary do nothing } - return upliftVanCalculator; + return upliftVanKernel; } - private IUpliftVanKernel CreateUpliftVanCalculator() + private IUpliftVanKernel CreateUpliftVanKernel() { IUpliftVanKernel calculator = factory.CreateUpliftVanKernel(); + calculator.MoveGrid = input.MoveGrid; calculator.MaximumSliceWidth = input.MaximumSliceWidth; @@ -126,6 +127,7 @@ calculator.AutomaticForbiddenZones = input.AutomaticForbiddenZones; calculator.SlipPlaneMinimumDepth = input.SlipPlaneMinimumDepth; calculator.SlipPlaneMinimumLength = input.SlipPlaneMinimumLength; + return calculator; } } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs =================================================================== diff -u -r14ce61e9643e427122685384157ec22ddb9b4422 -r90e819fbef3e545d8b192653668e9a92b5a0d350 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs (.../MacroStabilityInwardsCalculatorTest.cs) (revision 14ce61e9643e427122685384157ec22ddb9b4422) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorTest.cs (.../MacroStabilityInwardsCalculatorTest.cs) (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) @@ -92,8 +92,8 @@ var random = new Random(11); var input = new MacroStabilityInwardsCalculatorInput(CreateSimpleConstructionProperties()); - var testMacroStabilityInwardsSubCalculatorFactory = new TestMacroStabilityInwardsSubCalculatorFactory(); - UpliftVanCalculatorStub calculator = testMacroStabilityInwardsSubCalculatorFactory.LastCreatedUpliftVanCalculator; + var testMacroStabilityInwardsSubCalculatorFactory = new TestMacroStabilityInwardsKernelFactory(); + UpliftVanCalculatorStub calculator = testMacroStabilityInwardsSubCalculatorFactory.LastCreatedUpliftVanKernel; calculator.FactoryOfStability = random.NextDouble(); calculator.ZValue = random.NextDouble(); calculator.ForbiddenZonesXEntryMax = random.NextDouble(); @@ -119,15 +119,15 @@ MacroStabilityInwardsCalculatorResultHelper.AssertSlipPlaneGrid(MacroStabilityInwardsUpliftVanCalculationGridResultCreator.Create(calculator.SlipPlaneResult), actual.UpliftVanCalculationGrid); - Assert.IsTrue(testMacroStabilityInwardsSubCalculatorFactory.LastCreatedUpliftVanCalculator.Calculated); + Assert.IsTrue(testMacroStabilityInwardsSubCalculatorFactory.LastCreatedUpliftVanKernel.Calculated); } [Test] public void Validate_Always_ReturnEmptyList() { // Setup var input = new MacroStabilityInwardsCalculatorInput(CreateSimpleConstructionProperties()); - var testMacroStabilityInwardsSubCalculatorFactory = new TestMacroStabilityInwardsSubCalculatorFactory(); + var testMacroStabilityInwardsSubCalculatorFactory = new TestMacroStabilityInwardsKernelFactory(); // Call List validationResult = new MacroStabilityInwardsCalculator(input, testMacroStabilityInwardsSubCalculatorFactory).Validate(); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/SubCalculator/MacroStabilityInwardsKernelWrapperFactoryTest.cs =================================================================== diff -u -rf85a7a802a40cf50b055e0464fa6845c6f5c826c -r90e819fbef3e545d8b192653668e9a92b5a0d350 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/SubCalculator/MacroStabilityInwardsKernelWrapperFactoryTest.cs (.../MacroStabilityInwardsKernelWrapperFactoryTest.cs) (revision f85a7a802a40cf50b055e0464fa6845c6f5c826c) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/SubCalculator/MacroStabilityInwardsKernelWrapperFactoryTest.cs (.../MacroStabilityInwardsKernelWrapperFactoryTest.cs) (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) @@ -56,7 +56,7 @@ public void Instance_WhenSetToInstance_ReturnsThatInstance() { // Setup - var firstFactory = new TestMacroStabilityInwardsSubCalculatorFactory(); + var firstFactory = new TestMacroStabilityInwardsKernelFactory(); MacroStabilityInwardsKernelWrapperFactory.Instance = firstFactory; // Call @@ -67,16 +67,16 @@ } [Test] - public void CreateUpliftVanCalculator_Always_ReturnsUpliftVanCalculator() + public void CreateUpliftVanKernel_Always_ReturnsUpliftVanCalculator() { // Setup IMacroStabilityInwardsKernelFactory factory = MacroStabilityInwardsKernelWrapperFactory.Instance; // Call - IUpliftVanKernel subCalculator = factory.CreateUpliftVanKernel(); + IUpliftVanKernel upliftVanKernel = factory.CreateUpliftVanKernel(); // Assert - Assert.IsNotNull(subCalculator); + Assert.IsNotNull(upliftVanKernel); } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj =================================================================== diff -u -r37b140fe95b895b99d5d93a853b9bc1b4e96d5e4 -r90e819fbef3e545d8b192653668e9a92b5a0d350 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj) (revision 37b140fe95b895b99d5d93a853b9bc1b4e96d5e4) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj) (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) @@ -60,7 +60,7 @@ - + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/SubCalculator/MacroStabilityInwardsSubCalculatorFactoryConfigTest.cs =================================================================== diff -u -rf85a7a802a40cf50b055e0464fa6845c6f5c826c -r90e819fbef3e545d8b192653668e9a92b5a0d350 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/SubCalculator/MacroStabilityInwardsSubCalculatorFactoryConfigTest.cs (.../MacroStabilityInwardsSubCalculatorFactoryConfigTest.cs) (revision f85a7a802a40cf50b055e0464fa6845c6f5c826c) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/SubCalculator/MacroStabilityInwardsSubCalculatorFactoryConfigTest.cs (.../MacroStabilityInwardsSubCalculatorFactoryConfigTest.cs) (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) @@ -47,7 +47,7 @@ using (new MacroStabilityInwardsSubCalculatorFactoryConfig()) { // Assert - Assert.IsInstanceOf(MacroStabilityInwardsKernelWrapperFactory.Instance); + Assert.IsInstanceOf(MacroStabilityInwardsKernelWrapperFactory.Instance); } } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/SubCalculator/TestMacroStabilityInwardsKernelFactoryTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/SubCalculator/TestMacroStabilityInwardsKernelFactoryTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/SubCalculator/TestMacroStabilityInwardsKernelFactoryTest.cs (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) @@ -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.SubCalculator; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.SubCalculator; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.SubCalculator +{ + [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 Fisheye: Tag 90e819fbef3e545d8b192653668e9a92b5a0d350 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/SubCalculator/TestMacroStabilityInwardsSubCalculatorFactoryTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/TestMacroStabilityInwardsCalculatorFactoryTest.cs =================================================================== diff -u -r1d6eb4a980508dc55fca5a225fe777c7fd3cbd2e -r90e819fbef3e545d8b192653668e9a92b5a0d350 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/TestMacroStabilityInwardsCalculatorFactoryTest.cs (.../TestMacroStabilityInwardsCalculatorFactoryTest.cs) (revision 1d6eb4a980508dc55fca5a225fe777c7fd3cbd2e) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/TestMacroStabilityInwardsCalculatorFactoryTest.cs (.../TestMacroStabilityInwardsCalculatorFactoryTest.cs) (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) @@ -47,7 +47,7 @@ var input = new MacroStabilityInwardsCalculatorInput(new MacroStabilityInwardsCalculatorInput.ConstructionProperties()); // Call - var calculator = (MacroStabilityInwardsCalculatorStub) factory.CreateCalculator(input, new TestMacroStabilityInwardsSubCalculatorFactory()); + var calculator = (MacroStabilityInwardsCalculatorStub) factory.CreateCalculator(input, new TestMacroStabilityInwardsKernelFactory()); // Assert Assert.AreSame(input, calculator.Input); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj =================================================================== diff -u -r37b140fe95b895b99d5d93a853b9bc1b4e96d5e4 -r90e819fbef3e545d8b192653668e9a92b5a0d350 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj) (revision 37b140fe95b895b99d5d93a853b9bc1b4e96d5e4) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj) (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) @@ -66,7 +66,7 @@ - + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/MacroStabilityInwardsSubCalculatorFactoryConfig.cs =================================================================== diff -u -rf85a7a802a40cf50b055e0464fa6845c6f5c826c -r90e819fbef3e545d8b192653668e9a92b5a0d350 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/MacroStabilityInwardsSubCalculatorFactoryConfig.cs (.../MacroStabilityInwardsSubCalculatorFactoryConfig.cs) (revision f85a7a802a40cf50b055e0464fa6845c6f5c826c) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/MacroStabilityInwardsSubCalculatorFactoryConfig.cs (.../MacroStabilityInwardsSubCalculatorFactoryConfig.cs) (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) @@ -25,7 +25,7 @@ namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.SubCalculator { /// - /// This class can be used to set a temporary + /// This class can be used to set a temporary /// for while testing. /// Disposing an instance of this class will revert the /// . @@ -46,13 +46,13 @@ /// /// Creates a new instance of . - /// Sets a to + /// Sets a to /// /// public MacroStabilityInwardsSubCalculatorFactoryConfig() { previousFactory = MacroStabilityInwardsKernelWrapperFactory.Instance; - MacroStabilityInwardsKernelWrapperFactory.Instance = new TestMacroStabilityInwardsSubCalculatorFactory(); + MacroStabilityInwardsKernelWrapperFactory.Instance = new TestMacroStabilityInwardsKernelFactory(); } /// Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/TestMacroStabilityInwardsKernelFactory.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/TestMacroStabilityInwardsKernelFactory.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/TestMacroStabilityInwardsKernelFactory.cs (revision 90e819fbef3e545d8b192653668e9a92b5a0d350) @@ -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.SubCalculator; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.SubCalculator +{ + /// + /// 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 UpliftVanCalculatorStub(); + } + + /// + /// The last created Uplift Van kernel. + /// + public UpliftVanCalculatorStub LastCreatedUpliftVanKernel { get; } + + public IUpliftVanKernel CreateUpliftVanKernel() + { + return LastCreatedUpliftVanKernel; + } + } +} \ No newline at end of file Fisheye: Tag 90e819fbef3e545d8b192653668e9a92b5a0d350 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/TestMacroStabilityInwardsSubCalculatorFactory.cs'. Fisheye: No comparison available. Pass `N' to diff?