//-----------------------------------------------------------------------
//
// Copyright (c) 2011 Deltares. All rights reserved.
//
// R. Brinkman
// rob.brinkman@deltares.nl
// 21-06-2011
// Test RWSelector
//-----------------------------------------------------------------------
using Deltares.Geotechnics;
using Deltares.Geotechnics.Soils;
using Deltares.Geotechnics.SurfaceLines;
using Deltares.Geotechnics.TestUtils;
namespace Deltares.Dam.Tests
{
using System.Linq;
using Deltares.Dam.Data;
using NUnit.Framework;
[TestFixture]
public class RWSelectorTest
{
[Test]
public void TestNumberOfScenarios()
{
using (var surfaceLineTutorial1 = FactoryForSurfaceLineTests.CreateSurfaceLineTutorial1())
using (Location location = CreateLocation(surfaceLineTutorial1))
{
SoilProfile1D soilProfile = FactoryForSoilProfileTests.CreateClaySandProfile();
RWScenarioSelector selector = new RWScenarioSelector();
RWScenarioProfileResult[] rwScenarioProfileResults = selector.GetScenarios(location, new SoilGeometryProbability() { SoilProfile = soilProfile });
Assert.GreaterOrEqual(rwScenarioProfileResults.Count(), 1);
Assert.LessOrEqual(rwScenarioProfileResults.Count(), 5);
}
}
private Location CreateLocation(SurfaceLine2 surfaceline)
{
var location = new Location();
location.Name = "Test location";
location.DredgingDepth = -4.0;
location.BoezemLevelTp = 2.0;
location.BoezemLevelHbp = 1.8;
location.PolderLevel = -1.0;
location.PolderLevelLow = -1.0;
location.HeadPl3 = location.BoezemLevelHbp - 0.1;
location.HeadPl4 = location.BoezemLevelHbp - 0.1;
location.SurfaceLine2 = surfaceline;
location.LocalXZSurfaceLine2 = location.SurfaceLine2;
location.LocalXZSheetPilePoint = location.LocalXZSurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver);
location.ModelFactors.UpliftCriterionStability = 1.0;
location.SheetPileLength = 0.0;
return location;
}
}
}