Ejemplo n.º 1
0
 public DeliveryEventHandler(
     ISubscriberRepository subscriberRepository,
     ISubscriptionService subscriptionService)
 {
     _subscriberRepository = subscriberRepository;
     _subscriptionService  = subscriptionService;
 }
Ejemplo n.º 2
0
 public UnitOfWork(BlogContext context)
 {
     _context    = context;
     Posts       = new PostRepository(context);
     Categories  = new CategoryRepository(context);
     Subscribers = new SubscribtionRepository(context);
 }
Ejemplo n.º 3
0
 public GameController(ISubscriberRepository iSubscriberRepository, IAppUserRepository iAppUserRepository, GameData.NGSubscriptionsEntities nGSubscriptionsEntities, Entities.GameContext context)
 {
     _context = context;
     _NGSubscriptionsEntities = nGSubscriptionsEntities;
     _ISubscriberRepository   = iSubscriberRepository;
     _IAppUserRepository      = iAppUserRepository;
 }
 /// <summary>
 ///In constructor, we can get needed classes/interfaces.
 ///They are sent here by dependency injection system automatically.
 /// </summary>
 public SubscriberAppService(ISubscriberRepository subscriberRepository,
     ISubscriberCriteriaRepository subscriberCriteriaRepository,
     IInquiryExtRepository inquiryExtRepository,
     IRequestExtRepository requestExtRepository,
     ISubscriberPurchaseRepository subscriberPurchaseRepository,
     ISubscriberRequestRepository subscriberRequestRepository,
     ISubscriberRequestDetailsRepository subscriberRequestDetailRepoitory,
     ISubscriberCreditsRepository subscriberCreditsRepository,
     ISubscriberRequestStateRepository subscriberRequestStateRepository,
     IFileExtRepository fileExtRepository,
     IDocumentHeroConnect documentHeroService,
     IGeocodingAppService geocodingService
     )
 {
     _subscribersRepository = subscriberRepository;
     _subscribersValuesRepository = subscriberCriteriaRepository;
     _inquiryExtRepository = inquiryExtRepository;
     _requestExtRepository = requestExtRepository;
     _subscriberPurchaseRepository = subscriberPurchaseRepository;
     _subscriberRequestRepository = subscriberRequestRepository;
     _subscriberRequestDetailRepository = subscriberRequestDetailRepoitory;
     _subscriberCreditsRepository = subscriberCreditsRepository;
     _subscriberRequestStateRepository = subscriberRequestStateRepository;
     _fileExtRepository = fileExtRepository;
     _documentHeroService = documentHeroService;
     _geocodingService = geocodingService;
 }
 /// <inheritdoc />
 public NullRepositoryContext()
 {
     _messageRepository = new NullMessageRepository();
     _messageBrokerServiceRepository = new NullMessageBrokerServiceRepository();
     _messageStateRepository         = new NullMessageStateRepository();
     _subscriberRepository           = new NullSubscriberRepository();
 }
Ejemplo n.º 6
0
        public SubscriberModule(ISubscriberRepository subscriberRepository) : base("/subscribers")
        {
            this._subscriberRepository = subscriberRepository;

            // Read All
            Get("/subscribers", async parameters =>
            {
                return(await Response.AsJson(this._subscriberRepository.GetAllSubscribers()));
            });

            // Read A Specific
            Get("/{email}", async parameters =>
            {
                // Create subscriber from the recived data
                Subscriber Subscriber = await this._subscriberRepository.GetSubscriber(parameters.email);
                if (Subscriber == null)
                {
                    return(Response.AsJson(new { Error = "No subscriber found with id " + parameters.email }));
                }

                return(Response.AsJson(Subscriber));
            });

            // Create
            Post("/", parameters =>
            {
                // Create subscriber from the recived data
                var Subscriber        = this.Bind <Subscriber>();
                Subscriber.Subscribed = true;
                this._subscriberRepository.AddSubscriber(Subscriber);
                return(Response.AsJson(Subscriber));
            });

            // Update
            Patch("/{email}/unsubscribe", async parameters =>
            {
                // Create subscriber from the recived data
                bool Unsubscribed = await this._subscriberRepository.Unsubscribe(parameters.email);

                if (!Unsubscribed)
                {
                    return(Response.AsJson("Failed"));
                }
                return(Response.AsJson("Success"));
            });

            // Delete
            Delete("/{email}", async parameters =>
            {
                // Create subscriber from the recived data
                bool Deleted = await this._subscriberRepository.RemoveSubscriber(parameters.email);

                if (!Deleted)
                {
                    return(Response.AsJson("Failed"));
                }
                return(Response.AsJson("Success"));
            });
        }
 public SubscribersController(
     ILogger <SubscribersController> logger,
     ISubscriberRepository subscriberRepository
     )
 {
     _logger = logger;
     _subscriberRepository = subscriberRepository;
 }
Ejemplo n.º 8
0
 public SubscriberResolver(
     ISubscriberRepository subscriberRepository,
     IMapper mapper
     )
 {
     _subscriberRepository = subscriberRepository ?? throw new ArgumentNullException("subscriberRepository");
     _mapper = mapper ?? throw new ArgumentNullException("mapper");
 }
        public DashboardModel(ISubscriberRepository subscriberData, IDeviceRepository deviceData, IBillingRepository billingData)
        {
            _SubscriberData = subscriberData;

            _DeviceData = deviceData;

            _BillingData = billingData;
        }
Ejemplo n.º 10
0
 public SubscriberController(ISubscriberRepository subscriberRepository,
                             ISubscriberService subscriberService,
                             IMapper mapper)
 {
     _subscriberRepository = subscriberRepository;
     _subscriberService    = subscriberService;
     _mapper = mapper;
 }
 public UnitOfWork(ApplicationDbContext context)
 {
     _context    = context;
     Products    = new ProductRepository(_context);
     Categories  = new CategoriesRepository(_context);
     Tags        = new TagsRepository(_context);
     Subscribers = new SubscriberRepository(_context);
 }
Ejemplo n.º 12
0
 internal SubscriberBuilder(ISubscriberRepository subscriberRepository,
                             IAccessDeviceRepository accessDeviceRepository,
                             IPhoneRepository phoneRepository)
 {
     _subscriberRepository = subscriberRepository;
     _accessDeviceRepository = accessDeviceRepository;
     _phoneRepository = phoneRepository;
 }
 public DataAccessProcessor(ISubscriberRepository subscriberRepository,
                            ISubscriberByOriginationDestinationRepository subscriberByOriginationDestinationRepository, IDispatchMessageRepository dispatchMessageRepository,
                            ISubscriberInfoBySubscriberIdsInUnmatchedDispatchRepository subscriberIdsInUnmatchedDispatchRepository)
 {
     _subscriberRepository = subscriberRepository;
     _subscriberByOriginationDestinationRepository = subscriberByOriginationDestinationRepository;
     _dispatchMessageRepository = dispatchMessageRepository;
     _subscriberInfoBySubscriberIdsInUnmatchedDispatchRepository = subscriberIdsInUnmatchedDispatchRepository;
 }
 public CasePlanInstanceProcessor(
     ICMMNProcessorFactory processorFactory,
     ISubscriberRepository subscriberRepository,
     IBusControl busControl)
 {
     _processorFactory     = processorFactory;
     _subscriberRepository = subscriberRepository;
     _busControl           = busControl;
 }
Ejemplo n.º 15
0
 public LoyaltyService(IOptions <AppSettings> appSettings,
                       ILogger <AuditTrialService> log,
                       ISubscriberRepository subscriberRepository,
                       IHttpContextAccessor httpContextAccessor)
 {
     _subscriberRepository = subscriberRepository;
     _appSettings          = appSettings.Value;
     _log = log;
 }
Ejemplo n.º 16
0
 public BaseExternalEventNotification(
     ICasePlanInstanceCommandRepository casePlanInstanceCommandRepository,
     ISubscriberRepository subscriberRepository,
     ICasePlanInstanceProcessor casePlanInstanceProcessor)
 {
     _casePlanInstanceCommandRepository = casePlanInstanceCommandRepository;
     _subscriberRepository      = subscriberRepository;
     _casePlanInstanceProcessor = casePlanInstanceProcessor;
 }
 public Service(IBookRepository bookRepository, ILibrarianRepository librarianRepository, ISubscriberRepository subscriberRepository, IBorrowedBookRepository borrowedBookRepository, IReservedBookRepository reservedBookRepository, IReturnedBookRepository returnedBookRepository)
 {
     this.bookRepository         = bookRepository;
     this.librarianRepository    = librarianRepository;
     this.subscriberRepository   = subscriberRepository;
     this.borrowedBookRepository = borrowedBookRepository;
     this.reservedBookRepository = reservedBookRepository;
     this.returnedBookRepository = returnedBookRepository;
 }
 public SubscriberRegister(ISubscriberRepository subscriberRepository,
                           IPassportSearchRepository passportSearchRepository,
                           IPassportRepository passportRepository,
                           IMd5Encrypter encrypt)
 {
     _subscriberRepository     = subscriberRepository;
     _passportSearchRepository = passportSearchRepository;
     _passportRepository       = passportRepository;
     _encrypt = encrypt;
 }
Ejemplo n.º 19
0
 public RegisterSubscriberModel(ISubscriberRepository subscriberData, UserManager <IdentityUser> UserManager,
                                RoleManager <IdentityRole> roleManager, SignInManager <IdentityUser> SignInManager, IEmailSender emailSender,
                                IConfiguration configuration)
 {
     _SubscriberData = subscriberData;
     _userManager    = UserManager;
     _roleManager    = roleManager;
     _signInManager  = SignInManager;
     _emailSender    = emailSender;
     _configuration  = configuration;
 }
Ejemplo n.º 20
0
 public SubscribersController(ISubscriberRepository subscriberRepository,
                              IOptions <AppSettings> appSettings,
                              ILogger <SubscribersController> log,
                              IAuditTrialService auditTrialService,
                              ICompareUtil compareUtil)
 {
     _subscriberRepository = subscriberRepository;
     _appSettings          = appSettings.Value;
     _log = log;
     _auditTrialService = auditTrialService;
     _compareUtil       = compareUtil;
 }
Ejemplo n.º 21
0
 public MasterController(ICustomerRepository customerRepo, IQBOAccessRepository qboaccessRepo, IInvoiceRepository invoiceRepo, ISubscriberRepository subscriberRepo, ILoggerManager logger, IErrorLogRepository errorLogRepo, IConfiguration configuration)
 {
     _customerRepo   = customerRepo;
     _qboaccessRepo  = qboaccessRepo;
     _invoiceRepo    = invoiceRepo;
     _subscriberRepo = subscriberRepo;
     _logger         = logger;
     _errorLogRepo   = errorLogRepo;
     _configuration  = configuration;
     useSandBox      = Convert.ToBoolean(_configuration["CDataConfiguration:useSandBox"]);
     runTimeLicense  = _configuration["CDataConfiguration:connectionRunTimeLicense"];
     serviceName     = GetType().Namespace.Substring(0, GetType().Namespace.IndexOf('.'));
 }
Ejemplo n.º 22
0
 /// <summary>
 ///In constructor, we can get needed classes/interfaces.
 ///They are sent here by dependency injection system automatically.
 /// </summary>
 public InquiryAppService(IInquiryRepository inquiryRepository,
     IInquiryExtRepository inquiryExtRepository,
     ICriteriaValuesRepository criteriaValuesRepository,
     ISubscriberRepository subscriberRepository,
     ISubscriberCriteriaRepository subscriberCriteriaRepository,
     INotificationRepository notificationRepository)
 {
     _inquiryExtRepository = inquiryExtRepository;
     _inquiryRepository = inquiryRepository;
     _criteriaValuesRepository = criteriaValuesRepository;
     _subscriberRepository = subscriberRepository;
     _subscriberCriteriaRepository = subscriberCriteriaRepository;
     _notificationRepository = notificationRepository;
 }
 private static Task <HttpResponseMessage> SendAsync(
     bool forceAuthentication     = false,
     string authorization         = null,
     ICache cache                 = null,
     HttpResponseMessage response = null,
     ISubscriberRepository subscriberRepository = null,
     Action <HttpRequestMessage, IPrincipal> assignPrincipalFactory = null)
 {
     return(new HttpMessageInvoker(
                CreateSubjectUnderTest(response, subscriberRepository, forceAuthentication, assignPrincipalFactory))
            .SendAsync(
                GetHttpRequestMessage(authorization, cache),
                It.IsAny <CancellationToken>()));
 }
Ejemplo n.º 24
0
        public SubscriberService(
            ISubscriberFactory factory,
            ISubscriberRepository repository,
            ISubscriberValidator validator)
        {
            factory.CheckArgumentIsNull(nameof(factory));
            _factory = factory;

            repository.CheckArgumentIsNull(nameof(repository));
            _repository = repository;

            validator.CheckArgumentIsNull(nameof(validator));
            _validator = validator;
        }
        public SubscriptionService(IResourceCounter resourceCounter, IAmazonSnsFacade amazonSnsFacade, IAmazonSqsFacade amazonSqsFacade, ISubscriberRepository subscriberRespoitroy, QueuePoller queuePoller)
        {
            Validate.That(resourceCounter).IsNotNull();
            Validate.That(amazonSnsFacade).IsNotNull();
            Validate.That(amazonSqsFacade).IsNotNull();
            Validate.That(queuePoller).IsNotNull();
            Validate.That(subscriberRespoitroy).IsNotNull();

            this.resourceCounter = resourceCounter;
            this.amazonSnsFacade = amazonSnsFacade;
            this.amazonSqsFacade = amazonSqsFacade;
            this.subscriberRespoitroy = subscriberRespoitroy;
            this.queuePoller = queuePoller;
        }
Ejemplo n.º 26
0
        public SubscriptionService(IResourceCounter resourceCounter, IAmazonSnsFacade amazonSnsFacade, IAmazonSqsFacade amazonSqsFacade, ISubscriberRepository subscriberRespoitroy, QueuePoller queuePoller)
        {
            Validate.That(resourceCounter).IsNotNull();
            Validate.That(amazonSnsFacade).IsNotNull();
            Validate.That(amazonSqsFacade).IsNotNull();
            Validate.That(queuePoller).IsNotNull();
            Validate.That(subscriberRespoitroy).IsNotNull();

            this.resourceCounter      = resourceCounter;
            this.amazonSnsFacade      = amazonSnsFacade;
            this.amazonSqsFacade      = amazonSqsFacade;
            this.subscriberRespoitroy = subscriberRespoitroy;
            this.queuePoller          = queuePoller;
        }
        public SubscriptionService(IResourceCounter resourceCounter, IAmazonSnsFacade amazonSnsFacade,
                                   IAmazonSqsFacade amazonSqsFacade, ISubscriberRepository subscriberRespoitroy, QueuePoller queuePoller)
        {
            resourceCounter.Requires("resourceCounter").IsNotNull();
            amazonSnsFacade.Requires("amazonSnsFacade").IsNotNull();
            amazonSqsFacade.Requires("amazonSqsFacade").IsNotNull();
            queuePoller.Requires("queuePoller").IsNotNull();
            subscriberRespoitroy.Requires("subscriberRespoitroy").IsNotNull();

            this.resourceCounter      = resourceCounter;
            this.amazonSnsFacade      = amazonSnsFacade;
            this.amazonSqsFacade      = amazonSqsFacade;
            this.subscriberRespoitroy = subscriberRespoitroy;
            this.queuePoller          = queuePoller;
        }
        public SubscriptionService(IResourceCounter resourceCounter, IAmazonSnsFacade amazonSnsFacade,
            IAmazonSqsFacade amazonSqsFacade, ISubscriberRepository subscriberRespoitroy, QueuePoller queuePoller)
        {
            resourceCounter.Requires("resourceCounter").IsNotNull();
            amazonSnsFacade.Requires("amazonSnsFacade").IsNotNull();
            amazonSqsFacade.Requires("amazonSqsFacade").IsNotNull();
            queuePoller.Requires("queuePoller").IsNotNull();
            subscriberRespoitroy.Requires("subscriberRespoitroy").IsNotNull();

            this.resourceCounter = resourceCounter;
            this.amazonSnsFacade = amazonSnsFacade;
            this.amazonSqsFacade = amazonSqsFacade;
            this.subscriberRespoitroy = subscriberRespoitroy;
            this.queuePoller = queuePoller;
        }
        internal XDAmazonListener(IIdentityProvider identityProvider, ISerializer serializer,
                                  ITopicRepository topicRepository,
                                  ISubscriberRepository subscriberRepository, ISubscriptionService subscriptionService)
        {
            identityProvider.Requires("identityProvider").IsNotNull();
            serializer.Requires("serializer").IsNotNull();
            topicRepository.Requires("topicRepository").IsNotNull();
            subscriberRepository.Requires("subscriberRepository").IsNotNull();
            subscriptionService.Requires("subscriptionService").IsNotNull();

            useLongLiveQueues         = identityProvider.Scope == IdentityScope.Machine;
            uniqueInstanceId          = identityProvider.GetUniqueId();
            this.serializer           = serializer;
            this.topicRepository      = topicRepository;
            this.subscriberRepository = subscriberRepository;
            this.subscriptionService  = subscriptionService;
        }
Ejemplo n.º 30
0
        internal XDAmazonListener(IIdentityProvider identityProvider, ISerializer serializer,
                                  ITopicRepository topicRepository,
                                  ISubscriberRepository subscriberRepository, ISubscriptionService subscriptionService)
        {
            Validate.That(identityProvider).IsNotNull();
            Validate.That(serializer).IsNotNull();
            Validate.That(topicRepository).IsNotNull();
            Validate.That(subscriberRepository).IsNotNull();
            Validate.That(subscriptionService).IsNotNull();

            useLongLiveQueues         = (identityProvider.Scope == IdentityScope.Machine);
            uniqueInstanceId          = identityProvider.GetUniqueId();
            this.serializer           = serializer;
            this.topicRepository      = topicRepository;
            this.subscriberRepository = subscriberRepository;
            this.subscriptionService  = subscriptionService;
        }
Ejemplo n.º 31
0
        internal XDAmazonListener(IIdentityProvider identityProvider, ISerializer serializer,
            ITopicRepository topicRepository,
            ISubscriberRepository subscriberRepository, ISubscriptionService subscriptionService)
        {
            identityProvider.Requires("identityProvider").IsNotNull();
            serializer.Requires("serializer").IsNotNull();
            topicRepository.Requires("topicRepository").IsNotNull();
            subscriberRepository.Requires("subscriberRepository").IsNotNull();
            subscriptionService.Requires("subscriptionService").IsNotNull();

            useLongLiveQueues = identityProvider.Scope == IdentityScope.Machine;
            uniqueInstanceId = identityProvider.GetUniqueId();
            this.serializer = serializer;
            this.topicRepository = topicRepository;
            this.subscriberRepository = subscriberRepository;
            this.subscriptionService = subscriptionService;
        }
Ejemplo n.º 32
0
        internal XDAmazonListener(IIdentityProvider identityProvider, ISerializer serializer,
                                  ITopicRepository topicRepository,
                                  ISubscriberRepository subscriberRepository, ISubscriptionService subscriptionService)
        {
            Validate.That(identityProvider).IsNotNull();
            Validate.That(serializer).IsNotNull();
            Validate.That(topicRepository).IsNotNull();
            Validate.That(subscriberRepository).IsNotNull();
            Validate.That(subscriptionService).IsNotNull();

            useLongLiveQueues = (identityProvider.Scope == IdentityScope.Machine);
            uniqueInstanceId = identityProvider.GetUniqueId();
            this.serializer = serializer;
            this.topicRepository = topicRepository;
            this.subscriberRepository = subscriberRepository;
            this.subscriptionService = subscriptionService;
        }
Ejemplo n.º 33
0
 /// <summary>
 ///In constructor, we can get needed classes/interfaces.
 ///They are sent here by dependency injection system automatically.
 /// </summary>
 public RequestsAppService(IRequestRepository requestsRepository,
     IInquiryRepository inquiryRepository,
     IInquiryExtRepository inquiryExtRepository,
     IRequestExtRepository requestsExtRepository,
     ICriteriaValuesRepository criteriaValuesRepository,
     ISubscriberRepository subscriberRepository,
     ISubscriberCriteriaRepository subscriberCriteriaRepository,
     INotificationRepository notificationRepository,
     ICompanyConfigRepository companyConfigRepository)
 {
     _requestsRepository = requestsRepository;
     _inquiryExtRepository = inquiryExtRepository;
     _inquiryRepository = inquiryRepository;
     _requestsExtRepository = requestsExtRepository;
     _criteriaValuesRepository = criteriaValuesRepository;
     _subscriberRepository = subscriberRepository;
     _subscriberCriteriaRepository = subscriberCriteriaRepository;
     _notificationRepository = notificationRepository;
     _companyConfigRepository = companyConfigRepository;
 }
Ejemplo n.º 34
0
        public BackgroundAlertService(
            SlackAPI slackAPI,
            IUserTimesRepository userPreferences,
            CredentialsRepository credentials,
            ISubscriberRepository subscriberRepository,
            MonthlyDataRepository monthlyDataRepository,
            UserRecordService userRecordService)
        {
            this.slackAPI              = slackAPI;
            this.userPreferences       = userPreferences;
            this.subscriberRepository  = subscriberRepository;
            this.monthlyDataRepository = monthlyDataRepository;
            this.userRecordService     = userRecordService;
            this.credentials           = credentials;
            currentTime = Utilities.CalculateSeconds(DateTime.Now);

            var time = DateTime.Now;

            firstOfMonth = time.Day == Constants.reportDay ? new DateTimeOffset(Utilities.NextReportDate(time)).ToUnixTimeSeconds() : new DateTimeOffset(Utilities.NextReportDate(time.AddMonths(1))).ToUnixTimeSeconds();
        }
Ejemplo n.º 35
0
 public BaseResponse DeleteSubscriber(string id)
 {
     try
     {
         ISubscriberRepository subscriberRepository = RepositoryClassFactory.GetInstance().GetSubscriberRepository();
         subscriberRepository.Delete(id);
         return(new BaseResponse
         {
             ErrorCode = (int)ErrorCode.None,
             Message = Resources.Resource.msg_delete_success
         });
     }
     catch (Exception ex)
     {
         return(new BaseResponse
         {
             ErrorCode = (int)ErrorCode.Error,
             Message = ex.Message
         });
     }
 }
Ejemplo n.º 36
0
 public BaseResponse UpdateSubscriber(SubscriberModel subscriber)
 {
     try
     {
         ISubscriberRepository subscriberRepository = RepositoryClassFactory.GetInstance().GetSubscriberRepository();
         var _sub = MapperUtil.CreateMapper().Mapper.Map <SubscriberModel, Subscriber>(subscriber);
         subscriberRepository.Update(_sub);
         return(new BaseResponse
         {
             ErrorCode = (int)ErrorCode.None,
             Message = Resources.Resource.msg_update_success
         });
     }
     catch (Exception ex)
     {
         return(new BaseResponse
         {
             ErrorCode = (int)ErrorCode.Error,
             Message = ex.Message
         });
     }
 }
            private static AclBasedSecurityMessageHandler CreateSubjectUnderTest(
                HttpResponseMessage response,
                ISubscriberRepository subscriberRepository,
                bool forceAuthentication = false,
                Action <HttpRequestMessage, IPrincipal> assignPrincipalFactory = null)
            {
                IPrincipal principal;

                if (assignPrincipalFactory.IsNull())
                {
                    assignPrincipalFactory = (r, p) => principal = p;
                }

                var sut = new AclBasedSecurityMessageHandler(forceAuthentication);

                sut.InnerHandler = new TestHandler(response);
                sut.SetSubscriberRepositoryFactory(
                    (config, request) => subscriberRepository ?? Mock.Of <ISubscriberRepository>());
                sut.SetAssignPrincipalFactory(assignPrincipalFactory);

                return(sut);
            }
Ejemplo n.º 38
0
 public FindAllItemReponse <SubscriberModel> GetSubscribers()
 {
     try
     {
         ISubscriberRepository subscriberRepository = RepositoryClassFactory.GetInstance().GetSubscriberRepository();
         IList <Subscriber>    result = subscriberRepository.FindAll();
         var _subs = result.Select(m => MapperUtil.CreateMapper().Mapper.Map <Subscriber, SubscriberModel>(m)).ToList();
         return(new FindAllItemReponse <SubscriberModel>
         {
             Items = _subs,
             ErrorCode = (int)ErrorCode.None,
             Message = string.Empty
         });
     }
     catch (Exception ex)
     {
         return(new FindAllItemReponse <SubscriberModel>
         {
             ErrorCode = (int)ErrorCode.Error,
             Message = ex.Message
         });
     }
 }
 private static Task<HttpResponseMessage> SendAsync(
     bool forceAuthentication = false,
     string authorization = null,
     ICache cache = null,
     HttpResponseMessage response = null,
     ISubscriberRepository subscriberRepository = null,
     Action<HttpRequestMessage, IPrincipal> assignPrincipalFactory = null)
 {
     return new HttpMessageInvoker(
         CreateSubjectUnderTest(response, subscriberRepository, forceAuthentication, assignPrincipalFactory))
         .SendAsync(
             GetHttpRequestMessage(authorization, cache),
             It.IsAny<CancellationToken>());
 }
Ejemplo n.º 40
0
 public HomeControllerService(ICatalogService catalogService, ISubscriberRepository subscriberRepository)
 {
     _catalogService = catalogService;
     _subscriberRepository = subscriberRepository;
 }
Ejemplo n.º 41
0
        public void TestInitializer()
        {
            // initialize fake context
            FakeContext = InitializeFakeContext<ISubscriberRepository>();

            // explicitly create fake dependencies that need to be intercepted
            //  (all other fake dependencies will be implicitly created by _fakeContext.Resolve<>)
            _fakeDataPersistence = A.Fake<IDataPersistence>();
            _fakeDataAccessService = A.Fake<IDataAccessService>();
            _fakeSubscriberProxies = A.Fake<IIndex<DataSource, ISubscriberProxy>>();

            // provide fake dependencies to context
            FakeContext.Provide(_fakeDataPersistence);
            FakeContext.Provide(_fakeDataAccessService);
            FakeContext.Provide(_fakeSubscriberProxies);

            // create system-under-test instance
            _subscriberRepositoryForTest = FakeContext.Resolve<ISubscriberRepository>();
        }
Ejemplo n.º 42
0
 public SubscriberService(ISubscriberRepository repo)
 {
 }
            private static AclBasedSecurityMessageHandler CreateSubjectUnderTest(
                HttpResponseMessage response,
                ISubscriberRepository subscriberRepository,
                bool forceAuthentication = false,
                Action<HttpRequestMessage, IPrincipal> assignPrincipalFactory = null)
            {
                IPrincipal principal;
                if (assignPrincipalFactory.IsNull())
                    assignPrincipalFactory = (r, p) => principal = p;

                var sut = new AclBasedSecurityMessageHandler(forceAuthentication);

                sut.InnerHandler = new TestHandler(response);
                sut.SetSubscriberRepositoryFactory(
                    (config, request) => subscriberRepository ?? Mock.Of<ISubscriberRepository>());
                sut.SetAssignPrincipalFactory(assignPrincipalFactory);

                return sut;
            }