예제 #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 TestGetTreatments()
        {
            Treatment t = new Treatment(100000, "UnitTestTreatment", 1, 1, 1, "", "", 1, "History5");
            t.Insert();
            List<Treatment> list = Treatment.GetTreatments(100000, "History5");
            Assert.True(list.Count >= 1);

            Treatment treatment = list[0];
            treatment.Delete();
        }
예제 #3
0
        public void TestTreatmentUpdate()
        {
            Treatment t = new Treatment(100000, "UnitTestTreatment", 1, 1, 1, "", "", 1, "History3");
            t.Insert();
            List<Treatment> list = Treatment.GetTreatments(100000, "History3");

            Treatment treatment = list[0];
            treatment.Notes = "TEST NOTES";
            Assert.True(treatment.Update());

            treatment.Delete();
        }
예제 #4
0
        public void TestTreatmentSelect()
        {
            Treatment t = new Treatment(100000, "UnitTestTreatment", 1, 1, 1, "", "", 1,"History1");

            t.Insert();
            List<Treatment> list = Treatment.GetTreatments(100000,"History1");

            Treatment treatment = list[0];
            Assert.True(treatment.Select());

            treatment.Delete();
        }