public PatientSurveyTests()
 {
     surveyPreviewBuilder = new SurveyPreviewBuilder(
         mockSurveyService.Object,
         mockRatedSectionService.Object,
         mockDoctorConnection.Object);
 }
Example #2
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));
        }
Example #3
0
 public SurveyController(SurveyPreviewBuilder surveyPreviewBuilder, ISurveyResponseService surveyResponseService, ISurveyService surveyService)
 {
     _surveyPreviewBuilder  = surveyPreviewBuilder;
     _surveyResponseService = surveyResponseService;
     _surveyService         = surveyService;
 }