Exemplo n.º 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();
        }
Exemplo n.º 2
0
        public void TestGetBeds()
        {
            Ward ward = new Ward("UnitTestWard", "UTW");
            ward.Insert();
            Room room = new Room(1, "UnitTestWard", 1);
            room.Insert();
            List<Bed> beds = Bed.GetBeds(1, "UnitTestWard");
            Assert.True(beds.Count == 0);

            Bed bed = new Bed(1, Bed.States.Available, 0, 1, "", "UnitTestWard");
            bed.Insert();

            beds = Bed.GetBeds(1, "UnitTestWard");
            Assert.True(beds.Count == 1);

            Bed bed2 = new Bed(2, Bed.States.Available, 0, 1, "", "UnitTestWard");
            bed2.Insert();

            beds = Bed.GetBeds(1, "UnitTestWard");
            Assert.True(beds.Count == 2);

            bed2.Delete();
            bed.Delete();
            room.Delete();
            ward.Delete();
        }
Exemplo n.º 3
0
        public void TestDeleteRoom()
        {
            Room room = new Room(100000, "UnitTestWard", 1);
            room.Insert();

            Assert.True(room.Delete());
        }
Exemplo n.º 4
0
        public void TestGetRoomsWithValidWard()
        {
            Room room = new Room(100000, "UnitTestWard", 1);
            room.Insert();

            List<Room> rooms = Room.GetRooms("UnitTestWard");
            Assert.True(rooms.Count == 1);

            room.Delete();
        }
Exemplo n.º 5
0
        public void TestGetOpenBedsForWardWithValidWard()
        {
            Ward w = new Ward("UnitTestWard-WLP", "UTW");
            w.Insert();
            Room r = new Room(1, "UnitTestWard-WLP", 1);
            r.Insert();
            Bed b = new Bed(1, Bed.States.Available, 0, 1, "", "UnitTestWard-WLP");
            b.Insert();

            List<Bed> bed = WaitlistedPatient.GetOpenBedsForWard("UnitTestWard-WLP");
            Assert.True(bed.Count >= 1);

            b.Delete();
            r.Delete();
            w.Delete();
        }
Exemplo n.º 6
0
        public void TestUpdateRoom()
        {
            Room room = new Room(100000, "UnitTestWard", 1);
            room.Insert();

            room.FloorNo = 2;
            Assert.True(room.Update());

            room.Delete();
        }