Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/MacroStabilityInwardsCalculatorResultTestFactoryTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/MacroStabilityInwardsCalculatorResultTestFactoryTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/MacroStabilityInwardsCalculatorResultTestFactoryTest.cs (revision 37b140fe95b895b99d5d93a853b9bc1b4e96d5e4) @@ -0,0 +1,93 @@ +// 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 NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Result; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test +{ + [TestFixture] + public class MacroStabilityInwardsCalculatorResultTestFactoryTest + { + [Test] + public void Create_Always_ReturnResultWithDefaultValues() + { + // Call + MacroStabilityInwardsCalculatorResult result = MacroStabilityInwardsCalculatorResultTestFactory.Create(); + + // Assert + Assert.AreEqual(0.1, result.FactorOfStability); + Assert.AreEqual(0.2, result.ZValue); + Assert.AreEqual(0.3, result.ForbiddenZonesXEntryMin); + Assert.AreEqual(0.4, result.ForbiddenZonesXEntryMax); + Assert.IsTrue(result.GridAutomaticallyCalculated); + Assert.IsTrue(result.ForbiddenZonesAutomaticallyCalculated); + + AssertSlidingCurve(result.SlidingCurve); + AssertUpliftVanCalculationGrid(result.UpliftVanCalculationGrid); + } + + private static void AssertSlidingCurve(MacroStabilityInwardsSlidingCurveResult slidingCurve) + { + AssertCircle(slidingCurve.LeftCircle); + AssertCircle(slidingCurve.RightCircle); + + Assert.AreEqual(0, slidingCurve.IteratedHorizontalForce); + Assert.AreEqual(0, slidingCurve.NonIteratedHorizontalForce); + CollectionAssert.IsEmpty(slidingCurve.Slices); + } + + private static void AssertCircle(MacroStabilityInwardsSlidingCircleResult circle) + { + Assert.AreEqual(new Point2D(0, 0), circle.Center); + Assert.AreEqual(0.1, circle.Radius); + Assert.IsTrue(circle.IsActive); + Assert.AreEqual(0.2, circle.NonIteratedForce); + Assert.AreEqual(0.3, circle.IteratedForce); + Assert.AreEqual(0.4, circle.DrivingMoment); + Assert.AreEqual(0.5, circle.ResistingMoment); + } + + private static void AssertUpliftVanCalculationGrid(MacroStabilityInwardsUpliftVanCalculationGridResult upliftVanCalculationGrid) + { + AssertGrid(upliftVanCalculationGrid.LeftGrid); + AssertGrid(upliftVanCalculationGrid.RightGrid); + + CollectionAssert.AreEqual(new[] + { + 3, + 2, + 1.5 + }, upliftVanCalculationGrid.TangentLines); + } + + private static void AssertGrid(MacroStabilityInwardsGridResult grid) + { + Assert.AreEqual(0.1, grid.XLeft); + Assert.AreEqual(0.2, grid.XRight); + Assert.AreEqual(0.3, grid.ZTop); + Assert.AreEqual(0.4, grid.ZBottom); + Assert.AreEqual(1, grid.NumberOfHorizontalPoints); + Assert.AreEqual(2, grid.NumberOfVerticalPoints); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/MacroStabilityInwardsCalculatorStubTest.cs =================================================================== diff -u -r966dc7335defa901104fd4168d57c08315db2de0 -r37b140fe95b895b99d5d93a853b9bc1b4e96d5e4 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/MacroStabilityInwardsCalculatorStubTest.cs (.../MacroStabilityInwardsCalculatorStubTest.cs) (revision 966dc7335defa901104fd4168d57c08315db2de0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/MacroStabilityInwardsCalculatorStubTest.cs (.../MacroStabilityInwardsCalculatorStubTest.cs) (revision 37b140fe95b895b99d5d93a853b9bc1b4e96d5e4) @@ -28,6 +28,18 @@ public class MacroStabilityInwardsCalculatorStubTest { [Test] + public void Constructor_ExpectedValues() + { + // Call + var calculator = new MacroStabilityInwardsCalculatorStub(); + + // Assert + Assert.IsInstanceOf(calculator); + Assert.IsNull(calculator.Input); + Assert.IsNull(calculator.Output); + } + + [Test] public void Validate_Always_ReturnEmptyList() { // Setup @@ -50,10 +62,10 @@ MacroStabilityInwardsCalculatorResult result = calculator.Calculate(); // Assert - Assert.IsNaN(result.FactorOfStability); - Assert.IsNaN(result.ZValue); - Assert.IsNaN(result.ForbiddenZonesXEntryMax); - Assert.IsNaN(result.ForbiddenZonesXEntryMin); + Assert.AreEqual(0.1, result.FactorOfStability); + Assert.AreEqual(0.2, result.ZValue); + Assert.AreEqual(0.3, result.ForbiddenZonesXEntryMin); + Assert.AreEqual(0.4, result.ForbiddenZonesXEntryMax); Assert.IsNotNull(result.SlidingCurve); Assert.IsNotNull(result.UpliftVanCalculationGrid); } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj =================================================================== diff -u -r966dc7335defa901104fd4168d57c08315db2de0 -r37b140fe95b895b99d5d93a853b9bc1b4e96d5e4 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj) (revision 966dc7335defa901104fd4168d57c08315db2de0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test.csproj) (revision 37b140fe95b895b99d5d93a853b9bc1b4e96d5e4) @@ -52,6 +52,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/MacroStabilityInwardsCalculatorResultTestFactory.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/MacroStabilityInwardsCalculatorResultTestFactory.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/MacroStabilityInwardsCalculatorResultTestFactory.cs (revision 37b140fe95b895b99d5d93a853b9bc1b4e96d5e4) @@ -0,0 +1,61 @@ +// 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.Result; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Result; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil +{ + /// + /// Factory to create simple + /// instances that can be used for testing. + /// + public static class MacroStabilityInwardsCalculatorResultTestFactory + { + /// + /// Creates a new . + /// + /// The created . + public static MacroStabilityInwardsCalculatorResult Create() + { + return new MacroStabilityInwardsCalculatorResult( + MacroStabilityInwardsSlidingCurveResultTestFactory.Create(), + new MacroStabilityInwardsUpliftVanCalculationGridResult( + MacroStabilityInwardsGridResultTestFactory.Create(), + MacroStabilityInwardsGridResultTestFactory.Create(), + new[] + { + 3, + 2, + 1.5 + }), + new MacroStabilityInwardsCalculatorResult.ConstructionProperties + { + FactorOfStability = 0.1, + ZValue = 0.2, + ForbiddenZonesXEntryMin = 0.3, + ForbiddenZonesXEntryMax = 0.4, + GridAutomaticallyCalculated = true, + ForbiddenZonesAutomaticallyCalculated = true + }); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/MacroStabilityInwardsCalculatorStub.cs =================================================================== diff -u -r742cb1709bba5e30022c21501add2db4b3900c0c -r37b140fe95b895b99d5d93a853b9bc1b4e96d5e4 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/MacroStabilityInwardsCalculatorStub.cs (.../MacroStabilityInwardsCalculatorStub.cs) (revision 742cb1709bba5e30022c21501add2db4b3900c0c) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/MacroStabilityInwardsCalculatorStub.cs (.../MacroStabilityInwardsCalculatorStub.cs) (revision 37b140fe95b895b99d5d93a853b9bc1b4e96d5e4) @@ -20,8 +20,6 @@ // All rights reserved. using System.Collections.Generic; -using Ringtoets.MacroStabilityInwards.KernelWrapper.Result; -using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Result; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil { @@ -32,14 +30,11 @@ { public MacroStabilityInwardsCalculatorInput Input { get; set; } + public MacroStabilityInwardsCalculatorResult Output { get; private set; } + public MacroStabilityInwardsCalculatorResult Calculate() { - return new MacroStabilityInwardsCalculatorResult( - MacroStabilityInwardsSlidingCurveResultTestFactory.Create(), - new MacroStabilityInwardsUpliftVanCalculationGridResult(MacroStabilityInwardsGridResultTestFactory.Create(), - MacroStabilityInwardsGridResultTestFactory.Create(), - new double[0]), - new MacroStabilityInwardsCalculatorResult.ConstructionProperties()); + return Output ?? (Output = MacroStabilityInwardsCalculatorResultTestFactory.Create()); } public List Validate() Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj =================================================================== diff -u -r8df85402c4de8eb335483bcda5e4ff23ce0dd5ef -r37b140fe95b895b99d5d93a853b9bc1b4e96d5e4 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj) (revision 8df85402c4de8eb335483bcda5e4ff23ce0dd5ef) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.csproj) (revision 37b140fe95b895b99d5d93a853b9bc1b4e96d5e4) @@ -57,6 +57,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/TestMacroStabilityInwardsCalculatorFactory.cs =================================================================== diff -u -r742cb1709bba5e30022c21501add2db4b3900c0c -r37b140fe95b895b99d5d93a853b9bc1b4e96d5e4 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/TestMacroStabilityInwardsCalculatorFactory.cs (.../TestMacroStabilityInwardsCalculatorFactory.cs) (revision 742cb1709bba5e30022c21501add2db4b3900c0c) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/TestMacroStabilityInwardsCalculatorFactory.cs (.../TestMacroStabilityInwardsCalculatorFactory.cs) (revision 37b140fe95b895b99d5d93a853b9bc1b4e96d5e4) @@ -35,9 +35,9 @@ { Calculator = new MacroStabilityInwardsCalculatorStub(); } - - public MacroStabilityInwardsCalculatorStub Calculator { get; } + public MacroStabilityInwardsCalculatorStub Calculator { get; } + public IMacroStabilityInwardsCalculator CreateCalculator(MacroStabilityInwardsCalculatorInput input, IMacroStabilityInwardsSubCalculatorFactory factory) { Calculator.Input = input; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs =================================================================== diff -u -r742cb1709bba5e30022c21501add2db4b3900c0c -r37b140fe95b895b99d5d93a853b9bc1b4e96d5e4 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs (.../MacroStabilityInwardsCalculationServiceTest.cs) (revision 742cb1709bba5e30022c21501add2db4b3900c0c) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs (.../MacroStabilityInwardsCalculationServiceTest.cs) (revision 37b140fe95b895b99d5d93a853b9bc1b4e96d5e4) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Collections.Generic; using System.Linq; using Core.Common.Base.Data; using Core.Common.TestUtil; @@ -29,7 +30,10 @@ using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.TestUtil; using Ringtoets.MacroStabilityInwards.KernelWrapper; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Result; +using Ringtoets.MacroStabilityInwards.KernelWrapper.SubCalculator; using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil; +using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.SubCalculator; namespace Ringtoets.MacroStabilityInwards.Service.Test { @@ -282,8 +286,7 @@ MacroStabilityInwardsCalculationService.Calculate(testCalculation); // Assert - MacroStabilityInwardsOutput macroStabilityInwardsOutput = testCalculation.Output; - Assert.IsNotNull(macroStabilityInwardsOutput); + Assert.IsNotNull(testCalculation.Output); } } @@ -322,6 +325,25 @@ } } + [Test] + public void Calculate_CalculationRan_SetOutput() + { + // Setup + using (new MacroStabilityInwardsCalculatorFactoryConfig(new TestMacroStabilityInwardsCalculatorFactory())) + { + var calculatorFactory = (TestMacroStabilityInwardsCalculatorFactory)MacroStabilityInwardsCalculatorFactory.Instance; + + // Precondition + Assert.IsTrue(MacroStabilityInwardsCalculationService.Validate(testCalculation)); + + // Call + MacroStabilityInwardsCalculationService.Calculate(testCalculation); + + // Assert + AssertOutput(calculatorFactory.Calculator.Output, testCalculation.Output); + } + } + private static void AssertInput(MacroStabilityInwardsInput originalInput, TestMacroStabilityInwardsCalculatorFactory factory) { MacroStabilityInwardsCalculatorInput actualInput = factory.Calculator.Input; @@ -362,5 +384,96 @@ Assert.AreEqual(originalInput.SlipPlaneMinimumDepth, actualInput.SlipPlaneMinimumDepth); Assert.AreEqual(originalInput.SlipPlaneMinimumLength, actualInput.SlipPlaneMinimumLength); } + + private static void AssertOutput(MacroStabilityInwardsCalculatorResult expectedOutput, MacroStabilityInwardsOutput actualOutput) + { + Assert.AreEqual(expectedOutput.FactorOfStability, actualOutput.FactorOfStability); + Assert.AreEqual(expectedOutput.ZValue, actualOutput.ZValue); + Assert.AreEqual(expectedOutput.ForbiddenZonesXEntryMin, actualOutput.ForbiddenZonesXEntryMin); + Assert.AreEqual(expectedOutput.ForbiddenZonesXEntryMax, actualOutput.ForbiddenZonesXEntryMax); + Assert.AreEqual(expectedOutput.GridAutomaticallyCalculated, actualOutput.GridAutomaticallyCalculated); + Assert.AreEqual(expectedOutput.ForbiddenZonesAutomaticallyCalculated, actualOutput.ForbiddenZonesAutomaticallyCalculated); + AssertSlidingCurve(expectedOutput.SlidingCurve, actualOutput.SlidingCurve); + AssertSlipPlane(expectedOutput.UpliftVanCalculationGrid, actualOutput.SlipPlane); + } + + private static void AssertSlidingCurve(MacroStabilityInwardsSlidingCurveResult expected, MacroStabilityInwardsSlidingCurve actual) + { + Assert.AreEqual(expected.IteratedHorizontalForce, actual.IteratedHorizontalForce); + Assert.AreEqual(expected.NonIteratedHorizontalForce, actual.NonIteratedHorizontalForce); + AssertCircle(expected.LeftCircle, actual.LeftCircle); + AssertCircle(expected.RightCircle, actual.RightCircle); + AssertSlices(expected.Slices, actual.Slices); + } + + private static void AssertCircle(MacroStabilityInwardsSlidingCircleResult circleResult, MacroStabilityInwardsSlidingCircle circleOutput) + { + Assert.AreEqual(circleResult.Center, circleOutput.Center); + Assert.AreEqual(circleResult.IsActive, circleOutput.IsActive); + Assert.AreEqual(circleResult.Radius, circleOutput.Radius); + Assert.AreEqual(circleResult.DrivingMoment, circleOutput.DrivingMoment); + Assert.AreEqual(circleResult.ResistingMoment, circleOutput.ResistingMoment); + Assert.AreEqual(circleResult.IteratedForce, circleOutput.IteratedForce); + Assert.AreEqual(circleResult.NonIteratedForce, circleOutput.NonIteratedForce); + } + + private static void AssertSlices(IEnumerable resultSlices, IEnumerable outputSlices) + { + MacroStabilityInwardsSliceResult[] expectedSlices = resultSlices.ToArray(); + MacroStabilityInwardsSlice[] actualSlices = outputSlices.ToArray(); + + Assert.AreEqual(expectedSlices.Length, actualSlices.Length); + + for (var i = 0; i < expectedSlices.Length; i++) + { + Assert.AreEqual(expectedSlices[i].Cohesion, actualSlices[i].Cohesion); + Assert.AreEqual(expectedSlices[i].FrictionAngle, actualSlices[i].FrictionAngle); + Assert.AreEqual(expectedSlices[i].CriticalPressure, actualSlices[i].CriticalPressure); + Assert.AreEqual(expectedSlices[i].OverConsolidationRatio, actualSlices[i].OverConsolidationRatio); + Assert.AreEqual(expectedSlices[i].Pop, actualSlices[i].Pop); + Assert.AreEqual(expectedSlices[i].DegreeOfConsolidationPorePressureSoil, actualSlices[i].DegreeOfConsolidationPorePressureSoil); + Assert.AreEqual(expectedSlices[i].DegreeOfConsolidationPorePressureLoad, actualSlices[i].DegreeOfConsolidationPorePressureLoad); + Assert.AreEqual(expectedSlices[i].Dilatancy, actualSlices[i].Dilatancy); + Assert.AreEqual(expectedSlices[i].ExternalLoad, actualSlices[i].ExternalLoad); + Assert.AreEqual(expectedSlices[i].HydrostaticPorePressure, actualSlices[i].HydrostaticPorePressure); + Assert.AreEqual(expectedSlices[i].LeftForce, actualSlices[i].LeftForce); + Assert.AreEqual(expectedSlices[i].LeftForceAngle, actualSlices[i].LeftForceAngle); + Assert.AreEqual(expectedSlices[i].LeftForceY, actualSlices[i].LeftForceY); + Assert.AreEqual(expectedSlices[i].RightForce, actualSlices[i].RightForce); + Assert.AreEqual(expectedSlices[i].RightForceAngle, actualSlices[i].RightForceAngle); + Assert.AreEqual(expectedSlices[i].RightForceY, actualSlices[i].RightForceY); + Assert.AreEqual(expectedSlices[i].LoadStress, actualSlices[i].LoadStress); + Assert.AreEqual(expectedSlices[i].NormalStress, actualSlices[i].NormalStress); + Assert.AreEqual(expectedSlices[i].PorePressure, actualSlices[i].PorePressure); + Assert.AreEqual(expectedSlices[i].HorizontalPorePressure, actualSlices[i].HorizontalPorePressure); + Assert.AreEqual(expectedSlices[i].VerticalPorePressure, actualSlices[i].VerticalPorePressure); + Assert.AreEqual(expectedSlices[i].PiezometricPorePressure, actualSlices[i].PiezometricPorePressure); + Assert.AreEqual(expectedSlices[i].EffectiveStress, actualSlices[i].EffectiveStress); + Assert.AreEqual(expectedSlices[i].EffectiveStressDaily, actualSlices[i].EffectiveStressDaily); + Assert.AreEqual(expectedSlices[i].ExcessPorePressure, actualSlices[i].ExcessPorePressure); + Assert.AreEqual(expectedSlices[i].ShearStress, actualSlices[i].ShearStress); + Assert.AreEqual(expectedSlices[i].SoilStress, actualSlices[i].SoilStress); + Assert.AreEqual(expectedSlices[i].TotalPorePressure, actualSlices[i].TotalPorePressure); + Assert.AreEqual(expectedSlices[i].TotalStress, actualSlices[i].TotalStress); + Assert.AreEqual(expectedSlices[i].Weight, actualSlices[i].Weight); + } + } + + private static void AssertSlipPlane(MacroStabilityInwardsUpliftVanCalculationGridResult expected, MacroStabilityInwardsSlipPlaneUpliftVan actual) + { + CollectionAssert.AreEqual(expected.TangentLines, actual.TangentLines); + AssertGrid(expected.LeftGrid, actual.LeftGrid); + AssertGrid(expected.RightGrid, actual.RightGrid); + } + + private static void AssertGrid(MacroStabilityInwardsGridResult expectedGrid, MacroStabilityInwardsGridOutput actualGrid) + { + Assert.AreEqual(expectedGrid.XLeft, actualGrid.XLeft); + Assert.AreEqual(expectedGrid.XRight, actualGrid.XRight); + Assert.AreEqual(expectedGrid.ZTop, actualGrid.ZTop); + Assert.AreEqual(expectedGrid.ZBottom, actualGrid.ZBottom); + Assert.AreEqual(expectedGrid.NumberOfHorizontalPoints, actualGrid.NumberOfHorizontalPoints); + Assert.AreEqual(expectedGrid.NumberOfVerticalPoints, actualGrid.NumberOfVerticalPoints); + } } } \ No newline at end of file