예제 #1
0
        public void CreateLowerBoundaryWaterLevelsGeometryPoints_WithForeshoreProfile_ReturnsLowerBoundaryWaterLevelsGeometryPointsCollection(
            IEnumerable <Point2D> foreshoreProfileGeometry)
        {
            // Setup
            var input = new WaveConditionsInput
            {
                LowerBoundaryWaterLevels = (RoundedDouble)3,
                ForeshoreProfile         = new TestForeshoreProfile(foreshoreProfileGeometry)
            };

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

            // Assert
            Point2D lastGeometryPoint = foreshoreProfileGeometry.Last();
            double  endPointX         = (input.LowerBoundaryWaterLevels - lastGeometryPoint.Y) / 3;

            var expectedPoints = new[]
            {
                new Point2D(foreshoreProfileGeometry.First().X, 3),
                new Point2D(endPointX + lastGeometryPoint.X, 3)
            };

            CollectionAssert.AreEqual(expectedPoints, points);
        }
예제 #2
0
        public void CreateLowerBoundaryWaterLevelsGeometryPoints_UseForeshoreProfileFalse_ReturnsLowerBoundaryWaterLevelsGeometryPointsCollection()
        {
            // Setup
            var input = new WaveConditionsInput
            {
                LowerBoundaryWaterLevels = (RoundedDouble)3,
                ForeshoreProfile         = new TestForeshoreProfile(new[]
                {
                    new Point2D(0, 0),
                    new Point2D(3, 4)
                }),
                UseForeshore = false
            };

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

            // Assert
            var expectedPoints = new[]
            {
                new Point2D(-10, 3),
                new Point2D(1, 3)
            };

            CollectionAssert.AreEqual(expectedPoints, points);
        }
예제 #3
0
        public void CreateLowerBoundaryWaterLevelsGeometryPoints_LowerBoundaryWaterLevelsNaN_ReturnsEmptyPointsCollection()
        {
            // Call
            IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateLowerBoundaryWaterLevelsGeometryPoints(new WaveConditionsInput());

            // Assert
            CollectionAssert.IsEmpty(points);
        }
예제 #4
0
        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);
        }