public void Should_convert_to_RedirectToRouteResult() { ActionResult result = new RedirectToRouteResult(new RouteValueDictionary()); RedirectToRouteResult converted = result.AssertActionRedirect(); Assert.IsNotNull(converted); }
public void ToAction_should_support_strongly_typed_controller_and_action() { ActionResult result = new RedirectToRouteResult(new RouteValueDictionary(new { controller = "PageHandler", action = "About" })); var final = result.AssertActionRedirect().ToAction <PageHandler>(c => c.About()); Assert.That(final, Is.EqualTo(result)); }
public void ToAction_with_strongly_typed_controller_can_ignore_the_controller_suffix() { ActionResult result = new RedirectToRouteResult(new RouteValueDictionary(new { controller = "Fake", action = "About" })); var final = result.AssertActionRedirect().ToAction <FakeController>(c => c.About()); Assert.That(final, Is.EqualTo(result)); }
public void Should_chain() { ActionResult result = new RedirectToRouteResult(new RouteValueDictionary(new { controller = "Home", action = "Index", id = 1 })); var final = result.AssertActionRedirect().ToController("Home").ToAction("Index").WithParameter("id", 1); Assert.That(final, Is.EqualTo(result)); }