コード例 #1
0
        public void RssParserTest()
        {
            //var html = new HtmlDocument();
            //html.Load(new StreamReader("rss.xml"));
            var html = XDocument.Load(new StreamReader("rss.xml"));
            RssFeedParser rss = new RssFeedParser();
            var list = rss.parseRssDocument(html, 1);

            Assert.AreEqual(2, list.Count());
            Assert.AreEqual(list.Where(x => x.Title == "Romney maja prvič doslej premagal Obamo v zbiranju denarja za kampanjo").Count() > 0, true);
        }
コード例 #2
0
 private ParsingService()
 {
     TotalCount = 0;
     LastRun = 0;
     Mapper.CreateMap<NewsFileExt, NewsFile>();
     State = State.WaitingToNextInterval;
     watch = new Stopwatch();
     FeedParser = new RssFeedParser();
     NewsParser = new GenericNewsParser("article");
     FailedTitles = new HashSet<string>();
 }