示例#1
0
        public void Children_Of_Type_Test()
        {
            var doc            = GetNode(1);
            var currentContent = ContentTypeMapper.Map <Home>(doc);
            var result         = currentContent.ChildrenOfType <NewsLandingPage>().ToArray();

            Assert.AreEqual("page2/alias, 2ndpagealias", result[0].PageTitle);
        }
示例#2
0
        public void Type_Test()
        {
            var doc            = GetNode(1);
            var currentContent = ContentTypeMapper.Map <Home>(doc);

            Assert.That(currentContent.SiteName, Is.EqualTo("Test site"));
            Assert.That(currentContent.SiteDescription, Is.EqualTo("this is a test site"));
        }
示例#3
0
        public void Descendants_Of_Type_Test()
        {
            var doc            = GetNode(1);
            var currentContent = ContentTypeMapper.Map <Home>(doc);
            var result         = currentContent.Descendants <NewsArticle>().ToArray();

            Assert.AreEqual("John doe", result[0].ArticleAuthor);
            Assert.AreEqual("John Smith", result[1].ArticleAuthor);
        }