public async void Test_GetAsyncById() { var dbOptions = await NewDb(); using (var ctx = new LodgingContext(dbOptions)) { await ctx.Database.EnsureCreatedAsync(); await ctx.SaveChangesAsync(); } using (var ctx = new LodgingContext(dbOptions)) { var repo = new ConcreteRepository(ctx); var _ = repo.GetAsync(1, new DummyQueryParamsModel()); } }
public async void Test_Apply_Sort_Order() { var dbOptions = await NewDb(); using (var ctx = new LodgingContext(dbOptions)) { await ctx.Database.EnsureCreatedAsync(); await ctx.SaveChangesAsync(); } using (var ctx = new LodgingContext(dbOptions)) { var query = new List <DummyModel>().AsQueryable(); var filters = new List <Expression <Func <DummyModel, bool> > >(); var repo = new ConcreteRepository(ctx); repo.RunApplyTest(query, filters, (e => e.Id), "asc"); repo.RunApplyTest(query, filters, (e => e.Id), "desc"); repo.RunApplyTest(query, filters, (e => e.Id), "default"); } }