Exemplo n.º 1
0
        public void ToResponse_does_construct_PagingResponse()
        {
            var pagedList = TestablePagedList.Create();
            var response  = pagedList.ToResponse();

            Assert.True(response.Success);
            Assert.Equal(response.Page, pagedList.Page);
            Assert.Equal(response.PageSize, pagedList.PageSize);
            Assert.Equal(response.TotalCount, pagedList.TotalCount);
            Assert.Equal(response.PageCount, pagedList.PageCount);
        }
Exemplo n.º 2
0
        public void GetDescription_does_return_correct_description()
        {
            var pagedList = TestablePagedList.Create(
                TestablePagedList.CreateEntities(40),
                new PagingRequest()
            {
                Page     = 2,
                PageSize = 10
            });

            var description = pagedList.GetDescription();

            Assert.Equal("Showing 10 of 40 results (page 2 of 4)...", description);
        }