Ejemplo n.º 1
0
        public void Constructor_WithMapTheme_ReturnCorrectPropertyValues()
        {
            // Setup
            const string attributeName = "Attribute";
            var          categoryTheme = new LineCategoryTheme(ValueCriterionTestFactory.CreateValueCriterion(), new LineStyle());
            var          mapLineData   = new MapLineData("Test",
                                                         new LineStyle(),
                                                         new MapTheme <LineCategoryTheme>(attributeName, new[]
            {
                categoryTheme
            }));

            // Call
            var properties = new MapLineDataProperties(mapLineData, Enumerable.Empty <MapDataCollection>());

            // Assert
            Assert.AreEqual("Categorie", properties.StyleType);

            Assert.AreEqual(mapLineData.ShowLabels, properties.ShowLabels);
            Assert.IsEmpty(properties.SelectedMetaDataAttribute.MetaDataAttribute);
            Assert.AreEqual(mapLineData.MetaData, properties.GetAvailableMetaDataAttributes());

            Assert.AreEqual(1, properties.CategoryThemes.Length);
            LineCategoryThemeProperties pointCategoryThemeProperties = properties.CategoryThemes.First();

            Assert.AreSame(categoryTheme, pointCategoryThemeProperties.Data);
            ValueCriterionTestHelper.AssertValueCriterionFormatExpression(attributeName,
                                                                          categoryTheme.Criterion,
                                                                          pointCategoryThemeProperties.Criterion);
        }
Ejemplo n.º 2
0
        public void Constructor_WithoutMapTheme_ReturnCorrectPropertyValues()
        {
            // Setup
            Color               color     = Color.Aqua;
            const int           width     = 4;
            const LineDashStyle dashStyle = LineDashStyle.DashDot;

            var mapLineData = new MapLineData("Test", new LineStyle
            {
                Color     = color,
                Width     = width,
                DashStyle = dashStyle
            });

            // Call
            var properties = new MapLineDataProperties(mapLineData, Enumerable.Empty <MapDataCollection>());

            // Assert
            Assert.AreEqual("Enkel symbool", properties.StyleType);

            Assert.AreEqual(mapLineData.ShowLabels, properties.ShowLabels);
            Assert.IsEmpty(properties.SelectedMetaDataAttribute.MetaDataAttribute);
            Assert.AreEqual(mapLineData.MetaData, properties.GetAvailableMetaDataAttributes());

            Assert.AreEqual(color, properties.Color);
            Assert.AreEqual(width, properties.Width);
            Assert.AreEqual(dashStyle, properties.DashStyle);

            CollectionAssert.IsEmpty(properties.CategoryThemes);
        }