コード例 #1
0
        public void ToString_Always_ReturnsEmptyString()
        {
            // Setup
            var theme      = new TestCategoryTheme(ValueCriterionTestFactory.CreateValueCriterion());
            var properties = new TestCategoryThemeProperties(string.Empty, theme, new TestFeatureBasedMapData());

            // Call
            string toString = properties.ToString();

            // Assert
            Assert.IsEmpty(toString);
        }
コード例 #2
0
        public void Constructor_ExpectedValues()
        {
            // Setup
            var theme = new TestCategoryTheme(ValueCriterionTestFactory.CreateValueCriterion());

            // Call
            var properties = new TestCategoryThemeProperties(string.Empty, theme, new TestFeatureBasedMapData());

            // Assert
            Assert.AreSame(theme, properties.Data);
            Assert.IsInstanceOf <ObjectProperties <TestCategoryTheme> >(properties);
            TestHelper.AssertTypeConverter <CategoryThemeProperties <CategoryTheme>, ExpandableObjectConverter>();
        }
コード例 #3
0
        public void Constructor_Always_ReturnExpectedValues(ValueCriterionOperator valueOperator,
                                                            string formatExpression)
        {
            // Setup
            const string attributeName = "AttributeName";
            const string value         = "random value 123";

            var criterion = new ValueCriterion(valueOperator, value);
            var theme     = new TestCategoryTheme(criterion);

            // Call
            var properties = new TestCategoryThemeProperties(attributeName, theme, new TestFeatureBasedMapData());

            // Assert
            string expectedValue = string.Format(formatExpression, attributeName, value);

            Assert.AreEqual(expectedValue, properties.Criterion);
        }
コード例 #4
0
        public void Constructor_Always_PropertiesHaveExpectedAttributesValues()
        {
            // Setup
            var theme = new TestCategoryTheme(ValueCriterionTestFactory.CreateValueCriterion());

            // Call
            var properties = new TestCategoryThemeProperties(string.Empty, theme, new TestFeatureBasedMapData());

            // Assert
            PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);

            Assert.AreEqual(1, dynamicProperties.Count);

            const string       themeCategory     = "Stijl";
            PropertyDescriptor criterionProperty = dynamicProperties[criterionPropertyIndex];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(criterionProperty,
                                                                            themeCategory,
                                                                            "Criterium",
                                                                            "Het criterium van deze categorie.",
                                                                            true);
        }