Example #1
0
 public SurveyController(
     ISurveysService surveysService,
     UserManager <ApplicationUser> userManager,
     IUsersService usersService,
     IAdsService adsService)
 {
     this.surveysService = surveysService;
     this.userManager    = userManager;
     this.usersService   = usersService;
     this.adsService     = adsService;
 }
        public SurveysServiceTests()
        {
            this.users        = new List <ApplicationUser>();
            this.surveys      = new List <Survey>();
            this.questions    = new List <Question>();
            this.usersSurveys = new List <UserSurvey>();
            this.answers      = new List <Answer>();

            var surveysRepository   = new EfDeletableEntityRepository <Survey>(this.DbContext);
            var questionsRepository = new EfDeletableEntityRepository <Question>(this.DbContext);
            var answersRepository   = new EfDeletableEntityRepository <Answer>(this.DbContext);

            var usersRepository        = new EfDeletableEntityRepository <ApplicationUser>(this.DbContext);
            var usersServeysRepository = new EfRepository <UserSurvey>(this.DbContext);

            this.service = new SurveysService(
                surveysRepository,
                questionsRepository,
                answersRepository,
                usersRepository,
                usersServeysRepository);

            this.InitializeRepositoriesData();
        }
Example #3
0
 public SurveysController(ISurveysService surveysService)
 {
     _surveysService = surveysService;
 }