public PatientService()
 {
     surveyResponseService    = new SurveyResponseService();
     patientRepositoryFactory = new PatientFileRepositoryFactory();
     patientRepository        = patientRepositoryFactory.CreatePatientRepository();
     medicalRecordService     = new MedicalRecordService();
 }
        public void Creates_survey_response()
        {
            SetupRepositories();
            SurveyResponseService service  = new SurveyResponseService(_mockSurveyResponseRepository.Object);
            SurveyResponse        response = new SurveyResponse();

            service.CreateSurveyResponse(response);

            _mockSurveyResponseRepository.Verify(m => m.Create(response), Times.Once);
        }
Пример #3
0
        private void AddServices(IServiceCollection services)
        {
            var userFeedbackRepository    = new UserFeedbackSqlRepository(GetContextFactory());
            var surveyRepository          = new SurveySqlRepository(GetContextFactory());
            var surveyResponseRepository  = new SurveyResponseSqlRepository(GetContextFactory());
            var ratedSectionSqlRepository = new RatedSectionSqlRepository(GetContextFactory());
            var patientAccountsConnection = CreateConnection(UserUrl, "user/patient/accounts");
            var doctorConnection          = CreateConnection(UserUrl, "user/doctor");

            var userFeedbackService   = new UserFeedbackService(userFeedbackRepository, patientAccountsConnection);
            var surveyService         = new SurveyService(surveyRepository);
            var ratedSectionService   = new RatedSectionService(ratedSectionSqlRepository);
            var surveyResponseService = new SurveyResponseService(surveyResponseRepository);
            var surveyPreviewBuilder  = new SurveyPreviewBuilder(surveyService, ratedSectionService, doctorConnection);

            services.Add(new ServiceDescriptor(typeof(ISurveyResponseService), surveyResponseService));
            services.Add(new ServiceDescriptor(typeof(ISurveyService), surveyService));
            services.Add(new ServiceDescriptor(typeof(SurveyPreviewBuilder), surveyPreviewBuilder));
            services.Add(new ServiceDescriptor(typeof(IUserFeedbackService), userFeedbackService));
        }