public async Task <ApiNewsItem[]> GetNews(TimeSpan?expireDateTime = default) { var timeUpdated = expireDateTime ?? _settings.CacheUpdateInterval; Func <Task <ApiNewsItem[]> > dataSource = () => _mireaApiClient.GetNews(); var news = await LocalCacheProvider.GetAsync(LocalCacheHelper.NewsCacheKey, dataSource, timeUpdated); return(news); }
public async Task GetNews() { var actualNews = await _mireaApiClient.GetNews(); Assert.NotEmpty(actualNews); Assert.NotNull(actualNews.First().Title); Assert.NotNull(actualNews.First().Content); Assert.NotEmpty(actualNews.First().Photos); }