Пример #1
0
        public async Task GetLatestArticleIdsAsync_Returns_Values()
        {
            var serviceOptions = Microsoft.Extensions.Options.Options.Create(new ServiceOptions());
            var stringContent  = JsonConvert.SerializeObject(new List <int>()
            {
                1, 2, 3, 4, 5
            });
            var httpClient = await SetupMockHttpClient(stringContent);

            var service = new HackerNewsService(httpClient, serviceOptions);
            var result  = await service.GetLatestArticleIdsAsync();

            Assert.NotNull(result);
            Assert.True(result.Count() == 5);
        }