// Copyright (C) Stichting Deltares 2024. All rights reserved. // // This file is part of the Dam Engine. // // The Dam Engine is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. using System.IO; using Deltares.DamEngine.Io.XmlOutput; using Deltares.DamEngine.TestHelpers; using NUnit.Framework; namespace Deltares.DamEngine.IntegrationTests.IntegrationTests; [TestFixture] public class MacroStabilityOutwardsTests { private const double Tolerance = 0.0005; [Test] [TestCase("InputFileForStabOutsideBishopAutomaticGrid.xml", 0.976)] [TestCase("InputFileForStabOutsideBishopSpecifiedGrid.xml", 0.975)] public void TestDoesBishopOutwardsProduceResults(string fileName, double factorOfSafety) { // Expected results are taken as they came as calculated const string calcDir = "TestOutStabBishop"; if (Directory.Exists(calcDir)) { Directory.Delete(calcDir, true); // delete previous results } Directory.CreateDirectory(calcDir); string fullFileName = @"TestFiles\" + fileName; string inputString = File.ReadAllText(fullFileName); inputString = XmlAdapter.ChangeValueInXml(inputString, "ProjectPath", "Minimale Invoer Stability"); // Current directory will be used Output output = GeneralHelper.RunAfterInputValidation(inputString); Assert.That(output.Results.CalculationResults[0].StabilityDesignResults.SafetyFactor, Is.EqualTo(factorOfSafety).Within(Tolerance)); } }