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 UpgradeMatrixWithoutPaymentValidation_TMPCommandHandler( IUserMultiAccountRepository userMultiAccountRepository, IMatrixPositionRepository matrixPositionRepository, IMatrixPositionHelper matrixPositionHelper, IBackgroundJobClient backgroundJobClient) { _userMultiAccountRepository = userMultiAccountRepository; _matrixPositionRepository = matrixPositionRepository; _matrixPositionHelper = matrixPositionHelper; _backgroundJobClient = backgroundJobClient; }
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 GetMatrixRequestHandler(IMatrixPositionRepository matrixPositionRepository, IUserMultiAccountRepository multiAccountRepository, IMapper mapper) { _matrixPositionRepository = matrixPositionRepository; _multiAccountRepository = multiAccountRepository; _mapper = mapper; }
public InitWithdrawalJob(IMatrixPositionRepository matrixPositionRepository, IMatrixPositionHelper matrixPositionHelper, IWithdrawalHelper withdrawalHelper) { _matrixPositionRepository = matrixPositionRepository; _matrixPositionHelper = matrixPositionHelper; _withdrawalHelper = withdrawalHelper; }
public MatrixPositionHasBeenUpgradedJob(IBitClub7Context context, IMatrixPositionRepository matrixPositionRepository) { _context = context; _matrixPositionRepository = matrixPositionRepository; }
public MatrixPositionHelper(IBitClub7Context context, IMatrixPositionRepository matrixPositionRepository, IUserMultiAccountRepository userMultiAccountRepository) { _context = context; _matrixPositionRepository = matrixPositionRepository; _userMultiAccountRepository = userMultiAccountRepository; }
public MatrixPositionHasBeenBoughtEventHandler(IBitClub7Context context, IMatrixPositionRepository matrixPositionRepository) { _context = context; _matrixPositionRepository = matrixPositionRepository; }