public ActionResult Edit(Patient patient) { if (ModelState.IsValid) { patientBusinessLayer.UpdatePatientDetials(patient); Logging.loggInfo($"Patient Edited with id = {patient.Id}"); return(RedirectToAction("Details/" + patient.Id)); } return(View(patient)); }
public void TestEditDetails() { PatientBusinessLayer businessLayer = new PatientBusinessLayer(); Patient patient = businessLayer.GetPatientByEmail("*****@*****.**"); patient.PatientUser.Name = "TestEdit"; patient.EmergengyContactName = "TestMother"; businessLayer.UpdatePatientDetials(patient); Assert.AreEqual("TestEdit", businessLayer.GetPatientNameById(patient.Id)); Assert.AreEqual("TestMother", businessLayer.GetPatientById(patient.Id).EmergengyContactName); }