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();
        }
Exemple #2
0
        public void Get_Appointments_In_Next_Two_Days_Unsuccessfuly_Because_They_Happend_After()
        {
            RegularAppointmentService service           = new RegularAppointmentService(CreateStubRepositoryForFuture(1), new OperationService(new Mock <IOperationRepository>().Object));
            List <DoctorAppointment>  foundAppointments = service.GetAppointmentsForPatientInTwoDays(1);

            foundAppointments.ShouldBeEmpty();
        }
Exemple #3
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);
        }
Exemple #4
0
        public void Get_Appointments_In_Future_Unsuccessfuly_Wrong_Patient()
        {
            RegularAppointmentService service           = new RegularAppointmentService(CreateStubRepositoryForFuture(2), new OperationService(new Mock <IOperationRepository>().Object));
            List <DoctorAppointment>  foundAppointments = service.GetAppointmentsForPatientInFuture(1);

            foundAppointments.ShouldBeEmpty();
        }
Exemple #5
0
        public void Get_Appointments_In_Next_Two_Days_Successfuly()
        {
            RegularAppointmentService service           = new RegularAppointmentService(CreateStubRepositoryForNextTwoDays(), new OperationService(new Mock <IOperationRepository>().Object));
            List <DoctorAppointment>  foundAppointments = service.GetAppointmentsForPatientInTwoDays(1);

            foundAppointments.ShouldNotBeEmpty();
        }
Exemple #6
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();
        }
Exemple #7
0
        public void Get_Appointments_Successfuly()
        {
            RegularAppointmentService service           = new RegularAppointmentService(CreateStubRepository(1), new OperationService(new Mock <IOperationRepository>().Object));
            List <DoctorAppointment>  foundAppointments = service.GetAppointmentsForPatient(1);

            foundAppointments.ShouldNotBeNull();
        }
        public void Get_Appointments_In_Future_Unsuccessfuly()
        {
            RegularAppointmentService service           = new RegularAppointmentService(CreateStubRepository(), 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));
            List <DoctorAppointment>  foundAppointments = service.GetAppointmentsForPatientInFuture(1);

            foundAppointments.ShouldBeEmpty();
        }
        public void Get_Appointments_In_Next_Two_Days_Unsuccessfuly_Because_They_Happend_Before()
        {
            RegularAppointmentService service           = new RegularAppointmentService(CreateStubRepository(), 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));
            List <DoctorAppointment>  foundAppointments = service.GetAppointmentsForPatientInTwoDays(1);

            foundAppointments.ShouldBeEmpty();
        }
        public void Find_Appointment_With_Empty_End()
        {
            RegularAppointmentService service = new RegularAppointmentService(CreateAppointmentStubRepository(), new Mock <IEmployeesScheduleRepository>().Object, new DoctorService(new Mock <IOperationRepository>().Object, CreateAppointmentStubRepository(), new Mock <IEmployeesScheduleRepository>().Object, new Mock <IDoctorRepository>().Object), new Mock <IPatientsRepository>().Object, new OperationService(new Mock <IOperationRepository>().Object));

            List <DoctorAppointment> foundAppointments = service.SimpleSearchAppointments(new AppointmentReportSearchDto("", "22/01/2020", "", "Appointment", 2));

            foundAppointments.ShouldNotBeEmpty();
        }
Exemple #11
0
        public void Find_No_Available_Appointment()
        {
            RegularAppointmentService service = new RegularAppointmentService(CreateAppointmentStubRepository(), CreateScheduleStubRepository(), new DoctorService(CreateOperationStubRepository(), CreateAppointmentStubRepository(), CreateScheduleStubRepository(), CreateDoctorStubRepository()), CreatePatientStubRepository(), new OperationService(CreateOperationStubRepository()));

            List <DoctorAppointment> appointments = service.GetRecommendedAppointment(new RecommendedAppointmentDto(1, "07/02/2020", "08/02/2020", "doctor"));

            appointments.ShouldBeEmpty();
        }
        public void Find_Appointments_With_Empty_Search()
        {
            RegularAppointmentService service = new RegularAppointmentService(CreateStubRepository(), 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));

            List <DoctorAppointment> foundAppointments = service.AdvancedSearchAppointments(new AppointmentAdvancedSearchDto("", "", new string[] { }, new string[] { }, new string[] { }));

            foundAppointments.ShouldNotBeEmpty();
        }
        public void Find_Appointments()
        {
            RegularAppointmentService service = new RegularAppointmentService(CreateStubRepository(), 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));

            List <DoctorAppointment> foundAppointments = service.AdvancedSearchAppointments(new AppointmentAdvancedSearchDto("date", "22/04/2020", new string[] { }, new string[] { }, new string[] { }));

            foundAppointments.ShouldHaveSingleItem();
        }
        public void Find_No_Available_Appointments()
        {
            RegularAppointmentService service = new RegularAppointmentService(CreateAppointmentStubRepository(), CreateScheduleStubRepository(), new DoctorService(CreateOperationStubRepository(), CreateAppointmentStubRepository(), CreateScheduleStubRepository(), CreateDoctorStubRepository()), CreatePatientStubRepository(), new OperationService(CreateOperationStubRepository()));

            List <DoctorAppointment> appointments = service.GetAllAvailableAppointmentsForDate("02/02/2020", 1, 2);

            appointments.ShouldBeEmpty();
        }
Exemple #15
0
        public void Find_Available_Appointment_For_Another_Date_Doctor_Priority()
        {
            RegularAppointmentService service = new RegularAppointmentService(CreateAppointmentStubRepository(), CreateScheduleStubRepository(), new DoctorService(CreateOperationStubRepository(), CreateAppointmentStubRepository(), CreateScheduleStubRepository(), CreateDoctorStubRepository()), CreatePatientStubRepository(), new OperationService(CreateOperationStubRepository()));

            List <DoctorAppointment> appointments = service.GetRecommendedAppointment(new RecommendedAppointmentDto(2, "01/03/2020", "02/03/2020", "doctor"));

            appointments.ShouldNotBeEmpty();
        }
        public void Find_Appointment()
        {
            RegularAppointmentService service = new RegularAppointmentService(CreateAppointmentStubRepository(), new Mock <IEmployeesScheduleRepository>().Object, new DoctorService(new Mock <IOperationRepository>().Object, CreateAppointmentStubRepository(), new Mock <IEmployeesScheduleRepository>().Object, new Mock <IDoctorRepository>().Object), new Mock <IPatientsRepository>().Object, new OperationService(new Mock <IOperationRepository>().Object));

            List <DoctorAppointment> foundAppointments = service.SimpleSearchAppointments(new AppointmentReportSearchDto("Per", "20/07/2020", "25/08/2020", "Appointment", 2));

            foundAppointments.ShouldHaveSingleItem();
        }
Exemple #17
0
        public void Find_Available_Appointment_Doctor_Busy_But_Priority_Date()
        {
            RegularAppointmentService service = new RegularAppointmentService(CreateAppointmentStubRepository(), CreateScheduleStubRepository(), new DoctorService(CreateOperationStubRepository(), CreateAppointmentStubRepository(), CreateScheduleStubRepository(), CreateDoctorStubRepository()), CreatePatientStubRepository(), new OperationService(CreateOperationStubRepository()));

            List <DoctorAppointment> appointments = service.GetRecommendedAppointment(new RecommendedAppointmentDto(1, "06/03/2020", "08/03/2020", "date"));

            appointments.ShouldNotBeEmpty();
        }
        public void Create_Appointment()
        {
            RegularAppointmentService service = new RegularAppointmentService(CreateAppointmentStubRepository(), CreateScheduleStubRepository(), new DoctorService(CreateOperationStubRepository(), CreateAppointmentStubRepository(), CreateScheduleStubRepository(), CreateDoctorStubRepository()), CreatePatientStubRepository(), new OperationService(CreateOperationStubRepository()));

            DoctorAppointment appointment = service.CreateRecommended(new DoctorAppointment(7, new TimeSpan(0, 14, 0, 0, 0), "07/03/2020", new PatientUser(), new DoctorUser(1, "TestDoctorName1", "TestDoctorNameSurname1", "1234", "02/02/2020", "123", "email", "pass", "Grad",
                                                                                                                                                                             200.0, false, "Cardiology", new List <DoctorNotification>(), "Ordination 2"), new List <Referral>(), "1"));

            appointment.ShouldNotBeNull();
        }
Exemple #19
0
        public void Create_Appointment()
        {
            RegularAppointmentService service = new RegularAppointmentService(CreateAppointmentStubRepository(), new OperationService(CreateOperationStubRepository()));

            DateTime          dt          = DateTime.Now.AddDays(10);
            String            date        = dt.ToString("dd/MM/yyyy");
            DoctorAppointment appointment = service.CreateRecommended(new DoctorAppointment(8, new TimeSpan(0, 14, 0, 0, 0), date, 1, 1, new List <Referral>(), "1"));

            appointment.ShouldNotBeNull();
        }
 /// <summary>This constructor injects the SurveyController with matching SurveyService and RegularAppointmentService.</summary>
 public SurveyController(MyDbContext dbContext)
 {
     this.dbContext            = dbContext;
     SurveyService             = new SurveyService(new SurveyRepository(dbContext));
     regularAppointmentService = new RegularAppointmentService(new AppointmentRepository(), new EmployeesScheduleRepository(), new DoctorService(new OperationRepository(), new AppointmentRepository(), new EmployeesScheduleRepository(), new DoctorRepository()), new PatientsRepository(), new OperationService(new OperationRepository()));
 }
 /// <summary>This constructor initiates the DoctorAppointmentController's appointment service.</summary>
 public DoctorAppointmentController(MyDbContext context)
 {
     this.regularAppointmentService = new RegularAppointmentService(context);
     this.doctorService             = new DoctorService(context);
 }
 public AppointmentController()
 {
     regularAppointmentService = new RegularAppointmentService(new AppointmentRepository(), new EmployeesScheduleRepository(), new DoctorService(new OperationRepository(), new AppointmentRepository(), new EmployeesScheduleRepository(), new DoctorRepository()), new PatientsRepository(), new OperationService(new OperationRepository()));
     contextAppointmentService = new ContextAppointmentService(regularAppointmentService);
 }
Exemple #23
0
 public SurveyController(MyDbContext dbContext)
 {
     this.dbContext            = dbContext;
     SurveyService             = new SurveyService(new SurveyRepository(dbContext));
     regularAppointmentService = new RegularAppointmentService(new AppointmentRepository(dbContext), new OperationService(new OperationRepository(dbContext)));
 }
Exemple #24
0
 /// <summary>This constructor injects the SurveyController with matching SurveyService and RegularAppointmentService.</summary>
 public SurveyController()
 {
     SurveyService             = new SurveyService(new SurveyRepository());
     regularAppointmentService = new RegularAppointmentService(new AppointmentRepository(), new EmployeesScheduleRepository(), new DoctorService(new OperationRepository(), new AppointmentRepository(), new EmployeesScheduleRepository(), new DoctorRepository()), new PatientsRepository(), new OperationService(new OperationRepository()));
 }
 /// <summary>This constructor initiates the DoctorAppointmentController's appointment service.</summary>
 public DoctorAppointmentController(MyDbContext dbContext, EventDbContext eventDbContext = null)
 {
     regularAppointmentService         = new RegularAppointmentService(dbContext);
     appointmentSchedulingEventService = eventDbContext != null ? new AppointmentSchedulingEventService(new AppointmentSchedulingEventRepository(eventDbContext)) : null;
 }