public async void Test_Repository_DeleteAsync(LodgingModel lodging, RentalModel rental, ReviewModel review) { await _connection.OpenAsync(); try { using (var ctx = new LodgingContext(_options)) { await ctx.Database.EnsureCreatedAsync(); await ctx.Lodgings.AddAsync(lodging); await ctx.Rentals.AddAsync(rental); await ctx.Reviews.AddAsync(review); await ctx.SaveChangesAsync(); } using (var ctx = new LodgingContext(_options)) { var lodgings = new LodgingRepository(ctx); await lodgings.DeleteAsync(1); await ctx.SaveChangesAsync(); Assert.Empty(await ctx.Lodgings.ToListAsync()); } using (var ctx = new LodgingContext(_options)) { var rentals = new RentalRepository(ctx); await rentals.DeleteAsync(1); await ctx.SaveChangesAsync(); Assert.Empty(await ctx.Rentals.ToListAsync()); } using (var ctx = new LodgingContext(_options)) { var reviews = new ReviewRepository(ctx); await reviews.DeleteAsync(1); await ctx.SaveChangesAsync(); Assert.Empty(await ctx.Reviews.ToListAsync()); } } finally { await _connection.CloseAsync(); } }