public void ShouldLoadInShows() { ShowLibraryService showLibraryService = new ShowLibraryService(); eWolfPodcast pods = new eWolfPodcast(); List <eWolfPodcastShowsShow> shows = new List <eWolfPodcastShowsShow>(); eWolfPodcastShowsShow show = new eWolfPodcastShowsShow() { Category = "DEV", Description = "My dev podcast", Name = "DEV one", Url = "WWW.Somewhere" }; shows.Add(show); eWolfPodcastShows showfile = new eWolfPodcastShows { Show = shows.ToArray() }; pods.Shows = showfile; showLibraryService.ProcessFiles(pods); showLibraryService.GetList().Should().HaveCount(1); ShowLibraryData showFromLibrary = showLibraryService.GetList()[0]; showFromLibrary.Name.Should().Be("DEV one"); showFromLibrary.Catergery.Should().Be("DEV"); showFromLibrary.Description.Should().Be("My dev podcast"); showFromLibrary.URL.Should().Be("WWW.Somewhere"); }
public void Load(string fileName) { try { eWolfPodcast eWolfPodcast = ReadWriteFileHelper.ReadFromXmlFile <eWolfPodcast>(fileName); ProcessFiles(eWolfPodcast); } catch { // fail safe } }
internal void ProcessFiles(eWolfPodcast eWolfPodcast) { _library.Clear(); foreach (eWolfPodcastShowsShow podcast in eWolfPodcast.Shows.Show) { if (podcast != null) { ShowLibraryData sld = new ShowLibraryData { Name = podcast.Name, Description = podcast.Description, Catergery = podcast.Category, URL = podcast.Url }; _library.Add(sld); } } }