// 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 System.Collections; using Deltares.Dam.Data; using Deltares.Dam.Data.UISupport; using NUnit.Framework; namespace Deltares.Dam.Tests.UISupport { [TestFixture] public class ConfigurationManagerTest { [Test] public void ReturnsCorrectAvailableDamProjectTypes() { ICollection projectTypes = ConfigurationManager.Instance.GetAvailableDamProjectTypes(); Assert.That(projectTypes.Count, Is.EqualTo(2)); } [Test] public void ReturnsCorrectAvailableDeterministicFailuremechanisms() { ICollection failureMechanisms = ConfigurationManager.Instance.GetAvailableFailureMechanisms(DamProjectType.Design); Assert.That(failureMechanisms.Count, Is.EqualTo(3), "DamClassicStability: Incorrect number of failuremechanisms for deterministic calculation"); foreach (object failureMechanism in failureMechanisms) { Assert.That(failureMechanism.Equals(FailureMechanismSystemType.Piping) || failureMechanism.Equals(FailureMechanismSystemType.StabilityInside) || failureMechanism.Equals(FailureMechanismSystemType.StabilityOutside), Is.True); } } [Test] public void ReturnsCorrectAvailableDeterministicFailuremechanismModelsForDesignOption() { ICollection pipingModels = ConfigurationManager.Instance.GetAvailableMechanismModels(DamProjectType.Design, FailureMechanismSystemType.Piping); Assert.That(pipingModels.Count, Is.EqualTo(2), "DamClassicStability: Incorrect number of models for deterministic piping calculation"); ICollection stabilityInsideModels = ConfigurationManager.Instance.GetAvailableMechanismModels(DamProjectType.Design, FailureMechanismSystemType.StabilityInside); Assert.That(stabilityInsideModels.Count, Is.EqualTo(3), "DamClassicStability: Incorrect number of models for deterministic stability inside calculation"); ICollection stabilityOutsideModels = ConfigurationManager.Instance.GetAvailableMechanismModels(DamProjectType.Design, FailureMechanismSystemType.StabilityOutside); Assert.That(stabilityOutsideModels.Count, Is.EqualTo(1), "DamClassicStability: Incorrect number of models for deterministic stability outside calculation"); } [Test] public void ReturnsCorrectAvailableDeterministicFailuremechanismModelsForDamLiveOption() { ICollection pipingModels = ConfigurationManager.Instance.GetAvailableMechanismModels(DamProjectType.DamLiveConfiguration, FailureMechanismSystemType.Piping); Assert.That(pipingModels.Count, Is.EqualTo(1), "Incorrect number of models for deterministic piping calculation"); ICollection stabilityInsideModels = ConfigurationManager.Instance.GetAvailableMechanismModels(DamProjectType.DamLiveConfiguration, FailureMechanismSystemType.StabilityInside); Assert.That(stabilityInsideModels.Count, Is.EqualTo(2), "Incorrect number of models for deterministic stability inside calculation"); ICollection stabilityOutsideModels = ConfigurationManager.Instance.GetAvailableMechanismModels(DamProjectType.DamLiveConfiguration, FailureMechanismSystemType.StabilityOutside); Assert.That(stabilityOutsideModels.Count, Is.EqualTo(1), "Incorrect number of models for deterministic stability outside calculation"); } } }