-
Notifications
You must be signed in to change notification settings - Fork 21
Description
When the consumer calls ShouldRedirectTo<TController>
where TController
is of the same type as the controller under test like this:
var sut = new HomeController();
sut.WithCallTo(c => c.Index())
.ShouldRedirectTo<HomeController>(c => c.Index());
The assertion fails with the following error:
Expected redirect to action 'Index' in 'Home' controller, but instead was given redirect to action 'Index' within the same controller.
I encountered this error message when I mistakenly supplied the generic type argument. I knew to remove it because I have some experience with this library.
Maybe I am dumb or maybe this is a common mistake. Might it be helpful to change the exception message to something like this:
Expected redirect to action 'Index' in 'Home' controller, but instead was given redirect to action 'Index' within the same controller. If this was the intended assertion then please remove the generic type argument.