I'm writing a unit test for a controller in .Net Framework 4.5.2 but I'm getting a NullReferenceException when this line is hit:
return RedirectToAction<MyController>(action => action.Edit(itemId), "Something");
However, when I change it (and nothing else) to
return RedirectToAction("Edit", "Something", new { myId = itemId });
it works perfectly.
Any ideas why this would be?