Ejemplo n.º 1
0
        public async Task GetAllLinkBundlesWithExplicitPaging()
        {
            // Arrange
            for (var i = 1; i <= 100; i++)
            {
                _sourceList.Add(new LinkBundle
                {
                    Id          = Guid.NewGuid().ToString(),
                    Description = $"Link Bundle {i}",
                    VanityUrl   = $"link-bundle-{i}"
                });
            }

            // Act
            var queryOptions = new QueryOptions
            {
                Skip = 10,
                Top  = 10
            };

            var results = (await _linksService.AllLinkBundlesAsync(queryOptions)).ToList();

            // Assert
            Assert.Equal(queryOptions.Top, results.Count());
            Assert.Equal("Link Bundle 11", results[0].Description);
        }