Esempio n. 1
0
        public async Task TestDownloadRss()
        {
            var rssReader = new RssReader();
            var result    = await rssReader.DownloadRssString();

            Assert.IsNotNull(result);
            Assert.AreNotEqual <string>(string.Empty, result);
        }
Esempio n. 2
0
        public async Task TestSaveFile()
        {
            var fileStoreHelper = new FileStoreHelper();
            var rssReader       = new RssReader();
            var result          = await rssReader.DownloadRssString();

            var isSuccess = await fileStoreHelper.SaveRssFileAsync(result);

            Assert.IsTrue(isSuccess);
        }
Esempio n. 3
0
        public async Task TestParseRssXml()
        {
            var rssReader = new RssReader();
            var result    = await rssReader.DownloadRssString();

            var rssNode = rssReader.GetRssNode(result);
            var items   = rssReader.ParseRss(rssNode);

            Assert.IsTrue(items.Count > 0);
        }
Esempio n. 4
0
        public async Task TestReadFile()
        {
            var fileStoreHelper = new FileStoreHelper();
            var rssReader       = new RssReader();
            var result          = await rssReader.DownloadRssString();

            await fileStoreHelper.SaveRssFileAsync(result);

            var content = await fileStoreHelper.ReadRssFileAsync();

            Assert.AreEqual <string>(result, content);
        }