Пример #1
0
        public void GetPagedList_Page10of2()
        {
            // Arrange
            var componentUnderTest = new DefaultQuery();
            var expected           = new PagedList <string>(new[] { "three" }, 3, 2, 2, 1);

            // Act
            var actual = componentUnderTest.GetPagedList(10, 2);

            // Assert
            actual.ShouldHaveSameValueAs(expected);
            componentUnderTest.PageNumber.ShouldHaveSameValueAs(1);
            componentUnderTest.PageSize.ShouldHaveSameValueAs(2);
        }
Пример #2
0
        public void GetPagedList_NotPaged()
        {
            // Arrange
            var componentUnderTest = new DefaultQuery();
            var expected           = new PagedList <string>(new[] { "one", "two", "three" }, 3, 0, 0, 0);

            // Act
            var actual = componentUnderTest.GetPagedList(0, 0);

            // Assert
            actual.ShouldHaveSameValueAs(expected);
            componentUnderTest.PageNumber.ShouldHaveSameValueAs(0);
            componentUnderTest.PageSize.ShouldHaveSameValueAs(0);
        }