Beispiel #1
0
        public void PopulatePageDetails_Should_Map_Correctly(int pageNumber, int totalPages, int expectedCurrent, int?expectedPrev, int?expectedNext)
        {
            var page = new PageObject
            {
                Number     = pageNumber,
                TotalPages = totalPages
            };

            var source = new PagedResponse();
            var actual = source.PopulatePageDetails(page);

            actual.CurrentPageIndex.Should().Be(expectedCurrent);
            actual.PrevPageIndex.Should().Be(expectedPrev);
            actual.NextPageIndex.Should().Be(expectedNext);
        }
Beispiel #2
0
        public void PopulatePageDetails_Should_Handle_Null_Page()
        {
            var source = new PagedResponse();
            var actual = source.PopulatePageDetails(null);

            actual.CurrentPageIndex.Should().Be(default);