コード例 #1
0
        public void Should_set_redirect_location()
        {
            var result = new PermanentRedirectResult("test");

            result.ExecuteResult(_controllerContext);
            Assert.AreEqual("test", _controllerContext.HttpContext.Response.RedirectLocation);
        }
コード例 #2
0
        public ActionResult ItemRedirect(ScheduleItemAddress scheduleItemAddress)
        {
            var url      = "/MIX10/Sessions/" + scheduleItemAddress.ScheduleItemSlug;
            var redirect = new PermanentRedirectResult(url);

            return(redirect);
        }
コード例 #3
0
        public void Should_set_status_code()
        {
            var result = new PermanentRedirectResult("test");

            result.ExecuteResult(_controllerContext);
            Assert.AreEqual(301, _controllerContext.HttpContext.Response.StatusCode);
        }
コード例 #4
0
        public void Url_should_return_the_url_to_redirect_to()
        {
            var result = new PermanentRedirectResult("test");

            Assert.That(result.Url, Is.EqualTo("test"));
        }
コード例 #5
0
 public void Url_should_return_the_url_to_redirect_to()
 {
     var result = new PermanentRedirectResult("test");
     Assert.That(result.Url, Is.EqualTo("test"));
 }
コード例 #6
0
 public void Should_set_status_code()
 {
     var result = new PermanentRedirectResult("test");
     result.ExecuteResult(_controllerContext);
     Assert.AreEqual(301, _controllerContext.HttpContext.Response.StatusCode);
 }
コード例 #7
0
 public void Should_set_redirect_location()
 {
     var result = new PermanentRedirectResult("test");
     result.ExecuteResult(_controllerContext);
     Assert.AreEqual("test", _controllerContext.HttpContext.Response.RedirectLocation);
 }