示例#1
0
        public void TestNullContent()
        {
            IEnumerable <ISitemapContent> nullContent = null;
            var generator = new XmlSitemapGenerator();

            generator.Generate(nullContent);
        }
示例#2
0
        public void TestContents()
        {
            var generator = new XmlSitemapGenerator();
            var sitemap   = generator.Generate(_mockContent);

            Assert.AreEqual("urlset", sitemap.Root.Name, "urlset is not the root element");
            Assert.AreEqual(2, sitemap.Root.Elements().Count(), "the sitmap has an incorrect number of urls");
        }
示例#3
0
        public void TestDeclaration()
        {
            var generator = new XmlSitemapGenerator();
            var sitemap   = generator.Generate(_mockContent);

            Assert.AreEqual("1.0", sitemap.Declaration.Version, "the sitemap version is incorrect.");
            Assert.AreEqual("utf-8", sitemap.Declaration.Encoding, "the sitemap version is incorrect.");
            Assert.AreEqual("yes", sitemap.Declaration.Standalone, "the sitemap should be standalone.");
        }