Exemplo n.º 1
0
        public void Test_CreateAppointment_Success(int patientId, int specialtyId, string appointmentDateTime)
        {
            SQL.Appointments appointment = new SQL.Appointments
            {
                PatientId           = patientId,
                SpecialtyId         = specialtyId,
                AppointmentDateTime = Convert.ToDateTime(appointmentDateTime)
            };

            _appointmentRepository.Insert(appointment);
            _appointmentRepository.Save();

            Assert.IsTrue(appointment.Id > 0);
        }
        /// <summary>
        /// Creates a new appointment for an specific patient
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool CreateAppointment(AppointmentModel model)
        {
            bool isCreated = true;

            SQL.Appointments appDB = new SQL.Appointments
            {
                PatientId           = model.PatientId,
                SpecialtyId         = model.SpecialtyId,
                AppointmentDateTime = model.AppointmentDateTime
            };

            _appointmentRepository.Insert(appDB);
            _appointmentRepository.Save();

            return(isCreated);
        }