public async Task TestGetAllDeletedReservations() { var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()); var reservationRepository = new EfDeletableEntityRepository <Reservation>(new ApplicationDbContext(options.Options)); await reservationRepository.AddAsync(new Reservation { Id = Guid.NewGuid().ToString(), Room = new Room { HotelId = 1, }, IsDeleted = true, }); await reservationRepository.AddAsync(new Reservation { Id = Guid.NewGuid().ToString(), Room = new Room { HotelId = 1, }, IsDeleted = false, }); await reservationRepository.SaveChangesAsync(); var reservationsService = new ReservationsService(reservationRepository); AutoMapperConfig.RegisterMappings(typeof(MyTestReservation).Assembly); var reservations = reservationsService.GetAllDeleted <MyTestReservation>(1); Assert.Single(reservations); }