public void Should_set_redirect_location() { var result = new PermanentRedirectResult("test"); result.ExecuteResult(_controllerContext); Assert.AreEqual("test", _controllerContext.HttpContext.Response.RedirectLocation); }
public ActionResult ItemRedirect(ScheduleItemAddress scheduleItemAddress) { var url = "/MIX10/Sessions/" + scheduleItemAddress.ScheduleItemSlug; var redirect = new PermanentRedirectResult(url); return(redirect); }
public void Should_set_status_code() { var result = new PermanentRedirectResult("test"); result.ExecuteResult(_controllerContext); Assert.AreEqual(301, _controllerContext.HttpContext.Response.StatusCode); }
public void Url_should_return_the_url_to_redirect_to() { var result = new PermanentRedirectResult("test"); Assert.That(result.Url, Is.EqualTo("test")); }