PageRenderTime 48ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/QFeedParser.Tests/AsyncTests/AsyncMissingFileSysFeedFactoryTest.cs

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