示例#1
0
        public void GetFeeds_ValidInpunt_ReturnAllFeeds()
        {
            // TODO: write proper unit tests
            var parser = new Reader.Parser.Opml.Parser("<rss></rss>");

            var expected = new List <OpmlSubscription>();
            var actual   = parser.GetFeeds();

            Assert.Equal(expected, actual);
        }
示例#2
0
文件: Program.cs 项目: svenvNL/Reader
        static async Task Main(string[] args)
        {
            var data = System.IO.File.ReadAllText("feed.xml");

            var opmlParser = new Parser.Opml.Parser(data);
            var feeds      = opmlParser.GetFeeds();

            var subscription = new Subscription();
            var entries      = await subscription.GetEntriesAsync(feeds);

            foreach (var entry in entries.OrderByDescending(entry => entry.PubDate))
            {
                Console.WriteLine(
                    $"{entry.PubDate.ToLocalTime().ToShortDateString()} {entry.PubDate.ToLocalTime().ToShortTimeString()} - {entry.Title} {entry.Link}");
            }
        }