public async Task ShouldModifyAppointment()
        {
            var appointment = 1;
            var body        = new ReAssingmentAppointment()
            {
                reassigmentDate = DateTime.Now.AddDays(1).ToShortDateString(),
                doctorId        = 3
            };

            var appointmentController = new AppointmentsController(new Services.AppointmentServices())
            {
                Request = new HttpRequestMessage
                {
                    Method     = HttpMethod.Put,
                    Content    = new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json"),
                    RequestUri = new Uri($"{url}/{appointment}")
                }
            };

            appointmentController.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());

            var response = appointmentController.modifyAppointment(appointment, body);
            var result   = await response.ExecuteAsync(new System.Threading.CancellationToken());

            Assert.AreEqual(result.StatusCode, HttpStatusCode.OK);
        }
        public IHttpActionResult modifyAppointment(int id, [FromBody] ReAssingmentAppointment entity)
        {
            try
            {
                if (entity == null)
                {
                    ModelState.AddModelError("Entity", "First set the entity");
                }

                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                appointmentsServices.modifyAppointment(Convert.ToDateTime(entity.reassigmentDate), id, entity.doctorId);

                return(Ok());
            }
            catch (Exception e)
            {
                return(InternalServerError(e));
            }
        }