public void CreateForeshoreGeometryPoints_InputNull_ReturnsEmptyCollection()
        {
            // Call
            IEnumerable <Point2D> points = GrassCoverErosionInwardsChartDataPointsFactory.CreateForeshoreGeometryPoints(null);

            // Assert
            CollectionAssert.IsEmpty(points);
        }
        public void CreateDikeHeightPoints_DikeProfileNull_ReturnsEmptyCollection()
        {
            // Call
            IEnumerable <Point2D> points = GrassCoverErosionInwardsChartDataPointsFactory.CreateDikeHeightPoints(null);

            // Assert
            CollectionAssert.IsEmpty(points);
        }
        private void SetChartData()
        {
            GrassCoverErosionInwardsInput input = data.InputParameters;
            DikeProfile dikeProfile             = input.DikeProfile;

            GrassCoverErosionInwardsChartDataFactory.UpdateForeshoreGeometryChartDataName(foreshoreChartData, input);
            GrassCoverErosionInwardsChartDataFactory.UpdateDikeGeometryChartDataName(dikeGeometryChartData, dikeProfile);

            foreshoreChartData.Points    = GrassCoverErosionInwardsChartDataPointsFactory.CreateForeshoreGeometryPoints(input);
            dikeGeometryChartData.Points = GrassCoverErosionInwardsChartDataPointsFactory.CreateDikeGeometryPoints(dikeProfile);
            dikeHeightChartData.Points   = GrassCoverErosionInwardsChartDataPointsFactory.CreateDikeHeightPoints(input);
        }
        public void CreateForeshoreGeometryPoints_DikeProfileNull_ReturnsEmptyCollection()
        {
            // Setup
            var input = new GrassCoverErosionInwardsInput
            {
                UseForeshore = true
            };

            // Call
            IEnumerable <Point2D> points = GrassCoverErosionInwardsChartDataPointsFactory.CreateForeshoreGeometryPoints(input);

            // Assert
            CollectionAssert.IsEmpty(points);
        }
        public void CreateDikeGeometryPoints_DikeProfile_ReturnsDikeGeometryCollection()
        {
            // Setup
            var roughnessPoints = new[]
            {
                new RoughnessPoint(new Point2D(1.1, 2.2), 0.5),
                new RoughnessPoint(new Point2D(3.3, 4.4), 0.6)
            };
            DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(roughnessPoints);

            // Call
            IEnumerable <Point2D> points = GrassCoverErosionInwardsChartDataPointsFactory.CreateDikeGeometryPoints(dikeProfile);

            // Assert
            CollectionAssert.AreEqual(roughnessPoints.Select(rp => rp.Point), points);
        }
        public void CreateDikeHeightPoints_DikeProfileSetDikeGeometryLessThanTwoPoints_ReturnsEmptyCollection()
        {
            // Setup
            var input = new GrassCoverErosionInwardsInput
            {
                DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new[]
                {
                    new RoughnessPoint(new Point2D(1.1, 2.2), 0.5)
                }),
                DikeHeight = (RoundedDouble)5.5
            };

            // Call
            IEnumerable <Point2D> points = GrassCoverErosionInwardsChartDataPointsFactory.CreateDikeHeightPoints(input);

            // Assert
            CollectionAssert.IsEmpty(points);
        }
        public void CreateForeshoreGeometryPoints_DikeProfileSetUseForeshoreFalse_ReturnsEmptyCollection()
        {
            // Setup
            var input = new GrassCoverErosionInwardsInput
            {
                DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new[]
                {
                    new Point2D(1.1, 2.2),
                    new Point2D(3.3, 4.4)
                }),
                UseForeshore = false
            };

            // Call
            IEnumerable <Point2D> points = GrassCoverErosionInwardsChartDataPointsFactory.CreateForeshoreGeometryPoints(input);

            // Assert
            CollectionAssert.IsEmpty(points);
        }
        public void CreateForeshoreGeometryPoints_DikeProfileSetUseForeshoreTrue_ReturnsForeshoreGeometryCollection()
        {
            // Setup
            var foreshoreGeometry = new[]
            {
                new Point2D(1.1, 2.2),
                new Point2D(3.3, 4.4)
            };
            var input = new GrassCoverErosionInwardsInput
            {
                DikeProfile  = DikeProfileTestFactory.CreateDikeProfile(foreshoreGeometry),
                UseForeshore = true
            };

            // Call
            IEnumerable <Point2D> points = GrassCoverErosionInwardsChartDataPointsFactory.CreateForeshoreGeometryPoints(input);

            // Assert
            CollectionAssert.AreEqual(foreshoreGeometry, points);
        }
        public void CreateDikeHeightPoints_DikeProfileSetValidData_ReturnsEmptyCollection()
        {
            // Setup
            var input = new GrassCoverErosionInwardsInput
            {
                DikeProfile = DikeProfileTestFactory.CreateDikeProfile(
                    new[]
                {
                    new RoughnessPoint(new Point2D(1.1, 2.2), 0.5),
                    new RoughnessPoint(new Point2D(3.3, 4.4), 0.6)
                }),
                DikeHeight = (RoundedDouble)5.5
            };

            // Call
            IEnumerable <Point2D> points = GrassCoverErosionInwardsChartDataPointsFactory.CreateDikeHeightPoints(input);

            // Assert
            CollectionAssert.AreEqual(new[]
            {
                new Point2D(1.1, 5.5),
                new Point2D(3.3, 5.5)
            }, points);
        }