I was trying to unit test a method in one of my Controllers returning a JsonResult. To my surprise the following code didn\'t work:
[HttpPost] public JsonResult
Anonymous types are internal, so you can't expose them to another library, the one with tests. If you placed testing code in the same library as controller, it will work.