public void CanGetAllMarkets() { var feedApi = new FeedApi(this.config); var allMarkets = feedApi.Repository.GetAllMarkets(); Assert.True(allMarkets.Count > 0); }
public async Task <ActionResult <FeedApi> > GetFeed(string url, Blog.Enums.Language lang = Enums.Language.RU) { FeedApi feedApi = new FeedApi() { Feed = await _context.Feeds .Where(f => f.Url == url && f.Language == lang).FirstAsync() }; if (feedApi.Feed == null) { return(NotFound()); } SortedList <string, string> categories = new SortedList <string, string>(); _context.FeedCategories.Where(ft => ft.Feed.ID == feedApi.Feed.ID).Select(c => c.Category).ToList().ForEach(fc => { categories.Add(fc.Url, fc.Name); }); SortedList <string, string> tags = new SortedList <string, string>(); _context.FeedTags.Where(ft => ft.Feed.ID == feedApi.Feed.ID).Select(t => t.Tag).ToList().ForEach(ft => { tags.Add(ft.Url, ft.Name); }); SortedList <string, string> sources = new SortedList <string, string>(); _context.FeedSources.Where(ft => ft.Feed.ID == feedApi.Feed.ID).Select(t => t.Source).ToList().ForEach(ft => { sources.Add(ft.URL, ft.Name); }); feedApi.Categories = categories; feedApi.Tags = tags; feedApi.Sources = sources; return(feedApi); }
public void CanUpdateMetadata() { var feedApi = new FeedApi(this.config); feedApi.Update(); Assert.True(IsFileExists(this.config.MarketsFilePath)); Assert.True(IsFileExists(this.config.SymbolsFilePath)); }