コード例 #1
0
        public void AdminUrl_WithoutSubfolder_ReturnsCorrectUrl()
        {
            UrlHelper helper = SetupUrlHelper("/");

            //act
            string url = helper.AdminUrl("Feedback.aspx", new { status = 2 });

            //assert
            Assert.AreEqual("/admin/Feedback.aspx?status=2", url);
        }
コード例 #2
0
        public void AdminUrl_WithPage_RendersAdminUrlToPage()
        {
            //arrange
            UrlHelper helper = SetupUrlHelper("/");

            //act
            string url = helper.AdminUrl("log.aspx");

            //assert
            Assert.AreEqual("/admin/log.aspx", url);
        }
コード例 #3
0
        public void AdminUrl_WithSubfolderAndApplicationPath_ReturnsCorrectUrl()
        {
            var routeData = new RouteData();

            routeData.Values.Add("subfolder", "subfolder");
            UrlHelper helper = SetupUrlHelper("/Subtext.Web", routeData);

            //act
            string url = helper.AdminUrl("Feedback.aspx", new { status = 2 });

            //assert
            Assert.AreEqual("/Subtext.Web/subfolder/admin/Feedback.aspx?status=2", url);
        }
コード例 #4
0
        public void AdminUrl_WithBlogHavingSubfolderAndVirtualPath_RendersAdminUrlToPage()
        {
            //arrange
            var routeData = new RouteData();

            routeData.Values.Add("subfolder", "sub");
            UrlHelper helper = SetupUrlHelper("/Subtext.Web", routeData);

            //act
            string url = helper.AdminUrl("log.aspx");

            //assert
            Assert.AreEqual("/Subtext.Web/sub/admin/log.aspx", url);
        }
コード例 #5
0
        protected override void WriteChannel()
        {
            var image = new RssImageElement(GetRssImage(),
                                            CommentEntry.Title,
                                            UrlHelper.EntryUrl(CommentEntry).ToFullyQualifiedUrl(Blog),
                                            77,
                                            60,
                                            null);

            Uri url = UrlHelper.AdminUrl("Feedback.aspx", new { status = 2 }).ToFullyQualifiedUrl(Blog);

            BuildChannel(CommentEntry.Title, url, CommentEntry.Email,
                         CommentEntry.HasDescription ? CommentEntry.Description : CommentEntry.Body, Blog.Language,
                         Blog.Author, Blog.LicenseUrl, image);
        }
コード例 #6
0
 protected override string GetLinkFromItem(LogEntry item)
 {
     return(UrlHelper.AdminUrl("ErrorLog.aspx"));
 }
コード例 #7
0
 protected override string GetLinkFromItem(Referrer item)
 {
     return(UrlHelper.AdminUrl("Referrers.aspx"));
 }