// Copyright (C) Stichting Deltares 2018. 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.Linq; using Deltares.DamEngine.Calculators.DikesAssessmentRegional; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.TestHelpers.Factories; using NUnit.Framework; namespace Deltares.DamEngine.Calculators.Tests.RegionalAssessment { [TestFixture] public class RegionalScenarioSelectorTests { [Test] public void TestNumberOfScenarios() { var surfaceLineTutorial1 = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); var location = CreateLocation(surfaceLineTutorial1); var soilProfile = FactoryForSoilProfiles.CreateClaySandProfile(); var selector = new RegionalScenarioSelector(); var regionalScenarioProfileResults = selector.GetScenarios(location, new SoilGeometryProbability { SoilProfile1D = soilProfile }); Assert.GreaterOrEqual(regionalScenarioProfileResults.Count(), 1); Assert.LessOrEqual(regionalScenarioProfileResults.Count(), 5); } private Location CreateLocation(SurfaceLine2 surfaceline) { var location = new Location { Name = "Test location", DredgingDepth = -4.0, BoezemLevelTp = 2.0, BoezemLevelHbp = 1.8, PolderLevel = -1.0, PolderLevelLow = -1.0 }; location.HeadPl3 = location.BoezemLevelHbp - 0.1; location.HeadPl4 = location.BoezemLevelHbp - 0.1; location.SurfaceLine = surfaceline; location.LocalXzSheetPilePoint = location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); location.ModelFactors.UpliftCriterionStability = 1.0; location.SheetPileLength = 0.0; return location; } } }