From 191eb317ab418e484c6e106a28092285a34ddd40 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 4 Feb 2019 00:30:43 +0000 Subject: Added Test for Parse --- Aggregator/Tests/ParserServiceTests.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Aggregator/Tests') 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
articles = ParserService.Parse(xml, TestConfig).ToList(); + Assert.True(articles != null); + Assert.True(articles.Count > 0); + } } } \ No newline at end of file -- cgit v1.2.3-13-gbd6f