Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.BenchmarkTests/DamCalculationBenchmarkTest.cs =================================================================== diff -u -r4070 -r4091 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.BenchmarkTests/DamCalculationBenchmarkTest.cs (.../DamCalculationBenchmarkTest.cs) (revision 4070) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.BenchmarkTests/DamCalculationBenchmarkTest.cs (.../DamCalculationBenchmarkTest.cs) (revision 4091) @@ -29,213 +29,210 @@ using Deltares.DamEngine.Io.XmlOutput; using NUnit.Framework; -namespace Deltares.Dam.Tests +namespace Deltares.Dam.BenchmarkTests; + +[TestFixture] +public class DamCalculationBenchmarkTest { - [TestFixture] - public class DamCalculationBenchmarkTest - { - const double cTolerance = 0.001; + private const double cTolerance = 0.001; - #region SupportingMethods + #region SupportingMethods - #endregion SupportingMethods + #endregion SupportingMethods - #region Uplift + #region Uplift - /// - /// Compute project - /// - /// - /// - /// - /// - private static List ComputeStabilityInsideProject(string projectFilename, - MStabModelType modelType, int expectedLocations) + /// + /// Compute project + /// + /// + /// + /// + /// + private static List ComputeStabilityInsideProject(string projectFilename, + MStabModelType modelType, int expectedLocations) + { + using (DamProjectData damProjectData = ProjectLoader.LoadProjectData(projectFilename)) { - using (DamProjectData damProjectData = - ProjectLoader.LoadProjectData(projectFilename)) - { - Assert.AreEqual(1, damProjectData.WaterBoard.Dikes.Count); - Dike dike = damProjectData.WaterBoard.Dikes[0]; - Assert.AreEqual(expectedLocations, dike.Locations.Count); + Assert.AreEqual(1, damProjectData.WaterBoard.Dikes.Count); + Dike dike = damProjectData.WaterBoard.Dikes[0]; + Assert.AreEqual(expectedLocations, dike.Locations.Count); - // Specify calculation - damProjectData.DamProjectCalculationSpecification.CurrentSpecification.StabilityModelType = - modelType; - damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismeParamatersMStab - .MStabParameters.GridPosition = MStabGridPosition.Right; - damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismeParamatersMStab - .MStabParameters.SearchMethod = MStabSearchMethod.Grid; - damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismSystemType = - FailureMechanismSystemType.StabilityInside; - damProjectData.LocationJobs[0].Run = true; + // Specify calculation + damProjectData.DamProjectCalculationSpecification.CurrentSpecification.StabilityModelType = modelType; + damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismeParamatersMStab + .MStabParameters.GridPosition = MStabGridPosition.Right; + damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismeParamatersMStab + .MStabParameters.SearchMethod = MStabSearchMethod.Grid; + damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismSystemType = + FailureMechanismSystemType.StabilityInside; + damProjectData.LocationJobs[0].Run = true; - DamProjectCalculationSpecification.SelectedAnalysisType = AnalysisType.NoAdaption; + DamProjectCalculationSpecification.SelectedAnalysisType = AnalysisType.NoAdaption; - Input input = FillXmlInputFromDamUi.CreateInput(damProjectData); - string inputXml = DamXmlSerialization.SaveInputAsXmlString(input); + Input input = FillXmlInputFromDamUi.CreateInput(damProjectData); + string inputXml = DamXmlSerialization.SaveInputAsXmlString(input); - var damEngineInterface = new EngineInterface(inputXml); - string validationMessages = damEngineInterface.Validate(); + var damEngineInterface = new EngineInterface(inputXml); + string validationMessages = damEngineInterface.Validate(); - if (string.IsNullOrEmpty(validationMessages)) - { - // only if validation is ok, then - string outputXml = damEngineInterface.Run(); - Output output = DamXmlSerialization.LoadOutputFromXmlString(outputXml); - FillDamUiFromXmlOutput.AddOutputToDamProjectData(damProjectData, output); - } - - List allCalculationResults = damProjectData.DesignCalculations; - return allCalculationResults; + if (string.IsNullOrEmpty(validationMessages)) + { + // only if validation is ok, then + string outputXml = damEngineInterface.Run(); + Output output = DamXmlSerialization.LoadOutputFromXmlString(outputXml); + FillDamUiFromXmlOutput.AddOutputToDamProjectData(damProjectData, output); } - } - /// - /// Performs test BM04Opdijven01 situation without uplift 1D - /// - [Test] - [Category("Slow")] - [Category("Work_In_Progress")] - [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] - public void BM04Opdrijven01SituatieZonderOpdrijven1D() - { - var cFolderName = - @"..\..\..\data\Dam\\Benchmarks\4 Validatie opdrijfberekeningen\01 Situatie zonder opdrijven (1D)\Databronbestand.damx"; - List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); - - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); - Assert.AreEqual(1.024077029, allCalculationResults[0].Pl3MinUplift.Value, cTolerance); - Assert.AreEqual(49.1, allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, - cTolerance); + List allCalculationResults = damProjectData.DesignCalculations; + return allCalculationResults; } + } - /// - /// Performs test BM04Opdrijven02 situation where uplift occurs 1D - /// - [Test] - [Category("Slow")] - [Category("Work_In_Progress")] - [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] - public void BM04Opdrijven02SituatieMetOpdrijven1D() - { - var cFolderName = - @"..\..\..\data\Dam\\Benchmarks\4 Validatie opdrijfberekeningen\02 Situatie met opdrijven (1D)\Databronbestand.damx"; - List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); + /// + /// Performs test BM04Opdijven01 situation without uplift 1D + /// + [Test] + [Category("Slow")] + [Category("Work_In_Progress")] + [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] + public void BM04Opdrijven01SituatieZonderOpdrijven1D() + { + const string cFolderName = + @"..\..\..\data\Dam\\Benchmarks\4 Validatie opdrijfberekeningen\01 Situatie zonder opdrijven (1D)\Databronbestand.damx"; + List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); - Assert.AreEqual(0.905914295, allCalculationResults[0].Pl3MinUplift.Value, cTolerance); - Assert.AreEqual(-1.289245668, allCalculationResults[0].Pl3HeadAdjusted.Value, cTolerance); - Assert.AreEqual(49.1, allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, cTolerance); - } + Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.AreEqual(1.024077029, allCalculationResults[0].Pl3MinUplift.Value, cTolerance); + Assert.AreEqual(49.1, allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, + cTolerance); + } - /// - /// Performs test BM04Opdrijven03 situation with a labile equilibirum 1D - /// - [Test] - [Category("Slow")] - [Category("Work_In_Progress")] - [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] - public void BM04Opdrijven03SituatieMetEenLabielEvenwicht1D() - { - var cFolderName = - @"..\..\..\data\Dam\\Benchmarks\4 Validatie opdrijfberekeningen\03 Situatie met een labiel evenwicht (1D)\Databronbestand.damx"; - List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); + /// + /// Performs test BM04Opdrijven02 situation where uplift occurs 1D + /// + [Test] + [Category("Slow")] + [Category("Work_In_Progress")] + [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] + public void BM04Opdrijven02SituatieMetOpdrijven1D() + { + const string cFolderName = + @"..\..\..\data\Dam\\Benchmarks\4 Validatie opdrijfberekeningen\02 Situatie met opdrijven (1D)\Databronbestand.damx"; + List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); - Assert.AreEqual(1.0, allCalculationResults[0].Pl3MinUplift.Value, cTolerance); - Assert.AreEqual(-1.289245668, allCalculationResults[0].Pl3HeadAdjusted.Value, cTolerance); - Assert.AreEqual(49.1, allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, cTolerance); - } + Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.AreEqual(0.905914295, allCalculationResults[0].Pl3MinUplift.Value, cTolerance); + Assert.AreEqual(-1.289245668, allCalculationResults[0].Pl3HeadAdjusted.Value, cTolerance); + Assert.AreEqual(49.1, allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, cTolerance); + } - /// - /// performs test BM04Opdrijven04 situation with an inclined ditch bottom where uplift occurs 1D - /// - [Test] - [Category("Slow")] - [Category("Work_In_Progress")] - [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] - public void BM04Opdrijven04SituatieMetEenSchuineSlootbodemEnOpdrijvenOp1Locatie1D() - { - var cFolderName = - @"..\..\..\data\Dam\Benchmarks\4 Validatie opdrijfberekeningen\04 Situatie met een schuine slootbodem en opdrijven op 1 locatie (1D)\Databronbestand.damx"; - List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); + /// + /// Performs test BM04Opdrijven03 situation with a labile equilibirum 1D + /// + [Test] + [Category("Slow")] + [Category("Work_In_Progress")] + [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] + public void BM04Opdrijven03SituatieMetEenLabielEvenwicht1D() + { + const string cFolderName = + @"..\..\..\data\Dam\\Benchmarks\4 Validatie opdrijfberekeningen\03 Situatie met een labiel evenwicht (1D)\Databronbestand.damx"; + List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); - Assert.AreEqual(0.969283045, allCalculationResults[0].Pl3MinUplift.Value, cTolerance); - Assert.AreEqual(-1.6382263, allCalculationResults[0].Pl3HeadAdjusted.Value, cTolerance); - Assert.AreEqual(49.1, allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, cTolerance); - } + Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.AreEqual(1.0, allCalculationResults[0].Pl3MinUplift.Value, cTolerance); + Assert.AreEqual(-1.289245668, allCalculationResults[0].Pl3HeadAdjusted.Value, cTolerance); + Assert.AreEqual(49.1, allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, cTolerance); + } - /// - /// Performs test BM04Opdrijven05 situation with soil layers aboven and below the phreatic line 1D - /// - [Test] - [Category("Slow")] - [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] - public void BM04Opdrijven05SituatieMetGrondlagenBovenEnOnderHetFreatischVlak1D() - { - var cFolderName = - @"..\..\..\data\Dam\\Benchmarks\4 Validatie opdrijfberekeningen\05 Situatie met grondlagen boven en onder het freatisch vlak (1D)\Databronbestand.damx"; - List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); + /// + /// performs test BM04Opdrijven04 situation with an inclined ditch bottom where uplift occurs 1D + /// + [Test] + [Category("Slow")] + [Category("Work_In_Progress")] + [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] + public void BM04Opdrijven04SituatieMetEenSchuineSlootbodemEnOpdrijvenOp1Locatie1D() + { + const string cFolderName = + @"..\..\..\data\Dam\Benchmarks\4 Validatie opdrijfberekeningen\04 Situatie met een schuine slootbodem en opdrijven op 1 locatie (1D)\Databronbestand.damx"; + List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); - bool? isUplift = allCalculationResults[0].IsUplift; - Assert.IsFalse(isUplift != null && isUplift.Value); - Assert.AreEqual(null, allCalculationResults[0].Pl3MinUplift); - Assert.AreEqual(null, allCalculationResults[0].Pl3LocalLocationXMinUplift); - } + Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.AreEqual(0.969283045, allCalculationResults[0].Pl3MinUplift.Value, cTolerance); + Assert.AreEqual(-1.6382263, allCalculationResults[0].Pl3HeadAdjusted.Value, cTolerance); + Assert.AreEqual(49.1, allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, cTolerance); + } - /// - /// Performs test BM04Opdrijven06 situation with uplift on different locations along the 1D profile - /// - [Test] - [Category("Slow")] - [Category("Work_In_Progress")] - [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] - public void BM04Opdrijven06SituatieMetOpdrijvenOpVerschillendeLocatiesLangsHetProfiel1D() - { - var cFolderName = - @"..\..\..\data\Dam\Benchmarks\4 Validatie opdrijfberekeningen\06 Situatie met verschillende opdrijflocaties (1D)\Databronbestand.damx"; - List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); + /// + /// Performs test BM04Opdrijven05 situation with soil layers aboven and below the phreatic line 1D + /// + [Test] + [Category("Slow")] + [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] + public void BM04Opdrijven05SituatieMetGrondlagenBovenEnOnderHetFreatischVlak1D() + { + const string cFolderName = + @"..\..\..\data\Dam\\Benchmarks\4 Validatie opdrijfberekeningen\05 Situatie met grondlagen boven en onder het freatisch vlak (1D)\Databronbestand.damx"; + List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); - // Values at bottom ditch dikeside - Assert.AreEqual(0.820097604, allCalculationResults[0].Pl3MinUplift.Value, cTolerance); - Assert.AreEqual(-1.289245668, allCalculationResults[0].Pl3HeadAdjusted.Value, cTolerance); - Assert.AreEqual(49.1, allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, cTolerance); - } + bool? isUplift = allCalculationResults[0].IsUplift; + Assert.IsFalse(isUplift != null && isUplift.Value); + Assert.AreEqual(null, allCalculationResults[0].Pl3MinUplift); + Assert.AreEqual(null, allCalculationResults[0].Pl3LocalLocationXMinUplift); + } - /// - /// Performs test on Dijkring13, 3 different scenarios are tested, with different uplift potentials - /// - [Test] - [Category("Slow")] - public void Dijkring13NormalStabilityCalculation() - { - const string cDikeFolder = @"..\..\..\..\..\data\Dam\Benchmarks\4 Validatie opdrijfberekeningen\Dijkring13-Sec1\Databronbestand.damx"; - List allCalculationResults = ComputeStabilityInsideProject(cDikeFolder, MStabModelType.Bishop, 1); + /// + /// Performs test BM04Opdrijven06 situation with uplift on different locations along the 1D profile + /// + [Test] + [Category("Slow")] + [Category("Work_In_Progress")] + [Ignore("DamMacroStability kernel is being replaced by Macrostability kernel in DamEngine")] + public void BM04Opdrijven06SituatieMetOpdrijvenOpVerschillendeLocatiesLangsHetProfiel1D() + { + const string cFolderName = + @"..\..\..\data\Dam\Benchmarks\4 Validatie opdrijfberekeningen\06 Situatie met verschillende opdrijflocaties (1D)\Databronbestand.damx"; + List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); - // Following values are just taken from the Geo Stability calculation and not manually calculated - Assert.AreEqual(0.785, allCalculationResults[0].StabilitySafetyFactor.Value, cTolerance); - Assert.AreEqual(0.998, allCalculationResults[1].StabilitySafetyFactor.Value, cTolerance); - Assert.AreEqual(0.792, allCalculationResults[2].StabilitySafetyFactor.Value, cTolerance); - } + Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + // Values at bottom ditch dikeside + Assert.AreEqual(0.820097604, allCalculationResults[0].Pl3MinUplift.Value, cTolerance); + Assert.AreEqual(-1.289245668, allCalculationResults[0].Pl3HeadAdjusted.Value, cTolerance); + Assert.AreEqual(49.1, allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, cTolerance); + } - /// - /// Performs test BMStabilityInwardsNoAdaptation - /// - [Test] - [Category("Slow")] - public void BMStabilityInwardsNoAdaptation() - { - var cFolderName = - @"..\..\..\..\..\data\Dam\\Benchmarks\Validatie UpliftVan\StabilityInwards-NoAdaptation\Databronbestand.damx"; - List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.UpliftVan, 1); + /// + /// Performs test on Dijkring13, 3 different scenarios are tested, with different uplift potentials + /// + [Test] + [Category("Slow")] + public void Dijkring13NormalStabilityCalculation() + { + const string cDikeFolder = @"..\..\..\..\..\data\Dam\Benchmarks\4 Validatie opdrijfberekeningen\Dijkring13-Sec1\Databronbestand.damx"; + List allCalculationResults = ComputeStabilityInsideProject(cDikeFolder, MStabModelType.Bishop, 1); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); - Assert.AreEqual(0.767, allCalculationResults[0].StabilitySafetyFactor.Value, cTolerance); - } + // Following values are just taken from the Geo Stability calculation and not manually calculated + Assert.AreEqual(0.785, allCalculationResults[0].StabilitySafetyFactor.Value, cTolerance); + Assert.AreEqual(0.998, allCalculationResults[1].StabilitySafetyFactor.Value, cTolerance); + Assert.AreEqual(0.792, allCalculationResults[2].StabilitySafetyFactor.Value, cTolerance); + } - #endregion Uplift + /// + /// Performs test BMStabilityInwardsNoAdaptation + /// + [Test] + [Category("Slow")] + public void BMStabilityInwardsNoAdaptation() + { + const string cFolderName = + @"..\..\..\..\..\data\Dam\\Benchmarks\Validatie UpliftVan\StabilityInwards-NoAdaptation\Databronbestand.damx"; + List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.UpliftVan, 1); + + Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.AreEqual(0.767, allCalculationResults[0].StabilitySafetyFactor.Value, cTolerance); } + + #endregion Uplift } \ No newline at end of file Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.BenchmarkTests/DamPipingBenchmarkTest.cs =================================================================== diff -u -r4070 -r4091 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.BenchmarkTests/DamPipingBenchmarkTest.cs (.../DamPipingBenchmarkTest.cs) (revision 4070) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.BenchmarkTests/DamPipingBenchmarkTest.cs (.../DamPipingBenchmarkTest.cs) (revision 4091) @@ -29,260 +29,259 @@ using Deltares.DamEngine.Io.XmlOutput; using NUnit.Framework; -namespace Deltares.Dam.Tests +namespace Deltares.Dam.BenchmarkTests; + +[TestFixture] +public class DamPipingBenchmarkTest { - [TestFixture] - public class DamPipingBenchmarkTest + private const double cTolerance = 0.0005; + + /// + /// Benchmark test 1 + /// + [Test] + public void Bm01OneAquiferOneLayer() { - const double cTolerance = 0.0005; + const string projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 1\Integratietest piping 1.damx"; - /// - /// Benchmark test 1 - /// - [Test] - public void Bm01OneAquiferOneLayer() - { - var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 1\Integratietest piping 1.damx"; + List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, 0); + var expectedPipingFactor = 0.506; // This is calculated according to spreadsheet + var expectedHCritical = 1.618839023; // This is calculated according to spreadsheet + double expectedLocalPipingExitPointX = 35; // This is just taken from the calculation result itself + var expectedPl3HeadAdjusted = 0.0; // For Piping, this must always be 0 + var expectedPl4HeadAdjusted = 0.0; // For Piping, this must always be 0 - List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, 0); - var expectedPipingFactor = 0.506; // This is calculated according to spreadsheet - var expectedHCritical = 1.618839023; // This is calculated according to spreadsheet - double expectedLocalPipingExitPointX = 35; // This is just taken from the calculation result itself - var expectedPl3HeadAdjusted = 0.0; // For Piping, this must always be 0 - var expectedPl4HeadAdjusted = 0.0; // For Piping, this must always be 0 + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); + Assert.AreEqual(expectedHCritical, allCalculationresults[0].Sellmeijer4ForcesHCritical.Value, cTolerance); + Assert.AreEqual(true, allCalculationresults[0].IsUplift.Value); + Assert.AreEqual(expectedLocalPipingExitPointX, allCalculationresults[0].LocalPipingExitPointX.Value, cTolerance); + Assert.AreEqual(expectedPl3HeadAdjusted, allCalculationresults[0].Pl3HeadAdjusted.Value, cTolerance); + Assert.AreEqual(expectedPl4HeadAdjusted, allCalculationresults[0].Pl4HeadAdjusted.Value, cTolerance); - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); - Assert.AreEqual(expectedHCritical, allCalculationresults[0].Sellmeijer4ForcesHCritical.Value, cTolerance); - Assert.AreEqual(true, allCalculationresults[0].IsUplift.Value); - Assert.AreEqual(expectedLocalPipingExitPointX, allCalculationresults[0].LocalPipingExitPointX.Value, cTolerance); - Assert.AreEqual(expectedPl3HeadAdjusted, allCalculationresults[0].Pl3HeadAdjusted.Value, cTolerance); - Assert.AreEqual(expectedPl4HeadAdjusted, allCalculationresults[0].Pl4HeadAdjusted.Value, cTolerance); + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, 0); + expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, 0); - expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); + // Wti2017 + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, 0); + expectedPipingFactor = 0.43219776821374467; // This is just taken from the calculation result itself + expectedHCritical = 1.9830328582839827; // This is just taken from the calculation result itself + expectedLocalPipingExitPointX = 35; // This is just taken from the calculation result itself + expectedPl3HeadAdjusted = 0.0; // This is just taken from the calculation result itself + expectedPl4HeadAdjusted = 0.0; // This is just taken from the calculation result itself + var expectedCCreep = 18.076215507286715; + var expectedEffectiveStress = 12.38; + var expectedBackwardErosionDeltaPhiReduced = 3.20; + var expectedBackwardErosionDeltaPhiC = 1.3830328582839828; + var expectedUpliftSafetyFactor = 0.33209936155373138; + var expectedUpliftHcritical = 1.2619775739041792; + var expectedUpliftDeltaPhiC = 1.2619775739041792; + var expectedHeaveSafetyFactor = 0.15789473684210525; + var expectedHeaveHcritical = 0.6; + var expectedGradient = 1.9; + double expectedSafetyFactorOverall = expectedPipingFactor; + double expectedHcriticalOverall = expectedHCritical; + Assert.That(allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, Is.EqualTo(expectedPipingFactor).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017BackwardErosionHcritical.Value, Is.EqualTo(expectedHCritical).Within(cTolerance)); + Assert.That(allCalculationresults[0].IsUplift.Value, Is.True); + Assert.That(allCalculationresults[0].LocalPipingExitPointX.Value, Is.EqualTo(expectedLocalPipingExitPointX).Within(cTolerance)); + Assert.That(allCalculationresults[0].Pl3HeadAdjusted.Value, Is.EqualTo(expectedPl3HeadAdjusted).Within(cTolerance)); + Assert.That(allCalculationresults[0].Pl4HeadAdjusted.Value, Is.EqualTo(expectedPl4HeadAdjusted).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017CCreep, Is.EqualTo(expectedCCreep).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017EffectiveStress, Is.EqualTo(expectedEffectiveStress).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017BackwardErosionDeltaPhiReduced, Is.EqualTo(expectedBackwardErosionDeltaPhiReduced).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017BackwardErosionDeltaPhiC, Is.EqualTo(expectedBackwardErosionDeltaPhiC).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017UpliftSafetyFactor, Is.EqualTo(expectedUpliftSafetyFactor).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017UpliftHcritical, Is.EqualTo(expectedUpliftHcritical).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017UpliftDeltaPhiC, Is.EqualTo(expectedUpliftDeltaPhiC).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017HeaveSafetyFactor, Is.EqualTo(expectedHeaveSafetyFactor).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017HeaveHcritical, Is.EqualTo(expectedHeaveHcritical).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017Gradient, Is.EqualTo(expectedGradient).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017SafetyFactorOverall, Is.EqualTo(expectedSafetyFactorOverall).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017HcriticalOverall, Is.EqualTo(expectedHcriticalOverall).Within(cTolerance)); + } - // Wti2017 - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, 0); - expectedPipingFactor = 0.43219776821374467; // This is just taken from the calculation result itself - expectedHCritical = 1.9830328582839827; // This is just taken from the calculation result itself - expectedLocalPipingExitPointX = 35; // This is just taken from the calculation result itself - expectedPl3HeadAdjusted = 0.0; // This is just taken from the calculation result itself - expectedPl4HeadAdjusted = 0.0; // This is just taken from the calculation result itself - var expectedCCreep = 18.076215507286715; - var expectedEffectiveStress = 12.38; - var expectedBackwardErosionDeltaPhiReduced = 3.20; - var expectedBackwardErosionDeltaPhiC = 1.3830328582839828; - var expectedUpliftSafetyFactor = 0.33209936155373138; - var expectedUpliftHcritical = 1.2619775739041792; - var expectedUpliftDeltaPhiC = 1.2619775739041792; - var expectedHeaveSafetyFactor = 0.15789473684210525; - var expectedHeaveHcritical = 0.6; - var expectedGradient = 1.9; - double expectedSafetyFactorOverall = expectedPipingFactor; - double expectedHcriticalOverall = expectedHCritical; - Assert.That(allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, Is.EqualTo(expectedPipingFactor).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017BackwardErosionHcritical.Value, Is.EqualTo(expectedHCritical).Within(cTolerance)); - Assert.That(allCalculationresults[0].IsUplift.Value, Is.True); - Assert.That(allCalculationresults[0].LocalPipingExitPointX.Value, Is.EqualTo(expectedLocalPipingExitPointX).Within(cTolerance)); - Assert.That(allCalculationresults[0].Pl3HeadAdjusted.Value, Is.EqualTo(expectedPl3HeadAdjusted).Within(cTolerance)); - Assert.That(allCalculationresults[0].Pl4HeadAdjusted.Value, Is.EqualTo(expectedPl4HeadAdjusted).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017CCreep, Is.EqualTo(expectedCCreep).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017EffectiveStress, Is.EqualTo(expectedEffectiveStress).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017BackwardErosionDeltaPhiReduced, Is.EqualTo(expectedBackwardErosionDeltaPhiReduced).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017BackwardErosionDeltaPhiC, Is.EqualTo(expectedBackwardErosionDeltaPhiC).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017UpliftSafetyFactor, Is.EqualTo(expectedUpliftSafetyFactor).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017UpliftHcritical, Is.EqualTo(expectedUpliftHcritical).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017UpliftDeltaPhiC, Is.EqualTo(expectedUpliftDeltaPhiC).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017HeaveSafetyFactor, Is.EqualTo(expectedHeaveSafetyFactor).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017HeaveHcritical, Is.EqualTo(expectedHeaveHcritical).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017Gradient, Is.EqualTo(expectedGradient).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017SafetyFactorOverall, Is.EqualTo(expectedSafetyFactorOverall).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017HcriticalOverall, Is.EqualTo(expectedHcriticalOverall).Within(cTolerance)); - } + /// + /// Benchmark test 2 + /// + [Test] + public void Bm02OneAquiferTwoLayers() + { + var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 2\Integratietest piping 2.damx"; - /// - /// Benchmark test 2 - /// - [Test] - public void Bm02OneAquiferTwoLayers() - { - var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 2\Integratietest piping 2.damx"; + List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, 0); + var expectedPipingFactor = 0.489; // This is calculated according to spreadsheet + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); - List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, 0); - var expectedPipingFactor = 0.489; // This is calculated according to spreadsheet - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, 0); + expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, 0); - expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); + // Wti2017 + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, 0); + expectedPipingFactor = 0.42241892923665264; // This is just taken from the calculation result itself + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, cTolerance); + } - // Wti2017 - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, 0); - expectedPipingFactor = 0.42241892923665264; // This is just taken from the calculation result itself - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, cTolerance); - } + /// + /// Benchmark test 3 + /// + [Test] + public void Bm03OneAquiferThreeLayers() + { + var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 3\Integratietest piping 3.damx"; - /// - /// Benchmark test 3 - /// - [Test] - public void Bm03OneAquiferThreeLayers() - { - var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 3\Integratietest piping 3.damx"; + List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, 0); + var expectedPipingFactor = 0.494; // This is calculated according to spreadsheet + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); - List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, 0); - var expectedPipingFactor = 0.494; // This is calculated according to spreadsheet - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, 0); + expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, 0); - expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); + // Wti2017 + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, 0); + expectedPipingFactor = 0.4275708873438484; // This is just taken from the calculation result itself + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, cTolerance); + } - // Wti2017 - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, 0); - expectedPipingFactor = 0.4275708873438484; // This is just taken from the calculation result itself - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, cTolerance); - } + /// + /// Benchmark test 4 + /// + [Test] + public void Bm04TwoAquifersOneLayer() + { + var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 4\Integratietest piping 4.damx"; - /// - /// Benchmark test 4 - /// - [Test] - public void Bm04TwoAquifersOneLayer() - { - var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 4\Integratietest piping 4.damx"; + List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, 0); + var expectedPipingFactor = 0.608; // This is calculated according to spreadsheet + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); - List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, 0); - var expectedPipingFactor = 0.608; // This is calculated according to spreadsheet - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, 0); + expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, 0); - expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); + // Wti2017 is not supported for now + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, 0); + expectedPipingFactor = 0.50501856442086579; // This is just taken from the calculation result itself + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, cTolerance); + } - // Wti2017 is not supported for now - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, 0); - expectedPipingFactor = 0.50501856442086579; // This is just taken from the calculation result itself - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, cTolerance); - } + /// + /// Benchmark test 5 + /// + [Test] + public void Bm05TwoAquifersTwoLayers() + { + var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 5\Integratietest piping 5.damx"; - /// - /// Benchmark test 5 - /// - [Test] - public void Bm05TwoAquifersTwoLayers() - { - var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 5\Integratietest piping 5.damx"; + List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, 0); + var expectedPipingFactor = 0.618; // This is calculated according to spreadsheet + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); - List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, 0); - var expectedPipingFactor = 0.618; // This is calculated according to spreadsheet - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, 0); + expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, 0); - expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); + // Wti2017 is not supported for now + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, 0); + expectedPipingFactor = 0.51473283261943303; // This is just taken from the calculation result itself + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, cTolerance); + } - // Wti2017 is not supported for now - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, 0); - expectedPipingFactor = 0.51473283261943303; // This is just taken from the calculation result itself - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, cTolerance); - } - - /// - /// Compute project - /// - /// - /// - private static List ComputeProject(string projectFilename, PipingModelType pipingModel, double distanceToEntryPoint) + /// + /// Compute project + /// + /// + /// + private static List ComputeProject(string projectFilename, PipingModelType pipingModel, double distanceToEntryPoint) + { + // Read dikering + using (DamProjectData damProjectData = ProjectLoader.LoadProjectData(projectFilename)) { - // Read dikering - using (DamProjectData damProjectData = ProjectLoader.LoadProjectData(projectFilename)) + AnalysisType analysisType = DamProjectCalculationSpecification.SelectedAnalysisType; + try { - AnalysisType analysisType = DamProjectCalculationSpecification.SelectedAnalysisType; - try - { - Assert.AreEqual(1, damProjectData.WaterBoard.Dikes.Count); - Dike dike = damProjectData.WaterBoard.Dikes[0]; - Assert.AreEqual(1, dike.Locations.Count); - dike.Locations[0].DistanceToEntryPoint = distanceToEntryPoint; - damProjectData.DamProjectCalculationSpecification.CurrentSpecification.PipingModelType = pipingModel; - DamProjectCalculationSpecification.SelectedAnalysisType = AnalysisType.NoAdaption; + Assert.AreEqual(1, damProjectData.WaterBoard.Dikes.Count); + Dike dike = damProjectData.WaterBoard.Dikes[0]; + Assert.AreEqual(1, dike.Locations.Count); + dike.Locations[0].DistanceToEntryPoint = distanceToEntryPoint; + damProjectData.DamProjectCalculationSpecification.CurrentSpecification.PipingModelType = pipingModel; + DamProjectCalculationSpecification.SelectedAnalysisType = AnalysisType.NoAdaption; - Input input = FillXmlInputFromDamUi.CreateInput(damProjectData); + Input input = FillXmlInputFromDamUi.CreateInput(damProjectData); #if DEBUG - const string inputFilename = "PipingBlighTestInputFile.xml"; - DamXmlSerialization.SaveInputAsXmlFile(inputFilename, input); + const string inputFilename = "PipingBlighTestInputFile.xml"; + DamXmlSerialization.SaveInputAsXmlFile(inputFilename, input); #endif - string inputXml = DamXmlSerialization.SaveInputAsXmlString(input); + string inputXml = DamXmlSerialization.SaveInputAsXmlString(input); - var damEnginInterface = new EngineInterface(inputXml); - string validationMessages = damEnginInterface.Validate(); + var damEnginInterface = new EngineInterface(inputXml); + string validationMessages = damEnginInterface.Validate(); - if (string.IsNullOrEmpty(validationMessages)) - { - // only if validation is ok, then - string outputXml = damEnginInterface.Run(); - Output output = DamXmlSerialization.LoadOutputFromXmlString(outputXml); + if (string.IsNullOrEmpty(validationMessages)) + { + // only if validation is ok, then + string outputXml = damEnginInterface.Run(); + Output output = DamXmlSerialization.LoadOutputFromXmlString(outputXml); #if DEBUG - const string outputFilename = "PipingBMTestOutputFile.xml"; - DamXmlSerialization.SaveOutputAsXmlFile(outputFilename, output); + const string outputFilename = "PipingBMTestOutputFile.xml"; + DamXmlSerialization.SaveOutputAsXmlFile(outputFilename, output); #endif - FillDamUiFromXmlOutput.AddOutputToDamProjectData(damProjectData, output); - } + FillDamUiFromXmlOutput.AddOutputToDamProjectData(damProjectData, output); } - finally - { - DamProjectCalculationSpecification.SelectedAnalysisType = analysisType; - } - - List allCalculationresults = damProjectData.DesignCalculations; - return allCalculationresults; } + finally + { + DamProjectCalculationSpecification.SelectedAnalysisType = analysisType; + } + + List allCalculationresults = damProjectData.DesignCalculations; + return allCalculationresults; } + } - /// - /// Benchmark test 6, based on 5 - /// It is used to show that DistanceToEntryPoint - /// - has no influence at all on DamPiping models - /// - has influence on wti model (SellmeijerRevised) - /// - [TestCase(0, 0.51473283261943303, 25, 2.2471450643821855, 15.177776712324395)] - [TestCase(10, 0.69719708066856745, 35, 2.8310306581394156, 15.687816692392971)] - [TestCase(-10, 0.32597553155657433, 15, 1.2619775739041792, 14.379913662895481)] - public void Bm06TwoAquifersTwoLayersWithDifferentDistanceToEntryPoint(double distanceToEntryPoint, double expectedWtiPipingFactor, - double expectedSeepageLength, double expectedHc, double expectedCCreep) - { - var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 5\Integratietest piping 5.damx"; + /// + /// Benchmark test 6, based on 5 + /// It is used to show that DistanceToEntryPoint + /// - has no influence at all on DamPiping models + /// - has influence on wti model (SellmeijerRevised) + /// + [TestCase(0, 0.51473283261943303, 25, 2.2471450643821855, 15.177776712324395)] + [TestCase(10, 0.69719708066856745, 35, 2.8310306581394156, 15.687816692392971)] + [TestCase(-10, 0.32597553155657433, 15, 1.2619775739041792, 14.379913662895481)] + public void Bm06TwoAquifersTwoLayersWithDifferentDistanceToEntryPoint(double distanceToEntryPoint, double expectedWtiPipingFactor, + double expectedSeepageLength, double expectedHc, double expectedCCreep) + { + var projectFilename = @"..\..\..\..\..\data\Dam\Benchmarks\Piping\Test 5\Integratietest piping 5.damx"; - List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, distanceToEntryPoint); - var expectedPipingFactor = 0.618; // This is calculated according to spreadsheet - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); + List allCalculationresults = ComputeProject(projectFilename, PipingModelType.Sellmeijer4Forces, distanceToEntryPoint); + var expectedPipingFactor = 0.618; // This is calculated according to spreadsheet + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].Sellmeijer4ForcesPipingFactor.Value, cTolerance); - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, distanceToEntryPoint); - expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself - Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Bligh, distanceToEntryPoint); + expectedPipingFactor = 0.5208; // This is just taken from the calculation result itself + Assert.AreEqual(expectedPipingFactor, allCalculationresults[0].BlighPipingFactor.Value, cTolerance); - // Wti2017 is not supported for now - allCalculationresults.Clear(); - allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, distanceToEntryPoint); - Assert.That(allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, Is.EqualTo(expectedWtiPipingFactor).Within(cTolerance)); - Assert.That(allCalculationresults[0].SeepageLength.Value, Is.EqualTo(expectedSeepageLength).Within(cTolerance)); - Assert.That(allCalculationresults[0].HCritical.Value, Is.EqualTo(expectedHc).Within(cTolerance)); - Assert.That(allCalculationresults[0].Wti2017CCreep, Is.EqualTo(expectedCCreep).Within(cTolerance)); - } + // Wti2017 is not supported for now + allCalculationresults.Clear(); + allCalculationresults = ComputeProject(projectFilename, PipingModelType.Wti2017, distanceToEntryPoint); + Assert.That(allCalculationresults[0].Wti2017BackwardErosionSafetyFactor.Value, Is.EqualTo(expectedWtiPipingFactor).Within(cTolerance)); + Assert.That(allCalculationresults[0].SeepageLength.Value, Is.EqualTo(expectedSeepageLength).Within(cTolerance)); + Assert.That(allCalculationresults[0].HCritical.Value, Is.EqualTo(expectedHc).Within(cTolerance)); + Assert.That(allCalculationresults[0].Wti2017CCreep, Is.EqualTo(expectedCCreep).Within(cTolerance)); } } \ No newline at end of file