Exemplo n.º 1
0
        public void TestGetProperties()
        {
            TestClass     obj   = new TestClass();
            List <string> names = PropertyReflector.GetPropertyNames(obj);

            Assert.Equal(3, names.Count);
            Assert.Contains("PublicField", names);
            Assert.Contains("PublicProp", names);

            Dictionary <string, object> map = PropertyReflector.GetProperties(obj);

            Assert.Equal(3, map.Count);
            Assert.Equal("ABC", map["PublicField"]);
            Assert.NotNull(map["PublicProp"]);
        }