-
Notifications
You must be signed in to change notification settings - Fork 21
Beginnings of #47 #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,10 @@ public RouteValueDictionary ShouldRedirectTo<TController>(MethodInfo methodInfo) | |
var redirectResult = (RedirectToRouteResult)ActionResult; | ||
|
||
if (redirectResult.RouteValues["Controller"] == null) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be Otherwise, if the action returned a redirect to the same controller, but you were checking for a different one then it wouldn't throw when it should. You can probably add a test case for that if there isn't one already. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure off-hand. I will spend some time to understand the code more deeply this afternoon and then issue another commit. Thank you. |
||
throw new ActionResultAssertionException(string.Format("Expected redirect to action '{0}' in '{1}' controller, but instead was given redirect to action '{2}' within the same controller.", actionName, controllerName, redirectResult.RouteValues["Action"])); | ||
//throw new ActionResultAssertionException(string.Format("Expected redirect to action '{0}' in '{1}' controller, but instead was given redirect to action '{2}' within the same controller.", actionName, controllerName, redirectResult.RouteValues["Action"])); | ||
{ | ||
return redirectResult.RouteValues; | ||
} | ||
|
||
if (redirectResult.RouteValues["Controller"].ToString() != controllerName) | ||
throw new ActionResultAssertionException(string.Format("Expected redirect to controller '{0}', but instead was given a redirect to controller '{1}'.", controllerName, redirectResult.RouteValues["Controller"])); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check_for_redirect_to_action_within_same_controller
?