Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj =================================================================== diff -u -r1050 -r1067 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj (.../Deltares.DamEngine.Calculators.Tests.csproj) (revision 1050) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj (.../Deltares.DamEngine.Calculators.Tests.csproj) (revision 1067) @@ -68,6 +68,7 @@ + Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/RegionalScenarioSelectorTests.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/RegionalScenarioSelectorTests.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/RegionalScenarioSelectorTests.cs (revision 1067) @@ -0,0 +1,69 @@ +// 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.Data.RegionalAssessmentResults; +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; + } + } +}