Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/LocationJobTests.cs =================================================================== diff -u --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/LocationJobTests.cs (revision 0) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/LocationJobTests.cs (revision 6705) @@ -0,0 +1,65 @@ +// 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)] + 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)); + } + +} \ No newline at end of file Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/LocationJob.cs =================================================================== diff -u -r6702 -r6705 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/LocationJob.cs (.../LocationJob.cs) (revision 6702) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/LocationJob.cs (.../LocationJob.cs) (revision 6705) @@ -137,10 +137,10 @@ return false; } } - - public static bool IsUpliftVanNoUplift(CsvExportData calculationResult) + + internal static bool IsUpliftVanNoUplift(CsvExportData calculationResult) { - if (calculationResult != null) + if (calculationResult is { DamFailureMechanismeCalculation: not null }) { return calculationResult.DamFailureMechanismeCalculation.FailureMechanismSystemType == FailureMechanismSystemType.StabilityInside && calculationResult.DamFailureMechanismeCalculation.StabilityModelType == StabilityModelType.UpliftVan &&