public DeleteTemplateHandler(NetBairesContext context,
                              IMapper mapper,
                              IFilesServices filesServices)
 {
     _context = context;
     _mapper  = mapper;
 }
Exemple #2
0
 public NewSponsorHandler(NetBairesContext context,
                          IMapper mapper,
                          IFilesServices filesServices)
 {
     _context           = context;
     _mapper            = mapper;
     this.filesServices = filesServices;
 }
Exemple #3
0
 public DeleteSponsorHandler(NetBairesContext context,
                             IMapper mapper,
                             IFilesServices filesServices)
 {
     _context      = context;
     _mapper       = mapper;
     filesServices = filesServices;
 }
 public BadgesServices(IOptions <CommonOptions> commonOptions,
                       IOptions <BadgesOptions> badgesOptions,
                       IFilesServices filesServices)
 {
     this._commonOptions = commonOptions.Value;
     this._badgesOptions = badgesOptions.Value;
     this._filesServices = filesServices;
 }
Exemple #5
0
 public UpdateMeHandler(ICurrentUser currentUser,
                        IMapper mapper,
                        IFilesServices filesServices,
                        NetBairesContext context,
                        ILogger <UpdateMeHandler> logger)
 {
     this.currentUser   = currentUser;
     _mapper            = mapper;
     this.filesServices = filesServices;
     _context           = context;
     _logger            = logger;
 }
Exemple #6
0
        public IntegrationTestsBase(
            CustomWebApplicationFactory <Startup> factory)
        {
            _factory   = factory;
            HttpClient = factory.WithWebHostBuilder(builder =>
            {
                builder.ConfigureServices(async services =>
                {
                    var serviceProvider = services.BuildServiceProvider();

                    var scope = serviceProvider.CreateScope();

                    var scopedServices = scope.ServiceProvider;
                    UserService        = scopedServices
                                         .GetRequiredService <IUserService>();

                    AttendanceService = scopedServices
                                        .GetRequiredService <IAttendanceService>();

                    FileServices = scopedServices
                                   .GetRequiredService <IFilesServices>();

                    QueueServices = scopedServices
                                    .GetRequiredService <IQueueServices>();

                    SyncServices = scopedServices
                                   .GetRequiredService <ISyncServices>();
                    Context = scopedServices
                              .GetRequiredService <NetBairesContext>();

                    var logger = scopedServices.GetRequiredService <ILogger <IntegrationTestsBase> >();

                    try
                    {
                        //UtilitiesDb.ReinitializeDbForTests(db);
                    }
                    catch (Exception ex)
                    {
                        logger.LogError(ex, "An error occurred seeding " +
                                        "the database with test messages. Error: {Message}",
                                        ex.Message);
                    }
                });
            }).CreateClient(new WebApplicationFactoryClientOptions
            {
                AllowAutoRedirect = false
            });
        }