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); }
public void Cancel_Appointment_In_Past() { RegularAppointmentService service = new RegularAppointmentService(CreateStubRepositoryInPast(), new OperationService(new Mock <IOperationRepository>().Object)); DoctorAppointment appointment = service.CancelAppointment(4); appointment.ShouldBeNull(); }
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))); }