コード例 #1
0
            public async Task LoadSliceAsync_should_return_last_slice()
            {
                var theCase = new EntityListCase()
                              .MakeDataAvailable(100);

                var expectedSliceData = theCase.GetExpectedSliceData(91, 9);

                var slice = await theCase.EntityList.SliceBy(10).Skip(91).LoadSliceAsync();

                slice.Items.Should().BeEquivalentTo(expectedSliceData);
                slice.HasNextSlice.Should().BeFalse();
                slice.TotalItems.Should().Be(100);
            }
コード例 #2
0
            public async Task LoadSliceAsync_should_return_first_slice_by_specifying_zero_skipped_items()
            {
                var theCase = new EntityListCase()
                              .MakeDataAvailable(100);

                var expectedSliceData = theCase.GetExpectedSliceData(0, 10);

                var slice = await theCase.EntityList.SliceBy(10).Skip(0).LoadSliceAsync();

                slice.Items.Should().BeEquivalentTo(expectedSliceData);
                slice.HasNextSlice.Should().BeTrue();
                slice.TotalItems.Should().Be(100);
            }