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 RegisterNewUserAccountCommandHandler( IBitClub7Context context, IUserMultiAccountHelper userMultiAccountHelper, IUserMultiAccountRepository userMultiAccountRepository) { _context = context; _userMultiAccountHelper = userMultiAccountHelper; _userMultiAccountRepository = userMultiAccountRepository; }
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 UserMultiAccountRepository(IBitClub7Context context) { _context = context; }
public UserAccountDataRepository(IBitClub7Context context) { _context = context; }
public PaymentHistoryRepository(IBitClub7Context context) { _context = context; }
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 TicketRepository(IBitClub7Context context) { _context = context; }
public ArticleRepository(IBitClub7Context context) { _context = context; }
public WithdrawalRepository(IBitClub7Context context) { _context = context; }
public MatrixPositionRepository(IBitClub7Context context) { _context = context; }
public MatrixPositionHasBeenBoughtEventHandler(IBitClub7Context context, IMatrixPositionRepository matrixPositionRepository) { _context = context; _matrixPositionRepository = matrixPositionRepository; }
public UserMultiAccountHelper(IBitClub7Context context, IUserAccountDataRepository userAccountDataRepository) { _context = context; _userAccountDataRepository = userAccountDataRepository; }