vendredi 6 février 2015

ASP MVC 5 testing RedirectToAction

I'm testing whether a controller doesn't have a parameter, it should redirect to action "Index".



// Controller code
return RedirectToAction("Index");

// Unit test code
ActionResult result = Controller.Action(null);
Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult));
Assert. // HERE i need to test it is going to Index, how do I do that?

Aucun commentaire:

Enregistrer un commentaire