Example #1
0
        public void GetRssAutoDiscoveryLinksDoesNotFindPhantomFeeds()
        {
            RssLocater locater = new RssLocater(null, null);
            var        feeds   = locater.GetRssAutoDiscoveryLinks(BASE_URL + "NoFeeds.html");

            Assert.AreEqual(0, feeds.Count, "Impossibly, we auto-discovered a feed where there are none.");
        }
Example #2
0
        public void GetRssAutoDiscoveryLinksFindsAtom10Links()
        {
            RssLocater locater = new RssLocater(null, null);
            var        feeds   = locater.GetRssAutoDiscoveryLinks(BASE_URL + "PageWithAtomLinks.htm");

            Assert.AreEqual(1, feeds.Count, "Hmm, the page only has one feed and I couldn't find it..");
            Assert.AreEqual(BASE_URL + "SampleATOM0.3Feed.xml", feeds[0], "ATOM was too small to discover.");
        }
Example #3
0
        public void GetRssAutoDiscoveryLinksFindsRssLinks()
        {
            RssLocater locater = new RssLocater(null, null);
            var        feeds   = locater.GetRssAutoDiscoveryLinks(BASE_URL + "GetRssAutoDiscoveryLinks.html");

            Assert.AreEqual(4, feeds.Count, "Obviously I could not count as I expected 4 feeds.");

            Assert.AreEqual(BASE_URL + "SampleRss0.91Feed.xml", (string)feeds[0]);
            Assert.AreEqual(BASE_URL + "SampleRss0.92Feed.rss", (string)feeds[1]);
            Assert.AreEqual(BASE_URL + "SampleRss1.0Feed.rss", (string)feeds[2]);
            Assert.AreEqual(BASE_URL + "SampleRss2.0Feed.xml", (string)feeds[3], "Missing version 2.0. Stuck in the past.");

            feeds = locater.GetRssFeedsForUrl(BASE_URL + "AutoDiscovery1.htm", true);
            Assert.AreEqual(feeds.Count, 2);
        }
Example #4
0
        public void GetRssAutoDiscoveryLinksThrowsWebExceptionIfFileNotFound()
        {
            RssLocater locater = new RssLocater(null, null);

            Assert.Throws <WebException>(() => locater.GetRssAutoDiscoveryLinks(BASE_URL + "FileNotFound.html"));
        }