Ejemplo n.º 1
0
        public override void BeforeEach()
        {
            base.BeforeEach();

            Balance = new BonusBalance();
            var bonusApiMock = new Mock <IBonusApiProxy>();

            bonusApiMock.Setup(proxy => proxy.GetPlayerBalanceAsync(It.IsAny <Guid>(), It.IsAny <Guid?>())).ReturnsAsync(Balance);
            bonusApiMock.Setup(proxy => proxy.GetWageringBalancesAsync(It.IsAny <Guid>(), It.IsAny <Guid?>())).ReturnsAsync(new PlayerWagering());
            Container.RegisterInstance(bonusApiMock.Object);

            _withdrawalService = Container.Resolve <IWithdrawalService>();
            _playerQueries     = Container.Resolve <PlayerQueries>();
            _paymentRepository = Container.Resolve <FakePaymentRepository>();
            _paymentTestHelper = Container.Resolve <PaymentTestHelper>();
            Container.Resolve <PaymentWorker>().Start();
            var securityTestHelper = Container.Resolve <SecurityTestHelper>();

            securityTestHelper.PopulatePermissions();
            securityTestHelper.CreateAndSignInSuperAdmin();

            var brandHelper = Container.Resolve <BrandTestHelper>();
            var brand       = brandHelper.CreateActiveBrandWithProducts();

            var player = Container.Resolve <PlayerTestHelper>().CreatePlayer();

            _paymentTestHelper.CreatePlayerBankAccount(player.Id, brand.Id, true);

            _player = _playerQueries.GetPlayers().ToList().First();

            _observedWithdrawalId = Guid.NewGuid();
        }
Ejemplo n.º 2
0
        public override void BeforeEach()
        {
            base.BeforeEach();

            Balance = new BonusBalance();
            var bonusApiMock = new Mock <IBonusApiProxy>();

            bonusApiMock.Setup(proxy => proxy.GetPlayerBalanceAsync(It.IsAny <Guid>(), It.IsAny <Guid?>())).ReturnsAsync(Balance);
            Container.RegisterInstance(bonusApiMock.Object);

            Container.Resolve <PaymentWorker>().Start();
            _withdrawalService = Container.Resolve <IWithdrawalService>();
            _paymentRepository = Container.Resolve <FakePaymentRepository>();
            _actorInfoProvider = Container.Resolve <IActorInfoProvider>();

            _paymentRepository.Brands.Add(new Core.Payment.Data.Brand
            {
                Id         = DefaultBrandId,
                Name       = DefaultBrandId.ToString(),
                Code       = "138",
                TimezoneId = "Pacific Standard Time"
            });

            _paymentRepository.Banks.Add(new Bank
            {
                Id       = Guid.NewGuid(),
                BrandId  = DefaultBrandId,
                BankName = "138Bank"
            });
        }
        public override void BeforeEach()
        {
            base.BeforeEach();

            BonusBalance = new BonusBalance {
                Main = 10
            };
            var bonusApiMock = new Mock <IBonusApiProxy>();

            bonusApiMock.Setup(proxy => proxy.GetPlayerBalanceAsync(It.IsAny <Guid>(), It.IsAny <Guid?>())).ReturnsAsync(BonusBalance);
            Container.RegisterInstance(bonusApiMock.Object);

            Container.Resolve <PaymentWorker>().Start();
            var brandTestHelper    = Container.Resolve <BrandTestHelper>();
            var securityTestHelper = Container.Resolve <SecurityTestHelper>();

            securityTestHelper.PopulatePermissions();
            securityTestHelper.CreateAndSignInSuperAdmin();
            _brand = brandTestHelper.CreateBrand(isActive: true);

            var player = Container.Resolve <PlayerTestHelper>().CreatePlayer(true, _brand.Id);

            _playerId          = player.Id;
            _walletTemplateId  = _brand.WalletTemplates.Single(x => x.IsMain).Id;
            _validationService = Container.Resolve <ITransferFundValidationService>();
            _repository        = Container.Resolve <FakePaymentRepository>();

            _transferFundTestHelper = Container.Resolve <TransferFundTestHelper>();
            _paymentTestHelper      = Container.Resolve <PaymentTestHelper>();
        }
Ejemplo n.º 4
0
        public override void BeforeEach()
        {
            base.BeforeEach();
            _withdrawalService = Container.Resolve <IWithdrawalService>();
            Balance            = new BonusBalance();
            var bonusApiMock = new Mock <IBonusApiProxy>();

            bonusApiMock.Setup(proxy => proxy.GetPlayerBalanceAsync(It.IsAny <Guid>(), It.IsAny <Guid?>())).ReturnsAsync(Balance);
            Container.RegisterInstance(bonusApiMock.Object);
            _playerQueries     = Container.Resolve <PlayerQueries>();
            _paymentRepository = Container.Resolve <FakePaymentRepository>();
            Container.Resolve <PaymentWorker>().Start();

            _paymentTestHelper        = Container.Resolve <PaymentTestHelper>();
            _avcConfigurationCommands = Container.Resolve <IAVCConfigurationCommands>();
            _brandQueries             = Container.Resolve <BrandQueries>();

            var securityTestHelper = Container.Resolve <SecurityTestHelper>();

            securityTestHelper.PopulatePermissions();
            securityTestHelper.CreateAndSignInSuperAdmin();

            var brandHelper = Container.Resolve <BrandTestHelper>();
            var brand       = brandHelper.CreateActiveBrandWithProducts();

            var player = Container.Resolve <PlayerTestHelper>().CreatePlayer();

            player.DateRegistered = DateTimeOffset.Now.AddMonths(-1);
            _paymentTestHelper.CreatePlayerBankAccount(player.Id, brand.Id, true);
        }
        public override void BeforeEach()
        {
            base.BeforeEach();

            Balance = new BonusBalance();
            var bonusApiMock = new Mock <IBonusApiProxy>();

            bonusApiMock.Setup(proxy => proxy.GetPlayerBalanceAsync(It.IsAny <Guid>(), It.IsAny <Guid?>())).ReturnsAsync(Balance);
            Container.RegisterInstance(bonusApiMock.Object);

            _withdrawalService = Container.Resolve <IWithdrawalService>();
            _paymentRepository = Container.Resolve <FakePaymentRepository>();

            _gameRepository = Container.Resolve <FakeGameRepository>();
            _gameRepository.SavedChanges += (s, e) =>
            {
                var allGameActions = _gameRepository.Rounds
                                     .SelectMany(o => o.GameActions);

                foreach (var gameAction in allGameActions)
                {
                    if (Enumerable.Any(_gameRepository.GameActions, o => o.Id == gameAction.Id))
                    {
                        continue;
                    }

                    gameAction.Round.Game = _gameRepository.Games
                                            .Single(o => o.Id == gameAction.Round.GameId);

                    _gameRepository.GameActions.Add(gameAction);
                }
            };

            _actorInfoProvider        = Container.Resolve <IActorInfoProvider>();
            _paymentTestHelper        = Container.Resolve <PaymentTestHelper>();
            _gamesTestHelper          = Container.Resolve <GamesTestHelper>();
            _avcConfigurationCommands = Container.Resolve <IAVCConfigurationCommands>();
            _brandQueries             = Container.Resolve <BrandQueries>();
            _fraudRepository          = Container.Resolve <IFraudRepository>();

            var securityTestHelper = Container.Resolve <SecurityTestHelper>();

            securityTestHelper.PopulatePermissions();
            securityTestHelper.CreateAndSignInSuperAdmin();
            Container.Resolve <RiskLevelWorker>().Start();
            Container.Resolve <PaymentWorker>().Start();
            var brandHelper = Container.Resolve <BrandTestHelper>();
            var brand       = brandHelper.CreateActiveBrandWithProducts();

            player = Container.Resolve <PlayerTestHelper>().CreatePlayer();
            var bankAccount = _paymentTestHelper.CreatePlayerBankAccount(player.Id, brand.Id, true);

            bankAccount.Player.DateRegistered = DateTimeOffset.Now.AddMonths(-1);
        }
        public override void BeforeEach()
        {
            base.BeforeEach();

            Balance = new BonusBalance();
            var bonusApiMock = new Mock <IBonusApiProxy>();

            bonusApiMock.Setup(proxy => proxy.GetPlayerBalanceAsync(It.IsAny <Guid>(), It.IsAny <Guid?>())).ReturnsAsync(Balance);
            Container.RegisterInstance(bonusApiMock.Object);

            Container.Resolve <PaymentWorker>().Start();

            _withdrawalService = Container.Resolve <IWithdrawalService>();
            _playerQueries     = Container.Resolve <PlayerQueries>();
            _paymentRepository = Container.Resolve <FakePaymentRepository>();
            _paymentTestHelper = Container.Resolve <PaymentTestHelper>();
            _withdrawalVerificationLogsQueues = Container.Resolve <IWithdrawalVerificationLogsQueues>();
            _riskLevelQueries = Container.Resolve <IRiskLevelQueries>();

            var securityTestHelper = Container.Resolve <SecurityTestHelper>();

            securityTestHelper.PopulatePermissions();
            securityTestHelper.CreateAndSignInSuperAdmin();
            _gamesTestHelper = Container.Resolve <GamesTestHelper>();

            var brandHelper = Container.Resolve <BrandTestHelper>();
            var brand       = brandHelper.CreateActiveBrandWithProducts();

            _brandQueries = Container.Resolve <BrandQueries>();

            _actorInfoProvider = Container.Resolve <IActorInfoProvider>();

            _avcConfigurationCommands = Container.Resolve <IAVCConfigurationCommands>();
            _riskProfileCheckCommands = Container.Resolve <IRiskProfileCheckCommands>();

            var player = Container.Resolve <PlayerTestHelper>().CreatePlayer();

            _paymentTestHelper.CreatePlayerBankAccount(player.Id, brand.Id, true);
            _observedBrand = _brandQueries.GetBrands().First();

            brandHelper.CreateRiskLevel(_observedBrand.Id);

            //Replace with risk levels from fraud repository
            var availableRiskLevels = _riskLevelQueries.GetByBrand(_observedBrand.Id);

            _observedRiskLevel = availableRiskLevels.FirstOrDefault().Id;

            _riskLevelDifferentThanObserved = availableRiskLevels.First(rl => rl.Id != _observedRiskLevel).Id;
        }