예제 #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);
        }