public async Task<NewsFeed> GetLatestNewsAsync(IHttpClient httpClient, IRssParser rssParser) { if (httpClient == null) throw new ArgumentNullException("httpClient", "HTTP client cannot be null"); if (rssParser == null) throw new ArgumentNullException("rssParser", "RSS parser cannot be null"); var rss = await httpClient.GetStringAsync(FeedUri); return rssParser.Parse(rss); }
public TorrentzMovieTorrentRepository(SyndicationFeed feed, IRssParser parser) { movies = new List <IMovieTorrentInfo>(); foreach (var feedItem in feed.Items) { var movieInfo = parser.Parse(feedItem); movies.Add(movieInfo); } }