public void Check_for_redirect_to_incorrect_controller(RedirectToActionTestMetadata test) { var exception = Assert.Throws <ActionResultAssertionException>(() => test.Item2(_controller.WithCallTo(c => c.RedirectToAnotherController())) ); Assert.That(exception.Message, Is.EqualTo("Expected redirect to controller 'ControllerResultTest', but instead was given a redirect to controller 'SomeOther'.")); }
public void Check_for_redirect_to_empty_action(RedirectToActionTestMetadata test) { var exception = Assert.Throws <ActionResultAssertionException>(() => test.Item2(_controller.WithCallTo(c => c.RedirectToRouteName())) ); Assert.That(exception.Message, Is.EqualTo(string.Format("Expected redirect to action '{0}', but instead was given a redirect without an action.", test.Item1))); }
public void Check_for_redirect_to_action(RedirectToActionTestMetadata test) { test.Item2(_controller.WithCallTo(test.Item3)); }