PageRenderTime 13ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

/QFeedParser.Tests/AsyncTests/AsyncMissingFileSysFeedFactoryTest.cs

#
C# | 40 lines | 36 code | 4 blank | 0 comment | 0 complexity | 892c86373dabfcba742092e28300d276 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using NUnit.Framework;
 6
 7namespace QDFeedParser.Tests.AsyncTests
 8{
 9    [TestFixture, Description("Tests to ensure that the appropriate exceptions are thrown when an Asynchronous FileSystemFactory tries to parse a missing feed.")]
10    public class AsyncMissingFileSysFeedFactoryTest : BaseMultiTestCase
11    {
12        protected IFeedFactory Factory;
13        protected FeedType FeedType;
14
15        public AsyncMissingFileSysFeedFactoryTest()
16            : base(TestFileLoader.LoadMissingTestCases(TestFileLoader.TestFileType.FileSys))
17        {
18            Factory = new FileSystemFeedFactory();
19            FeedType = FeedType.Rss20;
20        }
21
22        [Test, TestCaseSource("TestCases"), Description("Tests to see is a MissingFeedException is thrown when the FileSys feed factory attempts to DownloadXml from a non-existent file.")]
23        [ExpectedException(typeof(MissingFeedException))]
24        public void DoesFileSystemFeedFactoryThrowExceptionWhenDownloadXmlAsyncAcceptsMissingFile(string rsslocation)
25        {
26            var feeduri = new Uri(rsslocation);
27            var result = Factory.BeginDownloadXml(feeduri, null);
28            var resultantTuple = Factory.EndDownloadXml(result);
29        }
30
31        [Test, TestCaseSource("TestCases"), Description("Tests to see is a MissingFeedException is thrown when the FileSys feed factory attempts to DownloadXml from a non-existent file.")]
32        [ExpectedException(typeof(MissingFeedException))]
33        public void DoesFileSystemFeedFactoryThrowExceptionWhenCreateFeedAsyncAcceptsMissingFile(string rsslocation)
34        {
35            var feeduri = new Uri(rsslocation);
36            var result = Factory.BeginCreateFeed(feeduri, null);
37            var resultantFeed = Factory.EndCreateFeed(result);
38        }
39    }
40}