コード例 #1
0
 public ClientAppRepo(
     IUsersContextFactory contextFactory,
     IConfigValueProvider configValueProvider)
 {
     _contextFactory      = Preconditions.ThrowIfNull(contextFactory, nameof(contextFactory));
     _configValueProvider = Preconditions.ThrowIfNull(configValueProvider, nameof(configValueProvider));
 }
コード例 #2
0
 public DefaultApplicationCreator(
     IUsersContextFactory usersContextFactory,
     IConfiguration configuration)
 {
     _usersContextFactory = Preconditions.ThrowIfNull(usersContextFactory, nameof(usersContextFactory));
     _configuration       = Preconditions.ThrowIfNull(configuration, nameof(configuration));
 }
コード例 #3
0
        public ClientAppRepo(
            IUsersContextFactory contextFactory,
            IConfigurationRoot config)
        {
            _contextFactory = Preconditions.ThrowIfNull(contextFactory, nameof(contextFactory));
            Preconditions.ThrowIfNull(config, nameof(config));

            _duration = new Lazy <int>(
                () =>
            {
                // Get the config value, defaulting to 1 hour
                if (!int.TryParse(
                        config.GetSection("BearerTokenTimeoutMinutes")
                        .Value,
                        out int duration))
                {
                    duration = DefaultDuration;
                }

                return(duration);
            });

            _defaultOperationalContextUri = new Lazy <string>(
                () => config.GetSection("DefaultOperationalContextUri")
                .Value);

            _defaultAppName = new Lazy <string>(
                () => config.GetSection("DefaultApplicationName")
                .Value);

            _defaultClaimSetName = new Lazy <string>(
                () => config.GetSection("DefaultClaimSetName")
                .Value);
        }
コード例 #4
0
ファイル: EmailScheduler.cs プロジェクト: Lietuva2/LT2
 /// <summary>
 /// Initializes a new instance of the <see cref="EmailScheduler"/> class.
 /// </summary>
 public EmailScheduler(NewsFeedService newsFeedService, UserService userService, IUsersContextFactory usersContextFactory, NewsLetterNotification notification)
     : base(Name)
 {
     this.newsFeedService     = newsFeedService;
     this.userService         = userService;
     this.usersContextFactory = usersContextFactory;
     this.notification        = notification;
 }
コード例 #5
0
 public DefaultApplicationCreator(
     IUsersContextFactory usersContextFactory,
     ITemplateDatabaseLeaQuery templateDatabaseLeaQuery,
     IConfigValueProvider configValueProvider)
 {
     _usersContextFactory      = Preconditions.ThrowIfNull(usersContextFactory, nameof(usersContextFactory));
     _templateDatabaseLeaQuery = Preconditions.ThrowIfNull(templateDatabaseLeaQuery, nameof(templateDatabaseLeaQuery));
     _configValueProvider      = Preconditions.ThrowIfNull(configValueProvider, nameof(configValueProvider));
 }
コード例 #6
0
ファイル: AddressService.cs プロジェクト: Lietuva2/LT2
 public AddressService(
     IUsersContextFactory usersSessionFactory,
     Func <INoSqlSession> mongoDbSessionFactory,
     IActionsContextFactory actionSessionFactory,
     IBus bus)
 {
     this.usersSessionFactory  = usersSessionFactory;
     this.noSqlSessionFactory  = mongoDbSessionFactory;
     this.actionSessionFactory = actionSessionFactory;
     this.bus = bus;
 }
コード例 #7
0
ファイル: ChatService.cs プロジェクト: Lietuva2/LT2
 public ChatService(
     IUsersContextFactory usersSessionFactory,
     Func <INoSqlSession> mongoDbSessionFactory,
     IVotingContextFactory votingSessionFactory,
     ICache cache)
 {
     this.usersSessionFactory  = usersSessionFactory;
     this.noSqlSessionFactory  = mongoDbSessionFactory;
     this.votingSessionFactory = votingSessionFactory;
     this.cache = cache;
 }
コード例 #8
0
ファイル: ProjectService.cs プロジェクト: Lietuva2/LT2
 public ProjectService(
     IActionsContextFactory actionSessionFactory,
     Func <INoSqlSession> noSqlSessionFactory,
     IUsersContextFactory userSessionFactory,
     ICache cache,
     IBus bus)
 {
     this.noSqlSessionFactory  = noSqlSessionFactory;
     this.actionSessionFactory = actionSessionFactory;
     this.userSessionFactory   = userSessionFactory;
     this.bus   = bus;
     this.cache = cache;
 }
コード例 #9
0
        protected override void Arrange()
        {
            _transaction = new TransactionScope();

            Factory = Stub <IUsersContextFactory>();

            A.CallTo(() => Factory.CreateContext())
            .Returns(new SqlServerUsersContext());

            SystemUnderTest = new AccessTokenClientRepo(Factory);

            TestFixtureContext = new SqlServerUsersContext();
        }
コード例 #10
0
ファイル: SponsorService.cs プロジェクト: Lietuva2/LT2
 public SponsorService(
     IUsersContextFactory usersSessionFactory,
     Func <INoSqlSession> mongoDbSessionFactory,
     IActionsContextFactory actionSessionFactory,
     OrganizationService organizationService,
     ICache cache,
     IBus bus,
     ILogger logger)
 {
     this.usersSessionFactory  = usersSessionFactory;
     this.noSqlSessionFactory  = mongoDbSessionFactory;
     this.actionSessionFactory = actionSessionFactory;
     this.organizationService  = organizationService;
     this.cache  = cache;
     this.bus    = bus;
     this.logger = logger;
 }
コード例 #11
0
 public NotificationService(
     IActionsContextFactory actionsSessionFactory,
     IUsersContextFactory usersSessionFactory,
     ProjectService projectService,
     OrganizationService organizationService,
     Func <INoSqlSession> noSqlSessionFactory,
     IVotingContextFactory votingSessionFactory,
     ILogger logger)
 {
     this.actionsSessionFactory = actionsSessionFactory;
     this.usersSessionFactory   = usersSessionFactory;
     this.projectService        = projectService;
     this.noSqlSessionFactory   = noSqlSessionFactory;
     this.votingSessionFactory  = votingSessionFactory;
     this.organizationService   = organizationService;
     this.logger = logger;
 }
コード例 #12
0
        public AccessTokenClientRepo(
            IUsersContextFactory contextFactory,
            IConfigurationRoot config)
        {
            _contextFactory = Preconditions.ThrowIfNull(contextFactory, nameof(contextFactory));
            _duration       = new Lazy <int>(
                () =>
            {
                // Get the config value, defaulting to 1 hour
                if (!int.TryParse(
                        config.GetSection("BearerTokenTimeoutMinutes")
                        .Value,
                        out int duration))
                {
                    duration = DefaultDuration;
                }

                return(duration);
            });
        }
コード例 #13
0
        protected override void Arrange()
        {
            _transaction = new TransactionScope();
            Factory      = Stub <IUsersContextFactory>();

            var config = new ConfigurationBuilder()
                         .SetBasePath(TestContext.CurrentContext.TestDirectory)
                         .AddJsonFile("appsettings.json", optional: true)
                         .AddEnvironmentVariables()
                         .Build();

            var connectionStringProvider = new ConfigConnectionStringsProvider(config);

            A.CallTo(() => Factory.CreateContext())
            .Returns(new SqlServerUsersContext(connectionStringProvider.GetConnectionString("EdFi_Admin")));

            SystemUnderTest = new AccessTokenClientRepo(Factory, config);

            TestFixtureContext = new SqlServerUsersContext(connectionStringProvider.GetConnectionString("EdFi_Admin"));
        }
コード例 #14
0
 public ChangePasswordNotification(IMailSender mailSender, ILogger logger, IActionsContextFactory context, IUsersContextFactory usersContextFactory)
     : base(mailSender, logger, context, usersContextFactory)
 {
 }
コード例 #15
0
 public NewsLetterNotification(IMailSender mailSender, ILogger logger, IActionsContextFactory context, IUsersContextFactory usersContextFactory)
     : base(mailSender, logger, context, usersContextFactory)
 {
 }
コード例 #16
0
 public UserConfirmedNotification(IMailSender mailSender, ILogger logger, IActionsContextFactory context, IUsersContextFactory usersContextFactory)
     : base(mailSender, logger, context, usersContextFactory)
 {
     IncludeUnsubscribe = false;
 }
コード例 #17
0
 public AdminProfileNamesPublisher(IUsersContextFactory usersContextFactory, IProfileResourceNamesProvider profileResourceNamesProvider)
 {
     _usersContextFactory          = Preconditions.ThrowIfNull(usersContextFactory, nameof(usersContextFactory));
     _profileResourceNamesProvider = Preconditions.ThrowIfNull(profileResourceNamesProvider, nameof(profileResourceNamesProvider));
 }
コード例 #18
0
 public PrivateMessage(IMailSender mailSender, ILogger logger, IActionsContextFactory context, IUsersContextFactory usersContextFactory)
     : base(mailSender, logger, context, usersContextFactory)
 {
 }
コード例 #19
0
 public NotificationTaskServiceBase(IMailSender mailSender, ILogger logger, IActionsContextFactory actionsContextFactory, IUsersContextFactory usersContextFactory)
     : base(mailSender, null, logger)
 {
     this.actionsContextFactory = actionsContextFactory;
     this.usersContextFactory   = usersContextFactory;
 }
コード例 #20
0
 public AccessTokenClientRepo(IUsersContextFactory contextFactory)
 {
     _contextFactory = Preconditions.ThrowIfNull(contextFactory, nameof(contextFactory));
 }
コード例 #21
0
 public ObjectCreatedNotification(IMailSender mailSender, ILogger logger, IActionsContextFactory context, IUsersContextFactory usersContextFactory)
     : base(mailSender, logger, context, usersContextFactory)
 {
     IncludeUnsubscribe = true;
 }