public void Null_PagingOptions()
        {
            //arrange
            var source = new List <Object>().AsQueryable();


            //act
            var actual = QueryableExtensions.AddPaging(source, (PagingOptions)null);

            //assert
            actual.Should().BeSameAs(source);
        }
        public void Empty_PagingOptions()
        {
            //arrange
            var source        = new List <Object>().AsQueryable();
            var pagingOptions = new PagingOptions()
            {
                Start = 0, Rows = 0
            };

            //act
            var actual = QueryableExtensions.AddPaging(source, pagingOptions);

            //assert
            actual.Should().BeSameAs(source);
        }
        public void Rows_Unlimited()
        {
            //arrange
            var testobjCollection = GetTestObjectCollection(999);
            var source            = testobjCollection.AsQueryable();
            var pagingOptions     = new PagingOptions()
            {
                Start = 0, Rows = -1
            };

            //act
            var actual = QueryableExtensions.AddPaging(source, pagingOptions);

            //assert
            actual.Should().HaveCount(999);
        }
        public void StartRows(int start, int rows, int ExpectedFirstIndex)
        {
            //arrange
            var testobjCollection = GetTestObjectCollection();
            var source            = testobjCollection.AsQueryable();
            var pagingOptions     = new PagingOptions()
            {
                Start = start, Rows = rows
            };

            //act
            var actual = QueryableExtensions.AddPaging(source, pagingOptions).ToList();

            //assert
            actual.Should().HaveElementAt(0, new TestObject {
                Index = ExpectedFirstIndex, String = ExpectedFirstIndex.ToString()
            });
            //actual.Should().HaveElementAt(0, testobjCollection[ExpectedFirstIndex]);
        }