aboutsummaryrefslogtreecommitdiff
path: root/Aggregator/Tests/DownloadTests.cs
blob: fd647b2bc84d83d46c33e112a9b7873721f04923 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Xml;
using System.Xml.Linq;
using Aggregator.Classes;
using Aggregator.Parser;
using Xunit;

namespace Aggregator.Tests {
    public class DownloadTests {
        [Fact]
        public void Test_DownloadXMLSync() {
            string xml = Download.DownloadXMLSync("http://feeds.bbci.co.uk/news/rss.xml");
            Assert.True(xml != null);
            Assert.True(xml != " ");
            Assert.True(XDocument.Parse(xml) != null);
        }

        [Fact]
        public async void Test_DownloadXML() {
            string xml = await Download.DownloadXML("http://feeds.bbci.co.uk/news/rss.xml");
            Assert.True(xml != null);
            Assert.True(xml != " ");
            Assert.True(XDocument.Parse(xml) != null);
        }
    }
}