public void Can_fetch_item(int id) { var item = _service.FetchItem(id).Result; Assert.IsFalse(string.IsNullOrEmpty(item)); Assert.AreNotEqual(NULLRESPONSE, item); }
public IEnumerable <Story> GetNewStories(int count = 500) { int storyCount = 0; var json = _hackerNewsService.FetchTopStories().Result; List <int> storyIds = _netCoreSerializer.SerializeIntegerList(json).ToList(); List <Story> retval = new List <Story>(); foreach (var id in storyIds) { var storyJson = _hackerNewsService.FetchItem(id).Result; var story = _netCoreSerializer.Serialize(storyJson); if (story != null) { retval.Add(story); storyCount++; } if (storyCount >= count) { break; } } return(retval); }