Esempio n. 1
0
        public void CreateRevetmentGeometryPoints_InputWithForeshoreProfile_ReturnRevetmentGeometryPointsCollection(
            IEnumerable <Point2D> foreshoreProfileGeometry)
        {
            // Setup
            const double lowerBoundaryRevetment = 2;
            const double upperBoundaryRevetment = 9;

            var input = new WaveConditionsInput
            {
                LowerBoundaryRevetment = (RoundedDouble)lowerBoundaryRevetment,
                UpperBoundaryRevetment = (RoundedDouble)upperBoundaryRevetment,
                ForeshoreProfile       = new TestForeshoreProfile(foreshoreProfileGeometry)
            };

            // Call
            IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateRevetmentGeometryPoints(input);

            // Assert
            Point2D lastGeometryPoint = foreshoreProfileGeometry.Last();

            double startPointX      = ((lowerBoundaryRevetment - lastGeometryPoint.Y) / 3) + lastGeometryPoint.X;
            double endPointX        = ((upperBoundaryRevetment - lastGeometryPoint.Y) / 3) + lastGeometryPoint.X;
            var    expectedGeometry = new[]
            {
                new Point2D(startPointX, lowerBoundaryRevetment),
                new Point2D(endPointX, upperBoundaryRevetment)
            };

            CollectionAssert.AreEqual(expectedGeometry, points);
        }
Esempio n. 2
0
        public void CreateRevetmentGeometryPoints_InputUseForeshoreProfileFalse_ReturnRevetmentGeometryPointsCollection()
        {
            // Setup
            const double lowerBoundaryRevetment = 2;
            const double upperBoundaryRevetment = 8;

            var input = new WaveConditionsInput
            {
                LowerBoundaryRevetment = (RoundedDouble)lowerBoundaryRevetment,
                UpperBoundaryRevetment = (RoundedDouble)upperBoundaryRevetment,
                ForeshoreProfile       = new TestForeshoreProfile(new[]
                {
                    new Point2D(1, 1),
                    new Point2D(3, 5),
                    new Point2D(10, 7)
                }),
                UseForeshore = false
            };

            // Call
            IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateRevetmentGeometryPoints(input);

            // Assert
            CollectionAssert.AreEqual(new[]
            {
                new Point2D(lowerBoundaryRevetment / 3, 2),
                new Point2D(upperBoundaryRevetment / 3, 8)
            }, points);
        }
Esempio n. 3
0
        public void CreateRevetmentBaseGeometryPoints_BoundariesNotSet_ReturnsEmptyPointsCollection(WaveConditionsInput input)
        {
            // Call
            IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateRevetmentGeometryPoints(input);

            // Assert
            CollectionAssert.IsEmpty(points);
        }
Esempio n. 4
0
        public void CreateRevetmentGeometryPoints_InputNull_ReturnsEmptyPointsCollection()
        {
            // Call
            IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateRevetmentGeometryPoints(null);

            // Assert
            CollectionAssert.IsEmpty(points);
        }
        private void SetChartData()
        {
            WaveConditionsInput input = calculation.InputParameters;

            WaveConditionsChartDataFactory.UpdateForeshoreGeometryChartDataName(foreshoreChartData, input);

            foreshoreChartData.Points = WaveConditionsChartDataPointsFactory.CreateForeshoreGeometryPoints(input);
            lowerBoundaryRevetmentChartData.Points   = WaveConditionsChartDataPointsFactory.CreateLowerBoundaryRevetmentGeometryPoints(input);
            upperBoundaryRevetmentChartData.Points   = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryRevetmentGeometryPoints(input);
            lowerBoundaryWaterLevelsChartData.Points = WaveConditionsChartDataPointsFactory.CreateLowerBoundaryWaterLevelsGeometryPoints(input);
            upperBoundaryWaterLevelsChartData.Points = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryWaterLevelsGeometryPoints(input);

            RoundedDouble assessmentLevel = getHydraulicBoundaryLocationCalculationFunc()?.Output?.Result ?? RoundedDouble.NaN;

            assessmentLevelChartData.Points = WaveConditionsChartDataPointsFactory.CreateAssessmentLevelGeometryPoints(input, assessmentLevel);
            waterLevelsChartData.Lines      = WaveConditionsChartDataPointsFactory.CreateWaterLevelsGeometryPoints(input, assessmentLevel);

            revetmentBaseChartData.Points = WaveConditionsChartDataPointsFactory.CreateRevetmentBaseGeometryPoints(input);
            revetmentChartData.Points     = WaveConditionsChartDataPointsFactory.CreateRevetmentGeometryPoints(input);
        }