public PollBuilderController(ITokenService tokenService, IPollRepository pollRepository,
                              IPollOptionRepository pollOptionRepository, IRequestHeaderHandler requestHeaderHandler)
 {
     _tokenService         = tokenService;
     _pollRepository       = pollRepository;
     _pollOptionRepository = pollOptionRepository;
     _requestHeaderHandler = requestHeaderHandler;
 }
예제 #2
0
 public PollRendererController(IPollRepository pollRepository, IPollOptionRepository pollOptionRepository,
                               IVoteRepository voteRepository, IRequestHeaderHandler requestHeaderHandler)
 {
     _pollRepository       = pollRepository;
     _pollOptionRepository = pollOptionRepository;
     _voteRepository       = voteRepository;
     _requestHeaderHandler = requestHeaderHandler;
 }
 public void Setup()
 {
     _tokenService          = Substitute.For <ITokenService>();
     _pollRepository        = Substitute.For <IPollRepository>();
     _pollOptionRepository  = Substitute.For <IPollOptionRepository>();
     _requestHeaderHandler  = Substitute.For <IRequestHeaderHandler>();
     _pollBuilderController = new PollBuilderController(_tokenService, _pollRepository,
                                                        _pollOptionRepository, _requestHeaderHandler);
 }
        public void Setup()
        {
            primaryKey            = 123;
            _pollRepository       = Substitute.For <IPollRepository>();
            _pollOptionRepository = Substitute.For <IPollOptionRepository>();
            _voteRepository       = Substitute.For <IVoteRepository>();
            _requestHeaderHandler = Substitute.For <IRequestHeaderHandler>();

            _pollRendererController = new PollRendererController(_pollRepository, _pollOptionRepository,
                                                                 _voteRepository, _requestHeaderHandler);
            _pollRepository.Select(Arg.Any <string>()).Returns(new PollDto());
            _pollOptionRepository.SelectAllForPollPk(Arg.Any <int>()).Returns(new List <PollOptionDto>());
            _pollRendererController.ControllerContext.HttpContext = new DefaultHttpContext();
            _pollRendererController.ControllerContext.HttpContext.Request.Headers["someId"] = "someId";
            _requestHeaderHandler.GetHeader(_pollRendererController.ControllerContext, "User-Agent").Returns("someAgent");
            _requestHeaderHandler.GetUserIp(_pollRendererController.ControllerContext).Returns("someIp");
        }
예제 #5
0
 public HomeController(IVoteRepository voteRepository, IRequestHeaderHandler requestHeaderHandler)
 {
     _voteRepository       = voteRepository;
     _requestHeaderHandler = requestHeaderHandler;
 }
 public void Setup()
 {
     _requestHeaderHandler = Substitute.For <IRequestHeaderHandler>();
     _voteRepository       = Substitute.For <IVoteRepository>();
     _homeController       = new HomeController(_voteRepository, _requestHeaderHandler);
 }