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); }
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); }
public void GetAttributeNamesOfSubclass() { List <string> actual = FeatureAttributeAccessorHelper.GetAttributeNames(new TestFeatureSubClass()).ToList(); Assert.AreEqual(new[] { "Name", "Other" }, actual); }