Esempio n. 1
0
        public void SearchFunctionalTest(PodcastFeed expectedPodcastFeed)
        {
            IEnumerable <PodcastFeed> podcastFeeds = _podHead.Search(expectedPodcastFeed.Title);
            PodcastFeed feed = podcastFeeds.FirstOrDefault(p => p.Title == expectedPodcastFeed.Title);

            Assert.IsNotNull(feed);
            expectedPodcastFeed.AssertEqual(feed);
        }
Esempio n. 2
0
        /// <summary>
        /// Retrieves and Loads Podcast Feeds by Search Term.
        /// In this example the search term happens to be the title of the podcast.
        /// </summary>
        private static void SearchForPodcast(string podcastTitle)
        {
            PodHead podHead = new PodHead();

            //Get a collection of podcast feeds returned by the search. (May throw exceptions).
            IEnumerable <PodcastFeed> podcastFeeds = podHead.Search(podcastTitle, maxNumberOfFeeds: 5);

            //Get the podcast feed that matches the title, and print its data.
            PodcastFeed nprNewsPodcastFeed = podcastFeeds.FirstOrDefault(podcastFeed => podcastFeed.Title == podcastTitle);

            if (nprNewsPodcastFeed != null)
            {
                LoadPodcastEpisodes(nprNewsPodcastFeed);
            }
        }
 public void Search_ShouldInvokePodcastSearchUnitTest(PodHead sut, IPodcastSearch podcastSearch, string searchTerm, uint limit)
 {
     sut.SetField(typeof(IPodcastSearch), podcastSearch);
     sut.Search(searchTerm, limit);
     podcastSearch.Received(1).Search(searchTerm, limit);
 }