Пример #1
0
        public void SitemapUrl_KeywordCase_ReturnsUrl()
        {
            Robots.Robots robots = new Robots.Robots();
            robots.LoadContent(@"siteMAp: http://a.com/sitemap.xml", BASE_URL);

            Assert.AreEqual("http://a.com/sitemap.xml", robots.GetSitemapUrls()[0]);
        }
Пример #2
0
        public void SitemapUrl_NoUrl_Returns1EntryThatIsEmtpty()
        {
            Robots.Robots robots = new Robots.Robots();
            robots.LoadContent(@"Sitemap:  ", BASE_URL);

            Assert.AreEqual("", robots.GetSitemapUrls()[0]);
        }
Пример #3
0
        public void SitemapUrl_MultipleSpaceBetween_ReturnsUrl()
        {
            Robots.Robots robots = new Robots.Robots();
            robots.LoadContent(@"Sitemap:   http://a.com/sitemap.xml", BASE_URL);

            Assert.AreEqual("http://a.com/sitemap.xml", robots.GetSitemapUrls()[0]);
        }
Пример #4
0
        public void Allow_QuestionMarkAfterSlashTest_DisallowOnlyWhenTheQuestionMarkIsRightAfterTheSlash()
        {
            var robots = new Robots.Robots();

            robots.LoadContent(
                @"User-Agent: *
Disallow: /?
Disallow: /disallowfolder/?private
Allow: /?public/public"
                , BaseUrl
                );

            Assert.IsFalse(robots.Allowed("/?blablabla"));
            Assert.IsTrue(robots.Allowed("/blablabla/blabla"));
            Assert.IsTrue(robots.Allowed("/blablabla/?blabla"));
            Assert.IsTrue(robots.Allowed("/blab?labla"));
            Assert.IsFalse(robots.Allowed("/disallowfolder/?private"));
            Assert.IsTrue(robots.Allowed("/?public/public"));
        }
Пример #5
0
        public void SitemapUrl_KeywordCase_ReturnsUrl()
        {
            Robots.Robots robots = new Robots.Robots();
            robots.LoadContent(@"siteMAp: http://a.com/sitemap.xml", BASE_URL);

            Assert.AreEqual("http://a.com/sitemap.xml", robots.GetSitemapUrls()[0]);
        }
Пример #6
0
        public void SitemapUrl_NoUrl_Returns1EntryThatIsEmtpty()
        {
            Robots.Robots robots = new Robots.Robots();
            robots.LoadContent(@"Sitemap:  ", BASE_URL);

            Assert.AreEqual("", robots.GetSitemapUrls()[0]);
        }
Пример #7
0
        public void SitemapUrl_MultipleSpaceBetween_ReturnsUrl()
        {
            Robots.Robots robots = new Robots.Robots();
            robots.LoadContent(@"Sitemap:   http://a.com/sitemap.xml", BASE_URL);

            Assert.AreEqual("http://a.com/sitemap.xml", robots.GetSitemapUrls()[0]);
        }