Ejemplo n.º 1
0
        public void SetsTakeProperty_GivenValue()
        {
            var take = 10;
            var spec = new StoreNamesPaginatedSpec(0, take);

            spec.Take.Should().Be(take);
        }
        public void SetsSkipProperty_GivenValue()
        {
            var skip = 1;

            var spec = new StoreNamesPaginatedSpec(skip, 10);

            spec.Skip.Should()
            .Be(skip);
        }
        public void ReturnsSecondPageOfStoreNames_GivenStoreNamesPaginatedSpec()
        {
            int take = 10;           // pagesize 10
            int skip = (2 - 1) * 10; // page 2

            var spec = new StoreNamesPaginatedSpec(skip, take);

            var storeNames = spec.Evaluate(StoreSeed.Get());

            storeNames.Count().Should().Be(take);
            storeNames.First().Should().Be("Store 11");
            storeNames.Last().Should().Be("Store 20");
        }
        public async Task ReturnsSecondPageOfStoreNames_GivenStoreNamesPaginatedSpec()
        {
            int take = 10;           // pagesize 10
            int skip = (2 - 1) * 10; // page 2

            var spec = new StoreNamesPaginatedSpec(skip, take);

            var storeNames = await storeRepository.ListAsync(spec);

            storeNames.Count.Should().Be(take);
            storeNames.First().Should().Be("Store 11");
            storeNames.Last().Should().Be("Store 20");
        }
Ejemplo n.º 5
0
        public void ReturnsSecondPageOfStoreNames_GivenStoreNamesPaginatedSpec()
        {
            int take = 10;           // pagesize 10
            int skip = (2 - 1) * 10; // page 2

            var spec = new StoreNamesPaginatedSpec(skip, take);

            var storeNames = evaluator.GetQuery(StoreSeed.AsQueryable(), spec).ToList();

            storeNames.Count.Should().Be(take);
            storeNames.First().Should().Be("Store 11");
            storeNames.Last().Should().Be("Store 20");
        }