Ejemplo n.º 1
0
        private static bool HasMeta(Article article, string key, string value)
        {
            if(article.Meta[key] == null)
                return false;

            string[] values = ((string)article.Meta[key]).Split(' ');
            return values.Any(s => s.Equals(value, StringComparison.InvariantCultureIgnoreCase));
        }
Ejemplo n.º 2
0
        protected virtual SyndicationItem CreateItem(Article article)
        {
            var item = new SyndicationItem
                       {
                           Id = article.Permalink,
                           PublishDate = article.GetDate(),
                           LastUpdatedTime = article.GetDate(),
                           Title = new TextSyndicationContent(article.Title),
                           Content = new TextSyndicationContent(article.Body, TextSyndicationContentKind.Html),
                           Summary = new TextSyndicationContent(article.Summary, TextSyndicationContentKind.Html)
                       };

            item.Links.Add(new SyndicationLink(new Uri(article.Permalink)));
            item.Authors.Add(new SyndicationPerson { Name = article.Author });

            return item;
        }
Ejemplo n.º 3
0
        public void If_author_is_specified_in_atricle_it_overrides_the_one_from_config()
        {
            var articleWithAuthorSpecified = new Article("Web\\Articles\\2010-08-04-rosanna.md", _config);

            articleWithAuthorSpecified.Author.ShouldEqual("Rosanna");
        }
Ejemplo n.º 4
0
        public ArticleTests()
        {
            _config = new TestConfiguration();

            _article = new Article("Web\\Articles\\2010-08-05-new-blog-in-five-minutes.md", _config);
        }