示例#1
0
        public async void Schedule_Appointment_Not_Valid(SchedulingAppointmentDto appointment, HttpStatusCode expectedResponseStatusCode)
        {
            HttpClient client = factory.CreateClient();

            HttpResponseMessage response = await client.PostAsync("/api/appointment/", new StringContent(JsonConvert.SerializeObject(appointment), Encoding.UTF8, "application/json"));

            response.StatusCode.ShouldBeEquivalentTo(expectedResponseStatusCode);
        }
示例#2
0
 [HttpPost]       // POST /api/appointment/
 public IActionResult ScheduleAppointment(SchedulingAppointmentDto dto)
 {
     if (App.Instance().DoctorWorkDayService.ScheduleAppointment(SchedulingAppointmentMapper.AppointmentDtoToAppointment(dto)))
     {
         return(Ok());
     }
     return(NotFound());
 }
示例#3
0
        public static Appointment AppointmentDtoToAppointment(SchedulingAppointmentDto dto)
        {
            Appointment appointment = new Appointment();

            appointment.Canceled                     = dto.Canceled;
            appointment.DoctorWorkDayId              = dto.DoctorWorkDayId;
            appointment.StartTime                    = dto.StartTime;
            appointment.EndTime                      = dto.EndTime;
            appointment.MedicalExamination           = dto.MedicalExamination;
            appointment.MedicalExamination.PatientId = 1;

            return(appointment);
        }