I'm attempting to use the MvcContrib TestHelper fluent route testing API, but I'm seeing odd behavior. The .WithMethod(HttpVerb) extension method does not seem to be executing as expected. Here's my controller showing (2) actions (identically named) that accept different HttpVerbs:
[HttpGet]
public ActionResult IdentifyUser()
{
return View(new IdentifyUserViewModel());
}
[HttpPost]
public ActionResult IdentifyUser(IdentifyUserInputModel model)
{
return null;
}
And here is the test that should map to the action with the [HttpPost] attribute:
MvcApplication.RegisterRoutes(RouteTable.Routes);
var routeData = "~/public/registration/useridentification/identifyuser"
.WithMethod(HttpVerbs.Post)
.ShouldMapTo<UserIdentificationController>(x => x.IdentifyUser(null));
Even though the POST HttpVerb is specified in my test, it always routes to the HttpGet method. I can even comment out the action accepting HttpPost in my controller and still have the test pass!
Is there something I'm missing here?