public void CanDownloadXmlForRssFileWithSimplePath()
        {
            var asyncResult = _factory.BeginDownloadXml(new Uri(SimpleRssPath, UriKind.Relative), null);

            Assert.IsNotNull(asyncResult.AsyncState);

            var resultFeed = _factory.EndDownloadXml(asyncResult);

            Assert.IsNotNull(resultFeed);
            Assert.IsTrue(resultFeed.FeedContent.Length > 0);
        }
예제 #2
0
        public void CanDownloadXmlStreamAsync(string rsslocation)
        {
            var feeduri        = new Uri(rsslocation);
            var result         = Factory.BeginDownloadXml(feeduri, null);
            var resultantTuple = Factory.EndDownloadXml(result);

            Assert.IsNotNull(resultantTuple, "The resultant FeedTuple from the Async operation should not be null!");
            Assert.That(resultantTuple.FeedContent != String.Empty, "The resultant feed should not be empty!");
            Assert.AreEqual(feeduri, resultantTuple.FeedUri, "The two uris should be equal!");
        }
        public void DoesFileSystemFeedFactoryThrowExceptionWhenDownloadXmlAsyncAcceptsMissingFile(string rsslocation)
        {
            var feeduri = new Uri(rsslocation);

            Assert.That(() =>
            {
                var result         = Factory.BeginDownloadXml(feeduri, null);
                var resultantTuple = Factory.EndDownloadXml(result);
            }, Throws.TypeOf <MissingFeedException>());
        }
 public void DoesHttpFeedFactoryThrowExceptionWhenDownloadXmlAsyncAcceptsMissingFile(string rsslocation)
 {
     var feeduri        = new Uri(rsslocation);
     var result         = Factory.BeginDownloadXml(feeduri, null);
     var resultantTuple = Factory.EndDownloadXml(result);
 }