public ActionResult DeleteConfirmed(int id) { Gender gender = Service.GetById(id); Service.Delete(gender); return(RedirectToAction("Index")); }
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); }