@@ -171,33 +171,36 @@ public async Task GetPaginatedEntitiesAsync()
171171 await dbContext . Database . EnsureDeletedAsync ( ) ;
172172 await dbContext . Database . EnsureCreatedAsync ( ) ;
173173
174- var query = await repository . GetAllAsync ( includes : q => q . Include ( p => p . Indirizzo ) , filter : w => w . Id <= 10 ) ;
175- var entities = await repository . GetPaginatedAsync ( query , 2 , 5 ) ;
174+ //var query = await repository.GetAllAsync(includes: q => q.Include(p => p.Indirizzo), filter: w => w.Id <= 10);
175+ //var entities = await repository.GetPaginatedAsync(query, 2, 5);
176+
177+ var entities = await repository . GetAllPagingAsync ( pageNumber : 2 , pageSize : 5 , includes : q => q . Include ( p => p . Indirizzo ) , filter : w => w . Id <= 10 ) ;
176178 var itemCount = entities . Items . Count ;
177179
178180 Assert . NotNull ( entities ) ;
179181 Assert . Equal ( 5 , itemCount ) ;
180- Assert . Contains ( query , x => x . Id == 8 ) ;
182+ Assert . Contains ( entities . Items , x => x . Id == 8 ) ;
181183 }
182184
183- [ Fact ]
184- public async Task GetPaginatedEntitiesWithoutIncludeAsync ( )
185- {
186- using var dbContext = GetDbContext ( ) ;
187- var repository = new Repository < Persone , int > ( dbContext ) ;
185+ // [Fact]
186+ // public async Task GetPaginatedEntitiesWithoutIncludeAsync()
187+ // {
188+ // using var dbContext = GetDbContext();
189+ // var repository = new Repository<Persone, int>(dbContext);
188190
189- await dbContext . Database . EnsureDeletedAsync ( ) ;
190- await dbContext . Database . EnsureCreatedAsync ( ) ;
191+ // await dbContext.Database.EnsureDeletedAsync();
192+ // await dbContext.Database.EnsureCreatedAsync();
191193
192- var query = await repository . GetAllAsync ( includes : q => q . Include ( p => p . Indirizzo ) , filter : w => w . Id <= 10 ) ;
194+ // //var query = await repository.GetAllAsync(includes: q => q.Include(p => p.Indirizzo), filter: w => w.Id <= 10);
195+ // //var entities = await repository.GetPaginatedAsync(query, 2, 5);
193196
194- var entities = await repository . GetPaginatedAsync ( query , 2 , 5 ) ;
195- var itemCount = entities . Items . Count ;
197+ // var entities = await repository.GetAllPagingAsync(pageNumber: 2, pageSize: 5, includes: q => q.Include(p => p.Indirizzo), filter: w => w.Id <= 10 );
198+ // var itemCount = entities.Items.Count;
196199
197- Assert . NotNull ( entities ) ;
198- Assert . Equal ( 5 , itemCount ) ;
199- Assert . Contains ( query , x => x . Id == 8 ) ;
200- }
200+ // Assert.NotNull(entities);
201+ // Assert.Equal(5, itemCount);
202+ // Assert.Contains(entities.Items , x => x.Id == 8);
203+ // }
201204
202205 [ Fact ]
203206 public async Task GetPaginatedEntitiesWithoutWhereAsync ( )
@@ -208,14 +211,15 @@ public async Task GetPaginatedEntitiesWithoutWhereAsync()
208211 await dbContext . Database . EnsureDeletedAsync ( ) ;
209212 await dbContext . Database . EnsureCreatedAsync ( ) ;
210213
211- var query = await repository . GetAllAsync ( includes : q => q . Include ( p => p . Indirizzo ) , filter : null ! , orderBy : x => x . Id ) ;
214+ //var query = await repository.GetAllAsync(includes: q => q.Include(p => p.Indirizzo), filter: null!, orderBy: x => x.Id);
215+ //var entities = await repository.GetPaginatedAsync(query, 1, 5);
212216
213- var entities = await repository . GetPaginatedAsync ( query , 1 , 5 ) ;
217+ var entities = await repository . GetAllPagingAsync ( pageNumber : 1 , pageSize : 5 , includes : q => q . Include ( p => p . Indirizzo ) , orderBy : x => x . Id ) ;
214218 var itemCount = entities . Items . Count ;
215219
216220 Assert . NotNull ( entities ) ;
217221 Assert . Equal ( 5 , itemCount ) ;
218- Assert . Contains ( query , x => x . Id == 3 ) ;
222+ Assert . Contains ( entities . Items , x => x . Id == 3 ) ;
219223 }
220224
221225 [ Fact ]
@@ -227,15 +231,17 @@ public async Task GetPaginatedEntitiesDescendingOrderTypeAsync()
227231 await dbContext . Database . EnsureDeletedAsync ( ) ;
228232 await dbContext . Database . EnsureCreatedAsync ( ) ;
229233
230- var query = await repository . GetAllAsync ( includes : q => q . Include ( p => p . Indirizzo ) , filter : null ! , orderBy : x => x . Id , ascending : false ) ;
234+ //var query = await repository.GetAllAsync(includes: q => q.Include(p => p.Indirizzo), filter: null!, orderBy: x => x.Id, ascending: false);
235+ //var entities = await repository.GetPaginatedAsync(query, 1, 5);
231236
232- var entities = await repository . GetPaginatedAsync ( query , 1 , 5 ) ;
237+ var entities = await repository . GetAllPagingAsync ( pageNumber : 1 , pageSize : 5 , includes : q => q . Include ( p => p . Indirizzo ) , orderBy : x => x . Id , ascending : false ) ;
233238 var itemCount = entities . Items . Count ;
234239
235240 Assert . NotNull ( entities ) ;
236241 Assert . Equal ( 5 , itemCount ) ;
237242 Assert . Equal ( 10 , Assert . IsType < Persone > ( entities . Items . First ( ) ) . Id ) ;
238- Assert . Contains ( query , x => x . Id == 8 ) ;
243+ //Assert.Contains(query, x => x.Id == 8);
244+ Assert . Contains ( entities . Items , x => x . Id == 8 ) ;
239245 }
240246
241247 [ Fact ]
0 commit comments