Пример #1
0
        public void Cancel_Appointment_Successfuly()
        {
            RegularAppointmentService service     = new RegularAppointmentService(CreateStubRepository(), new OperationService(new Mock <IOperationRepository>().Object));
            DoctorAppointment         appointment = service.CancelAppointment(4);

            appointment.IsCanceled.ShouldBe(true);
        }
Пример #2
0
        public void Cancel_Appointment_In_Past()
        {
            RegularAppointmentService service     = new RegularAppointmentService(CreateStubRepositoryInPast(), new OperationService(new Mock <IOperationRepository>().Object));
            DoctorAppointment         appointment = service.CancelAppointment(4);

            appointment.ShouldBeNull();
        }
Пример #3
0
        public void Cancel_Appointment_In_Past()
        {
            RegularAppointmentService service     = new RegularAppointmentService(CreateStubRepositoryInPast(), new Mock <IEmployeesScheduleRepository>().Object, new DoctorService(new Mock <IOperationRepository>().Object, CreateStubRepository(), new Mock <IEmployeesScheduleRepository>().Object, new Mock <IDoctorRepository>().Object), new Mock <IPatientsRepository>().Object, new OperationService(new Mock <IOperationRepository>().Object));
            DoctorAppointment         appointment = service.CancelAppointment(4);

            appointment.ShouldBeNull();
        }
        public IActionResult CancelAppointment(int appointmentId)
        {
            DoctorAppointment appointment = regularAppointmentService.CancelAppointment(appointmentId);

            if (appointment == null)
            {
                return(BadRequest());
            }
            return(Ok(ViewAppointmentAdapter.AppointmentToViewAppointmenDto(appointment)));
        }