Skip to content

Instantly share code, notes, and snippets.

@tildedave
Created March 23, 2011 02:04
Show Gist options
  • Save tildedave/882486 to your computer and use it in GitHub Desktop.
Save tildedave/882486 to your computer and use it in GitHub Desktop.
Coerce an MVC ActionResult to a subclass as part of a unit test
private static T IsResult<T>(ActionResult result) where T : ActionResult
{
Assert.IsInstanceOf<T>(result);
return (T)result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment