aboutsummaryrefslogtreecommitdiff
path: root/Aggregator/Tests/ParserServiceTests.cs
diff options
context:
space:
mode:
authorAryadev Chavali <aryadevchavali1@gmail.com>2019-02-04 00:30:43 +0000
committerAryadev Chavali <aryadevchavali1@gmail.com>2019-02-04 00:30:43 +0000
commit191eb317ab418e484c6e106a28092285a34ddd40 (patch)
tree8f43845a57afa5b2c235f8abd60fb505b25e793d /Aggregator/Tests/ParserServiceTests.cs
parentf2db4058db87c20b812231572ca2a022d5da9766 (diff)
downloadnewsaggregator-191eb317ab418e484c6e106a28092285a34ddd40.tar.gz
newsaggregator-191eb317ab418e484c6e106a28092285a34ddd40.tar.bz2
newsaggregator-191eb317ab418e484c6e106a28092285a34ddd40.zip
Added Test for Parse
Diffstat (limited to 'Aggregator/Tests/ParserServiceTests.cs')
-rw-r--r--Aggregator/Tests/ParserServiceTests.cs13
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