Exemplo n.º 1
0
        public void GivenAppointmentIdWhenRequestingByIdThenReturnsAppointmentDTO()
        {
            var appointment = _repository.Object.GetById(1).Result;

            var appointmentDto = _service.GetById(1);

            Assert.That(appointmentDto.GetType(), Is.EqualTo(typeof(AppointmentDTO)));
            Assert.That(appointment.Id, Is.EqualTo(appointmentDto.Id));
            Assert.That(appointment.Summary, Is.EqualTo(appointmentDto.Summary));
            Assert.That(appointment.Location, Is.EqualTo(appointmentDto.Location));
            Assert.That(appointment.StartDate, Is.EqualTo(appointmentDto.StartDate));
            Assert.That(appointment.EndDate, Is.EqualTo(appointmentDto.EndDate));
        }
Exemplo n.º 2
0
        public AppointmentAdminViewModel GetByIdAdminView(int id)
        {
            AppointmentViewModel      appointment = _appointmentsService.GetById(id);
            AppointmentAdminViewModel result      = new AppointmentAdminViewModel();

            if (appointment != null)
            {
                OfferViewModel offer = _offersService.GetById(appointment.offerId);
                result          = _mapper.Map <AppointmentViewModel, AppointmentAdminViewModel>(appointment);
                result.UserInfo = _userService.GetUserPersonalInfo(appointment.customerId);
                result.offer    = offer;
            }

            return(result);
        }
        public IActionResult Edit(int id)
        {
            var appointment = _mapper.Map <AppointmentViewModel>(_appointmentService.GetById(id));

            return(PartialView("_Edit", appointment));
        }
 public ActionResult <Model.Appointments> GetById(int id)
 {
     return(_service.GetById(id));
 }