public void FalseShouldBeReturned()
            {
                var pagingOptions1 = PagingOptions.SkipTake(10, 25);
                var pagingOptions2 = new object();

                Assert.False(pagingOptions1.Equals(pagingOptions2));
            }
            public void FalseShouldBeReturned()
            {
                var pagingOptions1 = PagingOptions.SkipTake(10, 25);
                var pagingOptions2 = PagingOptions.SkipTake(10, 50);

                Assert.False(pagingOptions1 == pagingOptions2);
            }
            public void TrueShouldBeReturned()
            {
                var pagingOptions1 = PagingOptions.SkipTake(10, 25);
                var pagingOptions2 = (object)PagingOptions.SkipTake(10, 25);

                Assert.True(pagingOptions1.Equals(pagingOptions2));
            }
            public void AnArgumentOutOfRangeExceptionShouldBeThrown()
            {
                var exception = Assert.Throws <ArgumentOutOfRangeException>(() => PagingOptions.SkipTake(10, 0));

                Assert.Equal("take", exception.ParamName);
                Assert.True(exception.Message.StartsWith(ExceptionMessages.PagingOptions_TakeMustBeZeroOrAbove));
            }
Example #5
0
            public void AnArgumentOutOfRangeExceptionShouldBeThrown()
            {
                var exception = Assert.Throws <ArgumentOutOfRangeException>(() => PagingOptions.SkipTake(-1, 10));

                Assert.Equal("skip", exception.ParamName);
                Assert.StartsWith(ExceptionMessages.PagingOptions_SkipMustBeZeroOrAbove, exception.Message);
            }
Example #6
0
        public async Task ML_TakeSkip()
        {
            using (var session = sessionFactory.OpenAsyncSession())
            {
                using (var transaction = session.BeginTransaction())
                {
                    var query = new SqlQuery("SELECT * FROM [Customers]");

                    var result = await session.PagedAsync <Customer>(query, PagingOptions.SkipTake(50, 100));

                    transaction.Commit();
                }
            }
        }
 public WhenCallingSkipTake()
 {
     pagingOptions = PagingOptions.SkipTake(this.skip, this.take);
 }
 public WhenCallingGetHashCode()
 {
     this.pagingOptions = PagingOptions.SkipTake(this.offset, this.count);
 }