コード例 #1
0
ファイル: DonorTest.cs プロジェクト: denniseortega/blood_bank
        public void AddPatient_AddsPatientToDonor_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
            testDonor.AddPatient(testPatient);

            List <Patient> result = testDonor.GetPatients();

            Console.WriteLine(result.Count);
            List <Patient> testList = new List <Patient> {
                testPatient
            };

            Console.WriteLine(testList.Count);

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
コード例 #2
0
ファイル: DonorTest.cs プロジェクト: denniseortega/blood_bank
        public void Delete_DeletesDonorAssociationsFromDatabase_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
            testDonor.AddPatient(testPatient);
            testDonor.Delete();

            List <Donor> resultDonorPatients = testPatient.GetDonors();
            List <Donor> testDonorPatients   = new List <Donor> {
            };

            //Assert
            CollectionAssert.AreEqual(testDonorPatients, resultDonorPatients);
        }