Exemplo n.º 1
0
        public async Task Delete_WithPersonnel_NetDeleted()
        {
            var service = new AdminQualificationService(dbContext, userManager, roleManager, signInManager);

            string itemId = Guid.NewGuid().ToString();

            await dbContext.Qualification.AddAsync(new Qualification(Roles.PERSONNEL) { Id = itemId });

            await dbContext.SaveChangesAsync();

            await service.DeleteAsync(itemId);

            Assert.IsFalse(dbContext.Qualification.Find(itemId).IsDeleted);
        }
Exemplo n.º 2
0
        public async Task Delete_WithOne_NotExisting()
        {
            var service = new AdminQualificationService(dbContext, userManager, roleManager, signInManager);

            string itemId = Guid.NewGuid().ToString();

            await dbContext.Qualification.AddAsync(new Qualification("TestQualification") { Id = itemId });

            await dbContext.SaveChangesAsync();

            await service.DeleteAsync(itemId);

            Assert.IsTrue(dbContext.Qualification.Find(itemId).IsDeleted);
        }