title: Check if a property exists in a class
body: <p>I try to know if a property exist in a class, I tried this :</p>
  
  <pre><code>public static bool HasProperty(this object obj, string propertyName)
  {
      return obj.GetType().GetProperty(propertyName) != null;
  }
  </code></pre>
  
  <p>I don't understand why the first test method does not pass ?</p>
  
  <pre><code>[TestMethod]
  public void Test_HasProperty_True()
  {
      var res = typeof(MyClass).HasProperty("Label");
      Assert.IsTrue(res);
  }
  
  [TestMethod]
  public void Test_HasProperty_False()
  {
      var res = typeof(MyClass).HasProperty("Lab");
      Assert.IsFalse(res);
  }
  </code></pre>