// Copyright (C) Stichting Deltares 2026. All rights reserved. // // This file is part of the application DAM - Live. // // DAM - Live 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 Deltares.Dam.Data; using Deltares.DamLive.Application; using Deltares.DamLive.Io; using NUnit.Framework; using StabilitySearchMethod = Deltares.DamLive.Io.StabilitySearchMethod; namespace Deltares.DamLive.Tests; [TestFixture] public class XmlConversionHelperTests { [Test] [TestCase(StabilitySearchMethod.Grid, Dam.Data.StabilitySearchMethod.Grid)] [TestCase(StabilitySearchMethod.BeeSwarm, Dam.Data.StabilitySearchMethod.BeeSwarm)] public void CanConvertToDataSearchMethodType(StabilitySearchMethod xmlType, Dam.Data.StabilitySearchMethod dataType) { Assert.That(XmlConversionHelper.ConvertToSearchMethod(xmlType), Is.EqualTo(dataType)); } [Test] [TestCase(Dam.Data.StabilitySearchMethod.Grid, StabilitySearchMethod.Grid)] [TestCase(Dam.Data.StabilitySearchMethod.BeeSwarm, StabilitySearchMethod.BeeSwarm)] public void CanConvertToXmlSearchMethodType(Dam.Data.StabilitySearchMethod dataType, StabilitySearchMethod xmlType) { Assert.That(XmlConversionHelper.ConvertToSearchMethod(dataType), Is.EqualTo(xmlType)); } [Test] [TestCase(StabilityCalculationModel.Bishop, StabilityModelType.Bishop)] [TestCase(StabilityCalculationModel.UpliftVan, StabilityModelType.UpliftVan)] [TestCase(StabilityCalculationModel.BishopUpliftVan, StabilityModelType.BishopUpliftVan)] public void CanConvertToDataModelType(StabilityCalculationModel xmlType, StabilityModelType dataType) { Assert.That(XmlConversionHelper.ConvertToModelType(xmlType), Is.EqualTo(dataType)); } [Test] [TestCase(StabilityModelType.Bishop, StabilityCalculationModel.Bishop)] [TestCase(StabilityModelType.UpliftVan, StabilityCalculationModel.UpliftVan)] [TestCase(StabilityModelType.BishopUpliftVan, StabilityCalculationModel.BishopUpliftVan)] public void CanConvertToXmlModelType(StabilityModelType dataType, StabilityCalculationModel xmlType) { Assert.That(XmlConversionHelper.ConvertToModelType(dataType), Is.EqualTo(xmlType)); } }