diff options
author | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-04 00:30:43 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-04 00:30:43 +0000 |
commit | 191eb317ab418e484c6e106a28092285a34ddd40 (patch) | |
tree | 8f43845a57afa5b2c235f8abd60fb505b25e793d /Aggregator/Tests | |
parent | f2db4058db87c20b812231572ca2a022d5da9766 (diff) | |
download | newsaggregator-191eb317ab418e484c6e106a28092285a34ddd40.tar.gz newsaggregator-191eb317ab418e484c6e106a28092285a34ddd40.tar.bz2 newsaggregator-191eb317ab418e484c6e106a28092285a34ddd40.zip |
Added Test for Parse
Diffstat (limited to 'Aggregator/Tests')
-rw-r--r-- | Aggregator/Tests/ParserServiceTests.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Aggregator/Tests/ParserServiceTests.cs b/Aggregator/Tests/ParserServiceTests.cs index eaa1102..a7654da 100644 --- a/Aggregator/Tests/ParserServiceTests.cs +++ b/Aggregator/Tests/ParserServiceTests.cs @@ -1,11 +1,13 @@ using System; +using System.Linq; +using System.Threading.Tasks; +using System.Collections.Generic; using Aggregator.Parser; using Aggregator.Classes; - using Xunit; namespace Aggregator.Tests { - public static class ParserServiceTests { + public class ParserServiceTests { private static Config TestConfig = new Config() { Source = "BBC", @@ -16,5 +18,12 @@ namespace Aggregator.Tests { PublishDate = 4 }; + [Fact] + public async void Test_Parse() { + string xml = await Download.DownloadXML("http://feeds.bbci.co.uk/news/rss.xml"); + List<Article> articles = ParserService.Parse(xml, TestConfig).ToList(); + Assert.True(articles != null); + Assert.True(articles.Count > 0); + } } }
\ No newline at end of file |