Ejemplo n.º 1
0
        public async Task MarkAllApplyingsAsDeleted()
        {
            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.MarkAllApplyingsAsDeleted("1");

            var user = repository.AllWithDeleted().Where(x => x.UserId == "1").FirstOrDefault();

            Assert.True(user.IsDeleted);
        }