public ActionResult Update(int specialityId, string newName) { Speciality thisSpeciality = Speciality.Find(specialityId); thisSpeciality.Edit(newName); return(RedirectToAction("Show", new { id = specialityId })); }
public ActionResult EditDetails(int id, string specialityName) { Speciality editSpeciality = Speciality.Find(id); editSpeciality.Edit(specialityName); return(RedirectToAction("Index", "Home", new { activeId = 3 })); }
public ActionResult Update(int id) { Speciality thisSpeciality = Speciality.Find(id); thisSpeciality.Edit(Request.Form["updatespeciality"]); return(RedirectToAction("Index")); }
public void Edit_UpdatesSpecialityNameInDatabase_String() { Speciality testSpeciality = new Speciality("Cut"); testSpeciality.Save(); string secondName = "Color"; testSpeciality.Edit(secondName); string result = Speciality.Find(testSpeciality.GetId()).GetName(); Assert.AreEqual(secondName, result); }
public void Edit_Test() { //Arrange Speciality newSpeciality = new Speciality("layer cut"); newSpeciality.Save(); Speciality expectedSpeciality = new Speciality("hair coloring", newSpeciality.GetSpecialityId()); //Act newSpeciality.Edit("hair coloring"); //Assert Assert.AreEqual(expectedSpeciality, newSpeciality); }
public void Edit_EditedSpecialityHasDifferentValue_True() { //Arrange Speciality specialityOne = new Speciality("Cutting"); Speciality specialityTwo = new Speciality("Braiding"); specialityOne.Save(); int id = specialityOne.GetId(); //Act specialityOne.Edit("Braiding"); Speciality foundSpeciality = Speciality.Find(id); //Assert Assert.AreEqual(specialityTwo, foundSpeciality); }