I have the following HandleUnknownAction set on my base controller class:
protected override void HandleUnknownAction(string action)
{
Response.Redirect("/");
}
How can I unit test that? Another point, is that way to handle the unknown action correct? Seems that calling RedirectToAction() would be more correct but the HandleUnknownAction doesn't have a return value.
The far I could get to test that is:
[Test]
public void TestHandleUnknownAction()
{
ctroler.ActionInvoker.InvokeAction(ctroler.ControllerContext, "unknown");
}
I'm stuck at it.