Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DebuggingTest.cs =================================================================== diff -u -r4372 -r4474 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DebuggingTest.cs (.../DebuggingTest.cs) (revision 4372) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DebuggingTest.cs (.../DebuggingTest.cs) (revision 4474) @@ -51,25 +51,11 @@ 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(); string outputName = "PipingVoorbeeld1_WtiSellmeijerRevisedInputFileOutput" + maxCores + ".xml"; - File.WriteAllText(outputName, outputString); - Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + var engineInterface = new EngineInterface(inputString); + GeneralHelper.RunAfterInputValidation(engineInterface, true, outputName); 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); - } } [Test, Ignore("This test is only used for debugging XML files generated by Dam UI")] @@ -82,25 +68,11 @@ 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); + var engineInterface = new EngineInterface(inputString); + GeneralHelper.RunAfterInputValidation(engineInterface, true, outputName); + 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