public void TestDownload() { var localStorage = new LocalPodcastService("podcasts.json"); var feedParser = new FeedParserService(); var fileManager = new FileDownloadService(); var podcastService = new PodcastService(feedParser, localStorage, fileManager); var podcastFromService = podcastService.GetPodcastAsync("http://monstercat.com/podcast/feed.xml").Result; podcastService.DownloadEpisodeAsync(podcastFromService.Episodes.OrderByDescending(e => e.Published).ToList()[0]).Wait(); }
public void TestLocalStorage() { var localStorage = new LocalPodcastService("podcasts.json"); var feedParser = new FeedParserService(); var podcastService = new PodcastService(feedParser, localStorage, null); var podcasts = new List<Podcast>(); var podcast = podcastService.GetPodcastAsync("http://monstercat.com/podcast/feed.xml").Result; podcasts.Add(podcast); podcastService.SavePodcastsAsync(podcasts).Wait(); var podcastsFromStorage = podcastService.GetPodcastsAsync().Result.ToList(); Assert.AreEqual(podcasts.Count, podcastsFromStorage.Count); for (int i = 0; i < podcasts.Count; i++) { Assert.AreEqual(true, podcasts[i].Equals(podcastsFromStorage[i])); } }
public void TestLocalStorage() { var localStorage = new LocalPodcastService("podcasts.json"); var feedParser = new FeedParserService(); var podcastService = new PodcastService(feedParser, localStorage, null); var podcasts = new List <Podcast>(); var podcast = podcastService.GetPodcastAsync("http://monstercat.com/podcast/feed.xml").Result; podcasts.Add(podcast); podcastService.SavePodcastsAsync(podcasts).Wait(); var podcastsFromStorage = podcastService.GetPodcastsAsync().Result.ToList(); Assert.AreEqual(podcasts.Count, podcastsFromStorage.Count); for (int i = 0; i < podcasts.Count; i++) { Assert.AreEqual(true, podcasts[i].Equals(podcastsFromStorage[i])); } }