コード例 #1
0
        public async Task TestPagination()
        {
            using (var transaction = Fixture.Connection.BeginTransaction())
            {
                using (var context = Fixture.CreateContext(transaction))
                {
                    var repo = new CarsRepository(context);

                    var count = await repo.TotalCount();

                    Assert.True(count > 0);
                    output.WriteLine($"total count {count}");

                    var paginatedQuery = await repo
                                         .PaginationQuery(1, 4).ToListAsync();

                    Assert.True(paginatedQuery.Count == 4);

                    paginatedQuery.ForEach(c =>
                    {
                        output.WriteLine($"{c.Brand}");
                    });
                }
            }
        }