// Copyright (C) Stichting Deltares 2025. All rights reserved. // // This file is part of the application DAM - UI. // // DAM - UI is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // // You should have received a copy of the GNU 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 Deltares.Dam.Data; using NUnit.Framework; namespace Deltares.Dam.Tests; [TestFixture] public class LocationJobTests { [Test] public void GivenCalculationResultNotDefined_WhenIsUpliftVanNoUplift_ThenResultIsFalse() { bool isUpliftVanNoUplift = LocationJob.IsUpliftVanNoUplift(null); Assert.That(isUpliftVanNoUplift, Is.False); } [Test] public void GivenDamFailureMechanismCalculationNotDefined_WhenIsUpliftVanNoUplift_ThenResultIsFalse() { var calculationResult = new CsvExportData(); bool isUpliftVanNoUplift = LocationJob.IsUpliftVanNoUplift(calculationResult); Assert.That(isUpliftVanNoUplift, Is.False); } [Test] [TestCase(FailureMechanismSystemType.StabilityInside, StabilityModelType.UpliftVan, true, false)] [TestCase(FailureMechanismSystemType.StabilityInside, StabilityModelType.UpliftVan, false, true)] [TestCase(FailureMechanismSystemType.Piping, StabilityModelType.UpliftVan, false, false)] [TestCase(FailureMechanismSystemType.StabilityInside, StabilityModelType.Bishop, false, false)] [TestCase(FailureMechanismSystemType.StabilityInside, StabilityModelType.BishopUpliftVan, false, false)] public void GivenValidResult_WhenDetermineIsUpliftVanNoUplift_ThenResultIsAsExpected(FailureMechanismSystemType failureMechanismSystemType, StabilityModelType stabilityModelType, bool isUplift, bool isExpected) { var calculationResult = new CsvExportData { DamFailureMechanismeCalculation = new DamFailureMechanismeCalculationSpecification { FailureMechanismSystemType = failureMechanismSystemType, StabilityModelType = stabilityModelType }, IsUplift = isUplift }; bool isUpliftVanNoUplift = LocationJob.IsUpliftVanNoUplift(calculationResult); Assert.That(isUpliftVanNoUplift, Is.EqualTo(isExpected)); } }