public async Task Should_get_x_parkingLots_for_page_y_Via_Service() { var scope = Factory.Services.CreateScope(); var scopedServices = scope.ServiceProvider; ParkingLotDbContext context = scopedServices.GetRequiredService <ParkingLotDbContext>(); ParkingLotService parkingLotService = new ParkingLotService(context); context.ParkingLots.RemoveRange(context.ParkingLots); context.SaveChanges(); var addReturn1 = await parkingLotService.AddParkingLot(parkingLotDto1); var addReturn2 = await parkingLotService.AddParkingLot(parkingLotDto2); var getAllReturn = await parkingLotService.GetByPageSizeAndIndex(1, 1); Assert.Equal(1, getAllReturn.Count); }