public void AddDonor_AddsDonorToPatient_DonorList() { //Arrange Patient testPatient = new Patient("Tim", "9999999", "03/05/75", "IIRh-", "Ds"); testPatient.Save(); Donor testDonor = new Donor("Tim", "3333333", "08/11/93", "IIIRh+", "Healthy"); testDonor.Save(); //Act testPatient.AddDonor(testDonor); List <Donor> result = testPatient.GetDonors(); Console.WriteLine(result.Count); List <Donor> testList = new List <Donor> { testDonor }; Console.WriteLine(testList.Count); //Assert CollectionAssert.AreEqual(testList, result); }
public void Delete_DeletesPatientAssociationsFromDatabase_PatientList() { //Arrange Donor testDonor = new Donor("Tim", "3333333", "08/11/93", "IIIRh+", "Healthy"); testDonor.Save(); Patient testPatient = new Patient("Tim", "9999999", "03/05/75", "IIRh-", "Ds"); testPatient.Save(); //Act testPatient.AddDonor(testDonor); testPatient.Delete(); List <Patient> resultDonorPatients = testDonor.GetPatients(); List <Patient> testDonorPatients = new List <Patient> { }; //Assert CollectionAssert.AreEqual(testDonorPatients, resultDonorPatients); }