Example #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);
        }
        public void Constructor_Always_ReturnExpectedPropertyValues()
        {
            // Setup
            const string   attributeName  = "AttributeName";
            ValueCriterion valueCriterion = ValueCriterionTestFactory.CreateValueCriterion();
            var            categoryTheme  = new LineCategoryTheme(valueCriterion, new LineStyle());

            var properties = new LineCategoryThemeProperties(categoryTheme, attributeName, new MapLineData("Name"));

            // Assert
            Assert.AreSame(categoryTheme, properties.Data);

            Assert.AreEqual(categoryTheme.Style.Color, properties.Color);
            Assert.AreEqual(categoryTheme.Style.Width, properties.Width);
            Assert.AreEqual(categoryTheme.Style.DashStyle, properties.DashStyle);

            ValueCriterionTestHelper.AssertValueCriterionFormatExpression(attributeName,
                                                                          valueCriterion,
                                                                          properties.Criterion);
        }
Example #3
0
        public void Constructor_Always_ReturnExpectedPropertyValues()
        {
            // Setup
            const string   attributeName  = "AttributeName";
            ValueCriterion valueCriterion = ValueCriterionTestFactory.CreateValueCriterion();
            var            categoryTheme  = new PolygonCategoryTheme(valueCriterion, new PolygonStyle());

            var properties = new PolygonCategoryThemeProperties(categoryTheme, attributeName, new MapPolygonData("Name"));

            // Assert
            Assert.AreSame(categoryTheme, properties.Data);

            Assert.AreEqual(categoryTheme.Style.FillColor, properties.FillColor);
            Assert.AreEqual(categoryTheme.Style.StrokeColor, properties.StrokeColor);
            Assert.AreEqual(categoryTheme.Style.StrokeThickness, properties.StrokeThickness);

            ValueCriterionTestHelper.AssertValueCriterionFormatExpression(attributeName,
                                                                          valueCriterion,
                                                                          properties.Criterion);
        }