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

            await service.AddAsync(new QualificationCreateBindingModel()
            {
                Name = NAME_QUALIICATION
            });

            Assert.AreEqual(1, dbContext.Qualification.Count());
        }
Exemplo n.º 2
0
        public async Task Add_DeleteEntity_Restored()
        {
            var service = new AdminQualificationService(dbContext, userManager, roleManager, signInManager);

            await dbContext.Qualification.AddAsync(new Qualification(NAME_QUALIICATION) { IsDeleted = true });

            await dbContext.SaveChangesAsync();

            await service.AddAsync(new QualificationCreateBindingModel()
            {
                Name = NAME_QUALIICATION
            });

            Assert.AreEqual(1, dbContext.Qualification.Count());
            Assert.IsFalse(dbContext.Qualification.First().IsDeleted);
        }