예제 #1
0
        public void TestEditPatientInWaitlist()
        {
            Ward w = new Ward("UnitTestWard-WLP", "UTW");
            w.Insert();
            Room r = new Room(1, "UTW", 1);
            r.Insert();
            Bed b = new Bed(1, Bed.States.Available, 0, 1, "", "UTW");
            b.Insert();
            Patient p = new Patient(10000, "Test-WLP", "Test-WLP", new DateTime(), "", "", "", "", "", "", "");
            p.Insert();
            p.Select();
            Treatment treat = new Treatment(p.PatientID, "UnitTestTreatment-WLP", 1, 1, 1, "", "", 1, "Upcoming");
            treat.Insert();
            List<Treatment> list = Treatment.GetTreatments(p.PatientID, "Upcoming");
            Treatment t = list[0];

            WaitlistedPatient.AddPatientToWaitlist(p.PatientID, "UTW", "High", t.TreatmentID);
            List<WaitlistedPatient> patients = WaitlistedPatient.GetWaitlistedPatientsForWard("UTW");

            Assert.True(WaitlistedPatient.EditPatientInWaitlist(p.PatientID, "UTW", "High", t.TreatmentID));

            patients[0].RemovedPatientFromWaitlist();
            t.Delete();
            p.Delete();
            b.Delete();
            r.Delete();
            w.Delete();
        }
예제 #2
0
 public void TestGetPatientsWithValidPid()
 {
     Patient p = new Patient(10000);
     p.Insert();
     p.Select();
     Assert.True(p.GetPatient(p.PatientID));
     p.Delete();
 }
예제 #3
0
        public void TestPatientUpdate()
        {
            Patient patient = new Patient(10000000, "UnitTestPatient", "UnitTestLName", new DateTime(), "", "", "", "", "", "", "");
            patient.Insert();
            patient.Select();

            patient.FirstName = "RenamedPatient";
            Assert.True(patient.Update());

            patient.Delete();
        }
예제 #4
0
        public void TestPatientSelect()
        {
            Patient patient = new Patient(10000000, "UnitTestPatient", "UnitTestLName", new DateTime(), "", "", "", "", "", "", "");
            patient.Insert();

            Assert.True(patient.Select());

            patient.Delete();
        }
예제 #5
0
        public void TestSearchPatientWithValidQueryByMultipleExactParamters()
        {
            Patient p1 = new Patient(10000, "SearchFname1", "SearchLname1", new DateTime(), "Test Address", "Test City1", "Test Provice", "TEST", "1111111111", "2222222222", "3333333333");
            p1.Insert();
            p1.Select();

            Patient p2 = new Patient(20000, "SearchFname2", "SearchLname2", new DateTime(), "Test Address", "Test City2", "Test Provice", "TEST", "4444444444", "5555555555", "6666666666");
            p2.Insert();
            p2.Select();

            List<string> db = new List<string>();
            db.Add("fname");
            db.Add("lname");
            db.Add("city");

            List<string> s = new List<string>();
            s.Add("SearchFname1");
            s.Add("SearchLname1");
            s.Add("Test City1");

            Search search = new Search("Patient");
            search.UseInputs(db, s);

            List<Patient> p = Search.SearchPatient(search.GetBuiltQuery());
            //Assert.True(p[0].PatientID == p1.PatientID);

            p1.Delete();
            p2.Delete();
        }
예제 #6
0
        public void TestSearchPatientWithValidQueryByCloseProvice()
        {
            Patient p1 = new Patient(10000, "SearchFname1", "SearchLname1", new DateTime(), "Test Address", "Test City", "Test Provice", "TEST", "1111111111", "2222222222", "3333333333");
            p1.Insert();
            p1.Select();

            Patient p2 = new Patient(20000, "SearchFname2", "SearchLname2", new DateTime(), "Test Address", "Test City", "Test Provice", "TEST", "4444444444", "5555555555", "6666666666");
            p2.Insert();
            p2.Select();

            List<string> db = new List<string>();
            db.Add("province");

            List<string> s = new List<string>();
            s.Add("Test");

            Search search = new Search("Patient");
            search.UseInputs(db, s);

            List<Patient> p = Search.SearchPatient(search.GetBuiltQuery());
            Assert.True(p.Count >= 2);

            p1.Delete();
            p2.Delete();
        }