public void ToPropertDescriptorSucceeds() { var p = ToPropertyInfoWrapper <string> .GetPropertyDescriptor(e => e.Length); Assert.AreEqual("Length", p.Name); Assert.AreEqual(typeof(int), p.PropertyType); Assert.AreEqual(true, p.IsReadOnly); Assert.AreEqual(TypeDescriptor.GetProperties(typeof(string))["Length"], p); }
public void ToPropertyInfoSucceeds() { var p = ToPropertyInfoWrapper <string> .GetPropertyInfo(e => e.Length); Assert.AreEqual("Length", p.Name); Assert.AreEqual(typeof(int), p.PropertyType); Assert.AreEqual(true, p.CanRead); Assert.AreEqual(false, p.CanWrite); Assert.AreEqual(typeof(string).GetProperties().Single(e => e.Name == "Length"), p); }