Esempio n. 1
0
        public void Patient_DeleteDoctorRelationship_DeletesRelationship()
        {
            Patient patient = new Patient("John", "john123", "123", new DateTime(1996, 04, 25));

            patient.Save();
            Doctor doctor1 = new Doctor("Tom", "tom567", "567", "Cardiology");

            doctor1.Save();
            Doctor doctor2 = new Doctor("John", "john567", "567", "Pediatrics");

            doctor2.Save();

            patient.AddDoctor(doctor1);
            patient.AddDoctor(doctor2);
            patient.DeleteDoctorRelationship(doctor1);

            List <Doctor> testList    = patient.GetDoctors();
            List <Doctor> controlList = new List <Doctor> {
                doctor2
            };

            Assert.Equal(controlList, testList);
        }