Example #1
0
        public void GetObjectPropertiesTest()
        {
            TestClass theObject = new TestClass {
                PropertyInt = 7, PropertyString = "Test"
            };

            PropertyInfo[] expected
                = new PropertyInfo[]
                {
                theObject.GetType().GetProperty("PropertyInt"),
                theObject.GetType().GetProperty("PropertyString"),
                theObject.GetType().GetProperty("Sub"),
                theObject.GetType().GetProperty("Subs"),
                };

            PropertyInfo[] actual = ObjectLookupHelper.GetObjectProperties(theObject);
            CollectionAssert.AreEqual(expected, actual);
        }