Example #1
0
        public async void Get_HackerNewsItems_Service_ShouldReturn_List()
        {
            _hackerNewsGateway.Setup(gw => gw.GetTopStoriesAsync()).ReturnsAsync(new List <string>()
            {
                "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"
            });
            _hackerNewsGateway.Setup(gw => gw.GetItemAsync(0)).ReturnsAsync(new Domain.Models.HackerNewsItem()
            {
                Id = 1
            });

            var service = new HackerNewsService(_config, _hackerNewsGateway.Object);
            var results = await service.GetItemsAsync(0);

            results.Count.Should().Be(10);
        }