private void SetDikeProfilesMapData()
        {
            IEnumerable <DikeProfile> dikeProfiles = FailureMechanism.DikeProfiles;

            dikeProfilesMapData.Features      = RiskeerMapDataFeaturesFactory.CreateDikeProfilesFeatures(dikeProfiles);
            foreshoreProfilesMapData.Features = RiskeerMapDataFeaturesFactory.CreateForeshoreProfilesFeatures(dikeProfiles.Select(dp => dp.ForeshoreProfile));
        }
Exemple #2
0
        public void CreateForeshoreProfilesFeatures_NullForeshoreProfiles_ReturnsEmptyCollection()
        {
            // Call
            IEnumerable <MapFeature> features = RiskeerMapDataFeaturesFactory.CreateForeshoreProfilesFeatures(null);

            // Assert
            CollectionAssert.IsEmpty(features);
        }
        private void SetForeshoreProfilesMapData()
        {
            IEnumerable <ForeshoreProfile> foreshoreProfiles = FailureMechanism.ForeshoreProfiles;

            foreshoreProfilesMapData.Features = RiskeerMapDataFeaturesFactory.CreateForeshoreProfilesFeatures(foreshoreProfiles);
        }
Exemple #4
0
        public void CreateForeshoreProfilesFeatures_WithForeshoreProfiles_ReturnsCollectionForeshoreProfilesWithGeometry()
        {
            // Setup
            var pointA = new Point2D(1.2, 2.3);
            var pointB = new Point2D(2.7, 2.0);

            var pointC = new Point2D(1.3, 2.3);
            var pointD = new Point2D(4.6, 2.0);
            var pointE = new Point2D(3.2, 23.3);
            var pointF = new Point2D(7.7, 12.6);

            Point2D[] pointsOne =
            {
                pointA,
                pointB
            };
            Point2D[] pointsTwo =
            {
                pointC,
                pointD,
                pointE,
                pointF
            };
            var foreshoreProfiles = new[]
            {
                new ForeshoreProfile(new Point2D(5, 4), pointsOne, null, new ForeshoreProfile.ConstructionProperties
                {
                    Id = "A"
                }),
                new ForeshoreProfile(new Point2D(3, 3), Enumerable.Empty <Point2D>(), null, new ForeshoreProfile.ConstructionProperties
                {
                    Id   = "bid",
                    Name = "B"
                }),
                new ForeshoreProfile(new Point2D(2, 1), pointsTwo, null, new ForeshoreProfile.ConstructionProperties
                {
                    Id   = "cid",
                    Name = "C"
                })
            };

            // Call
            IEnumerable <MapFeature> features = RiskeerMapDataFeaturesFactory.CreateForeshoreProfilesFeatures(foreshoreProfiles);

            // Assert
            Assert.AreEqual(2, features.Count());
            Assert.AreEqual(1, features.First().MapGeometries.Count());
            Assert.AreEqual(1, features.ElementAt(1).MapGeometries.Count());
            Point2D[] mapDataGeometryOne = features.First().MapGeometries.ElementAt(0).PointCollections.First().ToArray();
            Point2D[] mapDataGeometryTwo = features.ElementAt(1).MapGeometries.ElementAt(0).PointCollections.First().ToArray();

            CollectionElementsAlmostEquals(new[]
            {
                new Point2D(5, 2.8),
                new Point2D(5, 1.3)
            }, mapDataGeometryOne);
            CollectionElementsAlmostEquals(new[]
            {
                new Point2D(2, -0.3),
                new Point2D(2, -3.6),
                new Point2D(2, -2.2),
                new Point2D(2, -6.7)
            }, mapDataGeometryTwo);

            const int expectedNumberOfMetaDataOptions = 1;

            Assert.AreEqual(expectedNumberOfMetaDataOptions, features.First().MetaData.Count);
            Assert.AreEqual(expectedNumberOfMetaDataOptions, features.ElementAt(1).MetaData.Count);
            Assert.AreEqual(foreshoreProfiles[0].Name, features.First().MetaData["Naam"]);
            Assert.AreEqual(foreshoreProfiles[2].Name, features.ElementAt(1).MetaData["Naam"]);
        }