public async Task ExistAsyncShouldReturnTrueWhenExists() { var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()).Options; var dbContext = new ApplicationDbContext(options); var userRepo = new EfDeletableEntityRepository <ApplicationUser>(dbContext); var service = new EmployeesService(userRepo); await userRepo.AddAsync(new ApplicationUser { FirstName = "ivan", LastName = "ivanov", MiddleName = "ivanov", EGN = "1234567890", }); await userRepo.SaveChangesAsync(); var customerId = (await userRepo.AllAsNoTracking() .FirstOrDefaultAsync()).Id; Assert.True(await service.ExistAsync(customerId)); }