public void GetDoctors_ReturnsAllSpecialtyDoctors_DoctorList() { //Arrange Specialty testSpecialty = new Specialty("Chiropractor"); testSpecialty.Save(); Doctor testDoctor1 = new Doctor("Sam"); testDoctor1.Save(); Doctor testDoctor2 = new Doctor("Taylor"); testDoctor2.Save(); //Act testSpecialty.AddDoctor(testDoctor1); List <Doctor> result = testSpecialty.GetDoctors(); List <Doctor> testList = new List <Doctor> { testDoctor1 }; //Assert CollectionAssert.AreEqual(testList, result); }
public ActionResult AddDoctor(int specialtyId) { Specialty specialty = Specialty.Find(specialtyId); Doctor doctor = Doctor.Find(Int32.Parse(Request.Form["doctor-id"])); specialty.AddDoctor(doctor); return(RedirectToAction("Success", "Home")); }
public ActionResult AddDoctor(int specialtyId, int doctorId) { Specialty specialty = Specialty.Find(specialtyId); Doctor doctor = Doctor.Find(doctorId); specialty.AddDoctor(doctor); return(RedirectToAction("Show", new { id = specialtyId })); }
public ActionResult CreateWithSpecialist(int specialist) { Doctor newDoctor = new Doctor(Request.Form["doctor-name"]); newDoctor.Save(); Specialty mySpecialty = Specialty.Find(specialist); mySpecialty.AddDoctor(newDoctor); return(RedirectToAction("Success", "Home")); }
public void AddDoctor_AddsDoctorToSpecialty_DoctorList() { //Arrange Specialty testSpecialty = new Specialty("Therapist"); testSpecialty.Save(); Doctor testDoctor = new Doctor("Joe"); testDoctor.Save(); //Act testSpecialty.AddDoctor(testDoctor); List <Doctor> result = testSpecialty.GetDoctors(); List <Doctor> testList = new List <Doctor> { testDoctor }; //Assert CollectionAssert.AreEqual(testList, result); }
public void Delete_DeletesSpecialtyAssociationsFromDatabase_SpecialtyList() { //Arrange Doctor testDoctor = new Doctor("Jim"); testDoctor.Save(); string testDescription = "Leg"; Specialty testSpecialty = new Specialty(testDescription); testSpecialty.Save(); //Act testSpecialty.AddDoctor(testDoctor); testSpecialty.Delete(); List <Specialty> resultDoctorSpecialtys = testDoctor.GetSpecialtys(); List <Specialty> testDoctorSpecialtys = new List <Specialty> { }; //Assert CollectionAssert.AreEqual(testDoctorSpecialtys, resultDoctorSpecialtys); }