Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DebuggingTest.cs =================================================================== diff -u -r4185 -r4248 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DebuggingTest.cs (.../DebuggingTest.cs) (revision 4185) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DebuggingTest.cs (.../DebuggingTest.cs) (revision 4248) @@ -26,6 +26,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; @@ -41,20 +42,26 @@ /// 2) Copy the file to src\Deltares.DamEngine.IntegrationTests\TestFiles\InputForDebugging.xml /// 3) Run the test in Debugging mode /// - [Test, Ignore("This test is only used for debugging XML files generated by Dam UI")] - public void DebugWithXmlInputFile() + [Test]//, Ignore("This test is only used for debugging XML files generated by Dam UI")] + [TestCase(1)] + [TestCase(8)] + public void DebugWithXmlInputFile(int maxCores) { - const string inputFilename = "InputForDebugging.xml"; // or put your own name here; + const string inputFilename = "PipingVoorbeeld1_WtiSellmeijerRevisedInputFile.xml"; string fullInputFilename = Path.Combine(mapTestFiles, inputFilename); Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; string inputString = File.ReadAllText(fullInputFilename); var engineInterface = new EngineInterface(inputString); Assert.IsNotNull(engineInterface.DamProjectData); + engineInterface.DamProjectData.MaxCalculationCores = maxCores; 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("Output.xml", outputString); + string outputName = "PipingVoorbeeld1_WtiSellmeijerRevisedInputFileOutput" + maxCores + ".xml"; + File.WriteAllText(outputName, outputString); Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + int errorCount = GeneralHelper.DetermineNumberOfCalculationErrors(engineInterface.DamProjectData.CalculationMessages); + Assert.AreEqual(0, errorCount, "There should be nor errors during the calculation."); if (engineInterface.DamProjectData.DamProjectType == DamProjectType.Design) { Assert.AreNotEqual(null, output.Results.CalculationResults); @@ -64,4 +71,36 @@ Assert.AreNotEqual(null, output.Results.OperationalOutputTimeSeries); } } + + [Test]//, Ignore("This test is only used for debugging XML files generated by Dam UI")] + [TestCase(1,"InputFileOnnoBligh.xml")] + [TestCase(1,"InputFileOnnoWbiSellmeijer.xml")] + [TestCase(8,"InputFileOnnoBligh.xml")] + [TestCase(8,"InputFileOnnoWbiSellmeijer.xml")] + public void DebugProblemOnno(int maxCores, string fileName) + { + string fullInputFilename = Path.Combine(mapTestFiles, fileName); + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; + string inputString = File.ReadAllText(fullInputFilename); + var engineInterface = new EngineInterface(inputString); + Assert.IsNotNull(engineInterface.DamProjectData); + engineInterface.DamProjectData.MaxCalculationCores = maxCores; + string result = engineInterface.Validate(); + Assert.IsTrue(result == null, "Validation must succeed but does not, see output xml in debugger"); + string outputString = engineInterface.Run(); + string outputName = fileName + maxCores + ".xml"; + File.WriteAllText(outputName, outputString); + Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + int errorCount = GeneralHelper.DetermineNumberOfCalculationErrors(engineInterface.DamProjectData.CalculationMessages); + Assert.AreEqual(0, errorCount, "There should be nor errors during the calculation."); + if (engineInterface.DamProjectData.DamProjectType == DamProjectType.Design) + { + Assert.AreNotEqual(null, output.Results.CalculationResults); + } + else + { + Assert.AreNotEqual(null, output.Results.OperationalOutputTimeSeries); + } + } + } \ No newline at end of file