Ejemplo n.º 1
0
        public void BasicPathCreation()
        {
            ArticleDto article  = new ArticleDto(@"Articles\MyArticle.md", new MockArticleProcessor());
            string     calcPath = AttributeTranformations.CalculateArticlePath(article);

            Assert.AreEqual("Articles/MyArticle.html", calcPath);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Determines the output path for each article, either using a specified pattern or
        /// translation of the source file relative path.
        /// </summary>
        /// <param name="articles"></param>
        private void applyOutputPaths(List <ArticleDto> articles)
        {
            //Todo: More sophisticated, flexible path logic outstanding
            foreach (ArticleDto a in articles)
            {
                a.OutputPath = AttributeTranformations.CalculateArticlePath(a);

                //Replace existing path with the calculated path. We can assume Path is always available.
                a.Attributes["Path"] = new List <string>();
                a.Attributes["Path"].Add(a.OutputPath);
            }
        }