Exemplo n.º 1
0
        public void AggBugUrl_WithId_ReturnsAggBugUrlWithId()
        {
            //arrange
            UrlHelper helper = SetupUrlHelper("/");

            //act
            string url = helper.AggBugUrl(1234);

            //assert
            Assert.AreEqual("/aggbug/1234.aspx", url);
        }
Exemplo n.º 2
0
 protected override string GetAggBugUrl(T item)
 {
     return(UrlHelper.AggBugUrl(item.Id).ToFullyQualifiedUrl(Blog).ToString());
 }
Exemplo n.º 3
0
        protected virtual void EntryXml(Entry entry, BlogConfigurationSettings settings, ITimeZone timezone)
        {
            WriteElementString("title", entry.Title);

            WriteStartElement("link");
            //(Duncanma 11/13/2005, changing alternate to self for 1.0 feed)
            WriteAttributeString("rel", "alternate");
            WriteAttributeString("type", "text/html");
            WriteAttributeString("href", UrlHelper.EntryUrl(entry).ToFullyQualifiedUrl(Blog).ToString());
            WriteEndElement();

            WriteElementString("id", UrlHelper.EntryUrl(entry).ToFullyQualifiedUrl(Blog).ToString());

            //(Duncanma 11/13/2005, hiding created, change issued to
            //published and modified to updated for 1.0 feed)
            //this.WriteElementString("created",W3Utcz(entry.DateCreated));
            WriteElementString("published", W3Utcz(entry.DateCreatedUtc));
            WriteElementString("updated", W3Utcz(entry.DateModifiedUtc));

            if (entry.HasDescription)
            {
                WriteStartElement("summary");
                //(Duncanma 11/13/2005, changing text/html to html for 1.0 feed)
                WriteAttributeString("type", "html");
                WriteString(entry.Description);
                WriteEndElement();
            }

            WriteStartElement("content");
            //(Duncanma 11/13/2005, changing text/html to html for 1.0 feed)
            WriteAttributeString("type", "html");
            //(Duncanma 11/13/2005, hiding mode for 1.0 feed)
            //this.WriteAttributeString("mode","escaped");

            WriteString
            (
                string.Format
                    (CultureInfo.InvariantCulture, "{0}{1}",                         //tag def
                    entry.SyndicateDescriptionOnly ? entry.Description : entry.Body, //use desc or full post
                    (UseAggBugs && settings.Tracking.EnableAggBugs)
                         ? TrackingUrls.AggBugImage(UrlHelper.AggBugUrl(entry.Id))
                         : null //use aggbugs
                    )
            );
            WriteEndElement();

            if (AllowComments && Blog.CommentsEnabled && entry.AllowComments && !entry.CommentingClosed)
            {
                //optional for CommentApi Post location
                WriteElementString("wfw:comment", UrlHelper.CommentApiUrl(entry.Id));
                //optional url for comments
                //this.WriteElementString("comments",entry.Link + "#feedback");
                //optional comment count
                WriteElementString("slash:comments", entry.FeedBackCount.ToString(CultureInfo.InvariantCulture));
                //optional commentRss feed location
                WriteElementString("wfw:commentRss", UrlHelper.CommentRssUrl(entry.Id));
                //optional trackback location
                WriteElementString("trackback:ping", UrlHelper.TrackbacksUrl(entry.Id));
                //core
            }
        }