public async Task CreateNewCandidateForJobPostingAsyncTest() { var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()); var repository = new EfDeletableEntityRepository <Candidate>(new ApplicationDbContext(options.Options)); foreach (var item in this.GetCandidatesData()) { await repository.AddAsync(item); await repository.SaveChangesAsync(); } var service = new CandidatesService(repository); await service.CreateNewCandidateForJobPostingAsync("8", "9"); var candidatesCount = repository.All().ToList().Count; Assert.Equal(4, candidatesCount); }