Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Gender gender = Service.GetById(id);

            Service.Delete(gender);
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public async Task ShouldDelete()
        {
            PetFinderContext context       = dbContextFactory.CreateContext();
            Gender           gender        = CreateGender("Masculino");
            GenderService    genderService = new GenderService(context);

            await genderService.Save(gender);

            await genderService.Delete(gender.Id);

            int numberOfGenders = await context.Genders.CountAsync();

            // Deberia haber 2 generos que son los que vienen por defecto
            Assert.Equal <int>(2, numberOfGenders);
        }