Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DesignCalculatorTests.cs =================================================================== diff -u -r4000 -r4052 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DesignCalculatorTests.cs (.../DesignCalculatorTests.cs) (revision 4000) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DesignCalculatorTests.cs (.../DesignCalculatorTests.cs) (revision 4052) @@ -27,84 +27,83 @@ using Deltares.DamEngine.Io.XmlOutput; using NUnit.Framework; -namespace Deltares.DamEngine.IntegrationTests.IntegrationTests +namespace Deltares.DamEngine.IntegrationTests.IntegrationTests; + +public class DesignCalculatorTests { - public class DesignCalculatorTests + [Test] + [SetUICulture("en-US")] + public void MessageWhenNoPipingSegmentsFound() { - [Test] - [SetUICulture("en-US")] - public void MessageWhenNoPipingSegmentsFound() - { - // Based on ".\data\DamEngineTestProjects\PipingVoorbeeld1\PipingVoorbeeld1.damx" - // but without piping segments for piping - // Set Analysis type to "No Adaption" - // Set model to Piping Sellmeijer Revised (WBI) - // Select first location (100) - 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); - 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); - } + // Based on ".\data\DamEngineTestProjects\PipingVoorbeeld1\PipingVoorbeeld1.damx" + // but without piping segments for piping + // Set Analysis type to "No Adaption" + // Set model to Piping Sellmeijer Revised (WBI) + // Select first location (100) + 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); + 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); + } - [Test] - [SetUICulture("nl-NL")] - public void MessageWhenNoStabilityInsideSegmentsFound() - { - // Based on ".\data\DamEngineTestProjects\Larenstein_AaenMaas\Rechter Diezedijk.damx" - // Set Analysis type to "No Adaption" - // Select Failure mechanism Stability Inside - // Select second location (101) - 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); - 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); - } + [Test] + [SetUICulture("nl-NL")] + public void MessageWhenNoStabilityInsideSegmentsFound() + { + // Based on ".\data\DamEngineTestProjects\Larenstein_AaenMaas\Rechter Diezedijk.damx" + // Set Analysis type to "No Adaption" + // Select Failure mechanism Stability Inside + // Select second location (101) + 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); + 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); + } - [Test] - [SetUICulture("nl-NL")] - public void TestInvalidInputXMLForOldDGeoStability() - { - // Based on InputFile.xml as produced by DAM UI in debug mode - 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); - // 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( - "De berekening is mislukt met de volgende foutmelding"), output.Results.CalculationMessages[0].Message1); - } + [Test] + [SetUICulture("nl-NL")] + public void TestInvalidInputXMLForOldDGeoStability() + { + // Based on InputFile.xml as produced by DAM UI in debug mode + 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); + // 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( + "De berekening is mislukt met de volgende foutmelding"), output.Results.CalculationMessages[0].Message1); + } - [Test] - [SetUICulture("nl-NL")] - public void TestValidInputXML() - { - // Based on DeltaDijkInputFile.xml (1D, UpliftVan, Design, No Adaption) as produced by DAM UI in debug mode - 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); - // 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); - } + [Test] + [SetUICulture("nl-NL")] + public void TestValidInputXML() + { + // Based on DeltaDijkInputFile.xml (1D, UpliftVan, Design, No Adaption) as produced by DAM UI in debug mode + 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); + // 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); } } \ No newline at end of file