public async Task SetUp() { var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json") .Build(); var services = new ServiceCollection(); services.AddTransient <IReflinkHelper, ReflinkHelper>(); services.AddTransient <IUserAccountDataHelper, UserAccountDataHelper>(); services.AddTransient <IMatrixPositionHelper, MatrixPositionHelper>(); services.AddTransient <IUserMultiAccountHelper, UserMultiAccountHelper>(); services.AddTransient <IPaymentHistoryHelper, PaymentHistoryHelper>(); services.AddTransient <IUserAccountDataRepository, UserAccountDataRepository>(); services.AddTransient <IUserMultiAccountRepository, UserMultiAccountRepository>(); services.AddTransient <IMatrixPositionRepository, MatrixPositionRepository>(); services.AddTransient <IPaymentHistoryRepository, PaymentHistoryRepository>(); services.AddTransient <IArticleRepository, ArticleRepository>(); services.AddTransient <ITicketRepository, TicketRepository>(); services.AddTransient <IWithdrawalRepository, WithdrawalRepository>(); services.Configure <JwtSettings>(configuration.GetSection("JwtSettings")); services.AddAutoMapper(); services.AddMediatR(typeof(RegisterNewUserAccountCommand).Assembly); var connectionString = $@"Server=XARDASLORD\SQLEXPRESS;Database=BitClub7_integration_tests_{Guid.NewGuid()};Integrated Security=SSPI"; services.AddDbContext <IBitClub7Context, BitClub7Context>( opts => opts.UseSqlServer(connectionString, b => b.MigrationsAssembly(typeof(IBitClub7Context).Namespace)) ); var serviceProvider = services.AddEntityFrameworkSqlServer() .BuildServiceProvider(); _context = serviceProvider.GetRequiredService <IBitClub7Context>(); _mapper = serviceProvider.GetRequiredService <IMapper>(); _mediator = serviceProvider.GetRequiredService <IMediator>(); _reflinkHelper = serviceProvider.GetRequiredService <IReflinkHelper>(); _userAccountDataHelper = serviceProvider.GetRequiredService <IUserAccountDataHelper>(); _matrixPositionHelper = serviceProvider.GetRequiredService <IMatrixPositionHelper>(); _userMultiAccountHelper = serviceProvider.GetRequiredService <IUserMultiAccountHelper>(); _paymentHistoryHelper = serviceProvider.GetRequiredService <IPaymentHistoryHelper>(); _userAccountDataRepository = serviceProvider.GetRequiredService <IUserAccountDataRepository>(); _userMultiAccountRepository = serviceProvider.GetRequiredService <IUserMultiAccountRepository>(); _matrixPositionRepository = serviceProvider.GetRequiredService <IMatrixPositionRepository>(); _paymentHistoryRepository = serviceProvider.GetRequiredService <IPaymentHistoryRepository>(); _articleRepository = serviceProvider.GetRequiredService <IArticleRepository>(); _ticketRepository = serviceProvider.GetRequiredService <ITicketRepository>(); _withdrawalRepository = serviceProvider.GetRequiredService <IWithdrawalRepository>(); _jwtSettings = serviceProvider.GetRequiredService <IOptions <JwtSettings> >(); _bitBayPayApiSettings = serviceProvider.GetRequiredService <IOptions <BitBayPayApiSettings> >(); _matrixStructureSettings = serviceProvider.GetRequiredService <IOptions <MatrixStructureSettings> >(); _storageSettings = serviceProvider.GetRequiredService <IOptions <StorageSettings> >(); _context.Database.Migrate(); await ClearDatabase(); }
public PaymentStatusChangedEventJob( IPaymentHistoryRepository paymentHistoryRepository, IUserAccountDataRepository userAccountDataRepository, IBackgroundJobClient backgroundJobClient) { _userAccountDataRepository = userAccountDataRepository; _backgroundJobClient = backgroundJobClient; _paymentHistoryRepository = paymentHistoryRepository; }
public GetPaymentHistoriesRequestHandler( IPaymentHistoryRepository paymentHistoryRepository, IUserAccountDataRepository userAccountDataRepository, IMapper mapper) { _paymentHistoryRepository = paymentHistoryRepository; _userAccountDataRepository = userAccountDataRepository; _mapper = mapper; }
public GetUserRequestHandler( IUserAccountDataRepository userAccountDataRepository, IWithdrawalRepository withdrawalRepository, IUserMultiAccountHelper multiAccountHelper, IMapper mapper) { _userAccountDataRepository = userAccountDataRepository; _withdrawalRepository = withdrawalRepository; _multiAccountHelper = multiAccountHelper; _mapper = mapper; }
public UpgradeMatrixCommandHandler( IUserMultiAccountRepository userMultiAccountRepository, IMatrixPositionRepository matrixPositionRepository, IUserAccountDataRepository userAccountDataRepository, IPaymentHistoryHelper paymentHistoryHelper, IMatrixPositionHelper matrixPositionHelper, IBackgroundJobClient backgroundJobClient) { _userMultiAccountRepository = userMultiAccountRepository; _matrixPositionRepository = matrixPositionRepository; _userAccountDataRepository = userAccountDataRepository; _paymentHistoryHelper = paymentHistoryHelper; _matrixPositionHelper = matrixPositionHelper; _backgroundJobClient = backgroundJobClient; }
public CreateMultiAccountCommandHandler( IBitClub7Context context, IUserAccountDataRepository userAccountDataRepository, IUserMultiAccountRepository userMultiAccountRepository, IMatrixPositionRepository matrixPositionRepository, IUserMultiAccountHelper userMultiAccountHelper, IMatrixPositionHelper matrixPositionHelper) { _context = context; _userAccountDataRepository = userAccountDataRepository; _userMultiAccountRepository = userMultiAccountRepository; _matrixPositionRepository = matrixPositionRepository; _userMultiAccountHelper = userMultiAccountHelper; _matrixPositionHelper = matrixPositionHelper; }
public GetUsersRequestHandler(IUserAccountDataRepository userAccountDataRepository, IUserMultiAccountRepository userMultiAccountRepository, IMapper mapper) { _userAccountDataRepository = userAccountDataRepository; _userMultiAccountRepository = userMultiAccountRepository; _mapper = mapper; }
public GetArticlesRequestHandler(IMapper mapper, IArticleRepository articleRepository, IUserAccountDataRepository userAccountDataRepository) { _mapper = mapper; _articleRepository = articleRepository; _userAccountDataRepository = userAccountDataRepository; }
public ChangeAvatarCommandHandler(IUserAccountDataRepository userAccountDataRepository) { _userAccountDataRepository = userAccountDataRepository; }
public PayMembershipsFeeCommandHandler(IBitBayPayFacade bitBayPayFacade, IUserAccountDataRepository userAccountDataRepository, IPaymentHistoryRepository paymentHistoryRepository) { _bitBayPayFacade = bitBayPayFacade; _userAccountDataRepository = userAccountDataRepository; _paymentHistoryRepository = paymentHistoryRepository; }
public LoginCommandHandler(IUserAccountDataRepository userAccountDataRepository, IOptions <JwtSettings> jwtSettings) { _userAccountDataRepository = userAccountDataRepository; _jwtSettings = jwtSettings; }
public CreateArticleCommandHandler(IUserAccountDataRepository userAccountDataRepository, IArticleRepository articleRepository) { _userAccountDataRepository = userAccountDataRepository; _articleRepository = articleRepository; }
public UpdateUserCommandHandler(IUserAccountDataRepository userAccountDataRepository) { _userAccountDataRepository = userAccountDataRepository; }
public UserMultiAccountHelper(IBitClub7Context context, IUserAccountDataRepository userAccountDataRepository) { _context = context; _userAccountDataRepository = userAccountDataRepository; }
public GetMultiAccountsRequestHandler(IMapper mapper, IUserAccountDataRepository userAccountDataRepository) { _mapper = mapper; _userAccountDataRepository = userAccountDataRepository; }