public IActionResult Delete(int id) { Specialty newSpecialty = Specialty.Find(id); newSpecialty.Delete(); return(RedirectToAction("Index")); }
public ActionResult Destroy(int id) { Specialty deleteSpecialty = Specialty.Find(id); deleteSpecialty.Delete(); return(RedirectToAction("Index")); }
public ActionResult DeleteOne(int id) { Specialty thisSpecialty = Specialty.Find(id); thisSpecialty.Delete(); return(RedirectToAction("index")); }
public ActionResult Delete(int specialtyId) { Specialty mySpecialty = Specialty.Find(specialtyId); mySpecialty.Delete(); return(RedirectToAction("Display")); }
public ActionResult SpecialtyDelete(int SpecialtyId) { Specialty.Delete(SpecialtyId); List <Specialty> allSpecialty = Specialty.GetAll(); return(View("Index", allSpecialty)); }
public ActionResult DeleteSpecialty(int id) { Specialty thisSpecialty = Specialty.Find(id); thisSpecialty.Delete(); return(RedirectToAction("AllSpecialties")); }
public ActionResult Delete(int specialtyId) { Specialty specialty = Specialty.Find(specialtyId); specialty.Delete(); return(RedirectToAction("Index")); }
public void Delete_DeletesSpecialtyAssociationsFromDatabase_SpecialtyList() { //Arrange Stylist testStylist = new Stylist("x", "y", "z"); testStylist.Save(); string testTitle = "Loctician"; string testDescription = "Specializing in dreadlocks."; Specialty testSpecialty = new Specialty(testTitle, testDescription); testSpecialty.Save(); //Act testSpecialty.AddStylist(testStylist); testSpecialty.Delete(); List <Specialty> resultStylistSpecialties = testStylist.GetSpecialties(); List <Specialty> testStylistSpecialties = new List <Specialty> { }; //Assert CollectionAssert.AreEqual(testStylistSpecialties, resultStylistSpecialties); }
public ActionResult Delete(int id) { Specialty deleteSpecialty = Specialty.Find(id); deleteSpecialty.Delete(); return(RedirectToAction("ViewAll")); }
public ActionResult Destroy(int specialtyId) { Specialty specialty = Specialty.Find(specialtyId); specialty.Delete(); List <Specialty> allSpecialties = Specialty.GetAll(); return(RedirectToAction("Index", allSpecialties)); }
public ActionResult Delete(int id) { Specialty thisSpecialty = Specialty.Find(id); thisSpecialty.Delete(); List <Specialty> allSpecialties = Specialty.GetAll(); return(View("Index", allSpecialties)); }
public ActionResult DeleteSpecialtyFinal(int id) { Specialty selectedSpecialty = Specialty.Find(id); selectedSpecialty.Delete(); selectedSpecialty.DeleteFromJoin(); return(View()); }
public ActionResult DeleteSpecialty(int id) { Specialty newSpecialty = Specialty.Find(id); newSpecialty.Delete(); List <Specialty> allSpecialtys = Specialty.GetAll(); return(RedirectToAction("Specialtys", allSpecialtys)); }
public ActionResult Delete(string specialtyId) { int intSpecialtyId = int.Parse(specialtyId); Specialty foundSpecialty = Specialty.Find(intSpecialtyId); foundSpecialty.Delete(); List <Specialty> allSpecialties = Specialty.GetListOfSpecialties(); return(RedirectToAction("Index", allSpecialties)); }
public ActionResult Delete(int specialtyId) { Specialty specialty = Specialty.Find(specialtyId); specialty.Delete(); Dictionary <string, object> model = new Dictionary <string, object>(); model.Add("specialty", specialty); return(View(model)); }
public ActionResult Delete(int id) { Specialty currentSpecialty = Specialty.Find(id); currentSpecialty.Delete(currentSpecialty.GetId()); List <Specialty> allSpecialtys = Specialty.GetAll(); return(View("Index", allSpecialtys)); }
public ActionResult DeleteSpecialty(int specialtyId) { Specialty specialty = Specialty.Find(specialtyId); specialty.Delete(); // Dictionary<string, object> model = new Dictionary<string, object>(); // Stylist foundStylist = Stylist.Find(authorId); // List<Specialty> authorSpecialtys = foundStylist.GetSpecialtys(); // model.Add("specialty", authorSpecialtys); return(RedirectToAction("Index")); }
public void Specialty_Delete_DeletesFromDB() { Specialty newspec = new Specialty("Specialty Name"); newspec.Save(); int id = newspec.GetID(); newspec.Delete(); Specialty fromDB = Specialty.GetByID(id); Assert.IsNull(fromDB); }
public void Delete_DeletesInstanceofSpecialty_EmptyList() { Specialty specialty = new Specialty("Bangs"); specialty.Save(); specialty.Delete(); List <Specialty> expected = new List <Specialty> { }; List <Specialty> result = Specialty.GetAll(); CollectionAssert.AreEqual(expected, result); }
public void Specialtys_Detele_Seocond_Way() { Specialty firstSpecialty = new Specialty("color"); firstSpecialty.Save(); int id = firstSpecialty.GetSpecialtyId(); Specialty.Delete(id); int num = Specialty.GetAll().Count; Assert.AreEqual(0, num); }
public void Delete_DeletesASpecialty() { Specialty testSpecialty = new Specialty("test specialty type"); testSpecialty.Save(); testSpecialty.Delete(); List <Specialty> allSpecialties = Specialty.GetListOfSpecialties(); List <Specialty> result = new List <Specialty> { }; CollectionAssert.AreEqual(allSpecialties, result); }
public void Delete_DeletesSpecialty_EmptySpecialtyList() { string name = "Foils"; Specialty specialty = new Specialty(name); specialty.Save(); specialty.Delete(); List <Specialty> expected = new List <Specialty> { }; List <Specialty> actual = Specialty.GetAll(); CollectionAssert.AreEqual(expected, actual); }
public void Delete_RemovesSpecialtyFromDatabase_Void() { //Arrange Specialty testSpecialty = new Specialty("buzz cuts"); testSpecialty.Save(); //Act testSpecialty.Delete(); List <Specialty> allSpecialties = Specialty.GetAll(); //Assert Assert.AreEqual(0, allSpecialties.Count); }
public void Delete_DeletesObject_0() { //Arrange Specialty testSpecialty = new Specialty("Flight"); testSpecialty.Save(); //Act testSpecialty.Delete(); List <Specialty> result = Specialty.GetAll(); //Assert Assert.AreEqual(0, result.Count); }
public void Delete_DeletesSpecialtyFromDatabase_SpecialtyList() { Specialty testSpecialty = new Specialty("Highlights"); testSpecialty.Save(); List <Specialty> testList = new List <Specialty> { testSpecialty }; testSpecialty.Delete(); List <Specialty> result = Specialty.GetAll(); CollectionAssert.AreEqual(testList, result); }
public void Delete_DeleteSpecialtyInDatabase_Null() { //Arrange Specialty testSpecialty = new Specialty("Color"); testSpecialty.Save(); int testSpecialtyId = testSpecialty.id; //Act Specialty.Delete(testSpecialtyId); int count = Specialty.GetAll().Count; //Assert Assert.AreEqual(0, count); }
public void Delete_DeleteSpecialtyFromDatabase_void() { Specialty testSpecialty1 = new Specialty("buzz cut"); testSpecialty1.Save(); Specialty testSpecialty2 = new Specialty("layering"); testSpecialty2.Save(); testSpecialty1.Delete(); CollectionAssert.AreEqual(new List <Specialty> { testSpecialty2 }, Specialty.GetAll()); }
public void Delete_DeletesSpecialtyInDb_SpecialtyList() { Specialty newSpecialty1 = new Specialty("Chemistry", "Science"); newSpecialty1.Save(); Specialty newSpecialty2 = new Specialty("Chemistry", "Science"); newSpecialty2.Save(); Specialty.Delete(newSpecialty1.Id); List <Specialty> expectedList = new List <Specialty> { newSpecialty2 }; List <Specialty> actualList = Specialty.GetAll(); CollectionAssert.AreEqual(expectedList, actualList); }
public void Delete_UpdatesSpecialtyInDatabase_String() { //Arrange Specialty testSpecialty = new Specialty("test"); Specialty testSpecialty2 = new Specialty("test2"); testSpecialty.Save(); testSpecialty2.Save(); testSpecialty2.Delete(testSpecialty2.GetId()); List <Specialty> newList = new List <Specialty> { testSpecialty }; List <Specialty> result = Specialty.GetAll(); CollectionAssert.AreEqual(newList, result); }
public void Specialtys_Detele() { Specialty firstSpecialty = new Specialty("color"); firstSpecialty.Save(); int id = firstSpecialty.GetSpecialtyId(); Specialty NullSpecialty = new Specialty("", 0); Specialty.Delete(id); //int num = Specialty.GetAll().Count; Specialty notFound = Specialty.Find(id); //Assert // Assert.AreEqual(0, num) //Assert Assert.AreEqual(notFound, NullSpecialty); }