示例#1
0
        public void GetAttributeNamesOfType()
        {
            List <string> actual = FeatureAttributeAccessorHelper.GetAttributeNames(typeof(TestFeature)).ToList();

            Assert.AreEqual(new[] { "Name", "Other" }, actual);

            List <string> actualInstance = FeatureAttributeAccessorHelper.GetAttributeNames(new TestFeature()).ToList();

            Assert.AreEqual(new[] { "Name", "Other" }, actualInstance);
        }
示例#2
0
        public void GetAllAttributes()
        {
            var testFeature = new TestFeature();

            testFeature.Attributes = new DictionaryFeatureAttributeCollection();
            testFeature.Attributes.Add("attrib", "blah");

            var allAttributes = FeatureAttributeAccessorHelper.GetAttributeNames(testFeature);

            Assert.AreEqual(new [] { "attrib", "Name", "Other" }, allAttributes);
        }
示例#3
0
        public void GetAttributeNamesOfSubclass()
        {
            List <string> actual = FeatureAttributeAccessorHelper.GetAttributeNames(new TestFeatureSubClass()).ToList();

            Assert.AreEqual(new[] { "Name", "Other" }, actual);
        }