public async Task GetFeed() { var handler = new MockHttpMessageHandler(); handler.When("http://feeds.rucast.net/*") .Respond("application/rss+xml", File.ReadAllText("./FeedResults/itunes.xml")); var httpClient = new HttpClient(handler); var feedReader = new ITunesFeedReader(httpClient); var result = await feedReader.GetFeed("http://feeds.rucast.net/radio-t"); Assert.Equal("Радио-Т", result.Title); Assert.Equal(21, result.Videos.Count); }
public RssController(YoutubeFeedReader feedReader, ITunesFeedReader itFeedreader, ZipCastsContext dbContext) { _ytFeedReader = feedReader; _itFeedreader = itFeedreader; _dbContext = dbContext; }