public List <MedicalExamination> GetAllByWaitingRoom(int id)
        {
            WaitingRoom waitingRoom = new WaitingRoom();

            foreach (MedicalExamination m in ((IMedicalExaminationRepository)repository).GetAllByWaitingRoom(id))
            {
                waitingRoom.AddExamination(m);
            }
            //return ((IMedicalExaminationRepository)repository).GetAllByWaitingRoom(id);
            return((List <MedicalExamination>)waitingRoom.Examinations);
        }
Example #2
0
        public void Add_InvalidDate_Examinations()
        {
            // arrange
            WaitingRoom        waitingRoom        = new WaitingRoom();
            Doctor             doctor             = new Doctor();
            Patient            patient            = new Patient();
            DateTime           today              = DateTime.Today.AddDays(-1);
            ExaminationType    type               = new ExaminationType();
            MedicalExamination medicalExamination = new MedicalExamination(doctor, patient, today, type);

            // act
            waitingRoom.AddExamination(medicalExamination);

            // assert
            Assert.AreEqual(0, waitingRoom.Examinations.Count);
        }