public ActionResult Match(int id)
        {
            Patient      newPatient = Patient.Find(id);
            List <Donor> matches    = Donor.Find(newPatient.GetBloodType());

            return(View(matches));
        }
示例#2
0
        public void Find_DonorID_True()
        {
            //Arrange
            Donor testDonor = new Donor("Tim", "3333333", "08/11/93", "IIIRh+", "Healthy");

            testDonor.Save();

            //Act
            Donor result = Donor.Find(testDonor.GetId());

            //Assert
            Assert.AreEqual(testDonor, result);
        }
示例#3
0
        public void Find_DonorBloodType_True()
        {
            //Arrange
            Donor firstDonor = new Donor("Tim", "3333333", "08/11/93", "IIIRh+", "Healthy");

            firstDonor.Save();
            Donor secondDonor = new Donor("Mary", "555555", "10/22/94", "IIIRh+", "Healthy");

            secondDonor.Save();

            //Act
            List <Donor> testList = new List <Donor> {
            };

            testList.Add(firstDonor);
            testList.Add(secondDonor);
            List <Donor> result = Donor.Find("IIIRh+");

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
        public ActionResult DonorDetails(int id)
        {
            Donor newDonor = Donor.Find(id);

            return(View(newDonor));
        }