title: RuntimeType instead of Type in C# Unit Test
body: <p>In one of my unit tests I want to check if all public methods are returning type of ActionResult. Here's my test method:</p>
  
  <pre><code>    [TestMethod]
      public void Public_Methods_Should_Only_Return_ActionResults()
      {
  
          MethodInfo[] methodInfos = typeof(MyController).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
  
          foreach (MethodInfo methodInfo in methodInfos)
          {
              Assert.IsInstanceOfType(methodInfo.ReturnType, typeof(System.Web.Mvc.ActionResult));
  
          }
  
      }
  </code></pre>
  
  <p>This test blows up on the first method from MyController:</p>
  
  <pre><code>[Authorize]
  public ActionResult MyList()
  {
      return View();
  }
  </code></pre>
  
  <p>With the following error:</p>
  
  <pre><code>Assert.IsInstanceOfType failed. Expected type:&lt;System.Web.Mvc.ActionResult&gt;. Actual type:&lt;System.RuntimeType&gt;.  
  </code></pre>
  
  <p>When I set a breakpoint on that Assert and check the methodInfo.ReturnType it is of type Type and it is ActionResult. </p>
  
  <p>Can anyone explain me why the test is blowing up and what to do to make it work?</p>
  
  <p>Thanks in advance,
  MR</p>