Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityOutwardsTests.cs =================================================================== diff -u -r4476 -r4498 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityOutwardsTests.cs (.../MacroStabilityOutwardsTests.cs) (revision 4476) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityOutwardsTests.cs (.../MacroStabilityOutwardsTests.cs) (revision 4498) @@ -49,7 +49,6 @@ Output output = GeneralHelper.RunAfterInputValidation(inputString); - Assert.IsNotNull(output.Results.CalculationResults, "Results available when not expected"); Assert.AreEqual(factorOfSafety, output.Results.CalculationResults[0].StabilityDesignResults.SafetyFactor, Tolerance); } } \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DesignCalculatorTests.cs =================================================================== diff -u -r4052 -r4498 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DesignCalculatorTests.cs (.../DesignCalculatorTests.cs) (revision 4052) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DesignCalculatorTests.cs (.../DesignCalculatorTests.cs) (revision 4498) @@ -25,6 +25,7 @@ using Deltares.DamEngine.Interface; using Deltares.DamEngine.Io; using Deltares.DamEngine.Io.XmlOutput; +using Deltares.DamEngine.TestHelpers; using NUnit.Framework; namespace Deltares.DamEngine.IntegrationTests.IntegrationTests; @@ -43,10 +44,9 @@ Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; const string fileName = @"TestFiles\PipingVoorbeeld1_WtiSellmeijerRevisedNoPipingInputFile.xml"; string inputString = File.ReadAllText(fileName); - var engineInterface = new EngineInterface(inputString); - Assert.IsNotNull(engineInterface.DamProjectData); - string outputString = engineInterface.Run(); - Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + + Output output = GeneralHelper.RunAfterInputValidation(inputString, false); + Assert.AreEqual(1, output.Results.CalculationMessages.Length); Assert.AreEqual(null, output.Results.CalculationResults); Assert.AreEqual("No segments with failure mechanism Piping present", output.Results.CalculationMessages[0].Message1); @@ -63,10 +63,9 @@ Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; const string fileName = @"TestFiles\Rechter Diezedijk_NoStabilityInsideInputFile.xml"; string inputString = File.ReadAllText(fileName); - var engineInterface = new EngineInterface(inputString); - Assert.IsNotNull(engineInterface.DamProjectData); - string outputString = engineInterface.Run(); - Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + + Output output = GeneralHelper.RunAfterInputValidation(inputString, false); + Assert.AreEqual(1, output.Results.CalculationMessages.Length); Assert.AreEqual(null, output.Results.CalculationResults); Assert.AreEqual("Geen segmenten met faalmechanisme StabilityInside aanwezig", output.Results.CalculationMessages[0].Message1); @@ -80,10 +79,9 @@ Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; const string fileName = @"TestFiles\InputFileForDGeoStability.xml"; string inputString = File.ReadAllText(fileName); - var engineInterface = new EngineInterface(inputString); - Assert.IsNotNull(engineInterface.DamProjectData); - string outputString = engineInterface.Run(); - Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + + Output output = GeneralHelper.RunAfterInputValidation(inputString, false); + // As the data is not entirely correct for the new kernel, we expect 1 error. Assert.AreEqual(1, output.Results.CalculationMessages.Length); Assert.IsTrue(output.Results.CalculationMessages[0].Message1.Contains( @@ -98,10 +96,9 @@ Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; const string fileName = @"TestFiles\DeltaDijkInputFile.xml"; string inputString = File.ReadAllText(fileName); - var engineInterface = new EngineInterface(inputString); - Assert.IsNotNull(engineInterface.DamProjectData); - string outputString = engineInterface.Run(); - Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + + Output output = GeneralHelper.RunAfterInputValidation(inputString); + // We get 606 warnings in total when using the official release of the macro stability kernel. When we use the latest trunk version, we get 619 errors // So as long as the latest version is not (yet) released we have to check both values because otherwise it will either fail locally or on TC. Assert.IsTrue(606 == output.Results.CalculationMessages.Length || 619 == output.Results.CalculationMessages.Length, "Number of messages found = " + output.Results.CalculationMessages.Length); Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityInwardsTests.cs =================================================================== diff -u -r4497 -r4498 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityInwardsTests.cs (.../MacroStabilityInwardsTests.cs) (revision 4497) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityInwardsTests.cs (.../MacroStabilityInwardsTests.cs) (revision 4498) @@ -540,7 +540,6 @@ Output output = GeneralHelper.RunAfterInputValidation(inputString, false); - Assert.IsNull(output.Results.CalculationResults); Assert.AreEqual("Location 'DWP_13', subsoil scenario 'DWP_13.sti', design scenario '1': " + "The calculation failed with error message " + "'The design was not successful. " + @@ -566,12 +565,9 @@ { Directory.Delete(calcDir, true); // delete previous results } + + Output output = GeneralHelper.RunAfterInputValidation(engineInterface, true, "Results_Single_Core" + ".xml"); - string result = engineInterface.Validate(); - Assert.IsTrue(result == null, "Validation must succeed but does not, see output xml in debugger"); - string outputString = engineInterface.Run(); - File.WriteAllText("Results_Single_Core" + ".xml", outputString); - Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); Assert.AreEqual(18, output.Results.CalculationResults.Length); Assert.AreEqual(3020, output.Results.CalculationMessages.Length); int resultsFound = CheckLargeResultsSets.CheckResultsDesignBishopAdaptionWithScenariosForHeadPl3CalculatesCorrect( @@ -678,7 +674,6 @@ Output output = GeneralHelper.RunAfterInputValidation(inputString, false); - Assert.IsNull(output.Results.CalculationResults); Assert.AreEqual(2, output.Results.CalculationMessages.Length); Assert.AreEqual(MessageMessageType.Warning, output.Results.CalculationMessages[0].MessageType); Assert.AreEqual("Geen ondergrond profielen beschikbaar voor locatie '12-2_027'", output.Results.CalculationMessages[0].Message1); Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MultiCoreMacroStabilityTests.cs =================================================================== diff -u -r4491 -r4498 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MultiCoreMacroStabilityTests.cs (.../MultiCoreMacroStabilityTests.cs) (revision 4491) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MultiCoreMacroStabilityTests.cs (.../MultiCoreMacroStabilityTests.cs) (revision 4498) @@ -219,23 +219,17 @@ { Directory.Delete(calcDir, true); // delete previous results } - string result = engineInterface.Validate(); - Assert.IsTrue(result == null, "Validation must succeed but does not, see output xml in debugger"); - string outputString = engineInterface.Run(); - // Note that all results are based on the single core version of this tests that can be found at: - // DesignBishopOptimizedSlopeAndShoulderAdaptionWithScenariosForHeadPL3CalculatesCorrect in MacroStabilityInwardsTests - Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + string outputFileName = "Results_Cores_" + maxCores + ".xml"; if (justOneScenario) { outputFileName = "Results_OneScenario_Cores_" + maxCores + ".xml"; - DamXmlSerialization.SaveOutputAsXmlFile(outputFileName, output); } - else - { - DamXmlSerialization.SaveOutputAsXmlFile(outputFileName, output); - } + Output output = GeneralHelper.RunAfterInputValidation(engineInterface, true, outputFileName); + + // Note that all results are based on the single core version of this tests that can be found at: + // DesignBishopOptimizedSlopeAndShoulderAdaptionWithScenariosForHeadPL3CalculatesCorrect in MacroStabilityInwardsTests if (justOneScenario) { Assert.AreEqual(9, output.Results.CalculationResults.Length); @@ -287,14 +281,12 @@ { Directory.Delete(calcDir, true); // delete previous results } - string result = engineInterface.Validate(); - Assert.IsTrue(result == null, "Validation must succeed but does not, see output xml in debugger"); - string outputString = engineInterface.Run(); + + string outputFileName = "LargeInsideBishopNoAdaptionGridResults_Cores_" + maxCores + ".xml"; + Output output = GeneralHelper.RunAfterInputValidation(engineInterface, true, outputFileName); + // Note that all results are based on the single core version of this tests that can be found at: // DesignBishopOptimizedSlopeAndShoulderAdaptionWithScenariosForHeadPL3CalculatesCorrect in MacroStabilityInwardsTests - Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); - string outputFileName = "LargeInsideBishopNoAdaptionGridResults_Cores_" + maxCores + ".xml"; - DamXmlSerialization.SaveOutputAsXmlFile(outputFileName, output); Assert.AreEqual(718, output.Results.CalculationResults.Length); Assert.AreEqual(2497, output.Results.CalculationMessages.Length); CheckLargeResultsSets.CheckBasicResultsBasedOnReferenceResultsFile( Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalGrebbedijkTests.cs =================================================================== diff -u -r4481 -r4498 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalGrebbedijkTests.cs (.../OperationalGrebbedijkTests.cs) (revision 4481) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalGrebbedijkTests.cs (.../OperationalGrebbedijkTests.cs) (revision 4498) @@ -73,21 +73,7 @@ inputString = XmlAdapter.ChangeValueInXml(inputString, "CalculationMap", calcDir); // Current directory will be used inputString = XmlAdapter.ChangeValueInXml(inputString, "MapForSoilgeometries2D", baseTestDirectory + @"Operational\Grebbedijk\input.Geometries\"); inputString = XmlAdapter.ChangeValueInXml(inputString, "SoilDatabaseName", baseTestDirectory + @"Operational\Grebbedijk\input0.soilmaterials.mdb"); - var engineInterface = new EngineInterface(inputString); - Assert.IsNotNull(engineInterface.DamProjectData); - foreach (Location dikeLocation in engineInterface.DamProjectData.Dike.Locations) - { - var scenario = new DesignScenario(); - scenario.RiverLevel = dikeLocation.SurfaceLine.CharacteristicPoints - .GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Z + 1.5; - scenario.PolderLevel = dikeLocation.SurfaceLine.CharacteristicPoints - .GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z - 0.6; - scenario.HeadPl3 = 1; - scenario.HeadPl4 = scenario.PolderLevel; - scenario.RequiredSafetyFactorStabilityInnerSlope = 1.2; - dikeLocation.Scenarios.Add(scenario); - } - + Output output = GeneralHelper.RunAfterInputValidation(inputString, true, outputFileName); Assert.AreEqual(2.321, output.Results.OperationalOutputTimeSeries[0].Entries.TimeSerieEntry[0].Value, tolerance);