public async Task Can_withhold_withdrawal_money() { var player = _playerQueries.GetPlayers().ToList().First(); _paymentTestHelper.MakeDeposit(player.Id, 1000); await _gamesTestHelper.PlaceAndWinBet(1000, 1100, player.Id); var offlineWithdrawalRequest = new OfflineWithdrawRequest { Amount = 1000, NotificationType = NotificationType.None, BankAccountTime = _paymentRepository.PlayerBankAccounts.First().Created.ToString(), BankTime = _paymentRepository.Banks.First().Created.ToString(), PlayerBankAccountId = _paymentRepository .PlayerBankAccounts .Include(x => x.Player) .First(x => x.Player.Id == player.Id) .Id, Remarks = "asd", RequestedBy = _actorInfoProvider.Actor.UserName }; _withdrawalService.Request(offlineWithdrawalRequest); var playerBalance = await _walletQueries.GetPlayerBalance(player.Id); Assert.AreEqual(100, playerBalance.Free); Assert.AreEqual(1000, playerBalance.WithdrawalLock); }
public async Task Wagering_amount_recalculated_sucessfully_while_player_bets() { var player = _playerQueries.GetPlayers().ToList().First(); _paymentTestHelper.MakeDeposit(player.Id, 1000); await _gamesTestHelper.PlaceAndWinBet(100, 100, player.Id); var deposit = _paymentRepository.OfflineDeposits.FirstOrDefault(x => x.PlayerId == player.Id); Assert.NotNull(deposit); Assert.AreEqual(deposit.DepositWagering, 900); }
private async Task DepositBetAndWin(Guid playerId) { _paymentTestHelper.MakeDeposit(playerId, 1000, waitForProcessing: true); Balance.Main = 1000; await _gamesTestHelper.PlaceAndWinBet(1000, 10000, playerId); Balance.Main = 10000; }
public async Task Can_process_win_bet() { // Arrange var betAmount = RandomBetAmount(); // Act await _gamesTestHelper.PlaceAndWinBet(betAmount, betAmount, _player.Id); // Assert Assert.AreEqual(1, _reportRepository.PlayerBetHistoryRecords.Count()); var record = _reportRepository.PlayerBetHistoryRecords.Single(); Assert.AreEqual(betAmount, record.BetAmount); Assert.AreEqual(CurrentBrand.Name, record.Brand); Assert.Less(DateTimeOffset.Now.AddDays(-2), record.DateBet); Assert.AreEqual(_game.Name, record.GameName); Assert.AreEqual(_player.Username, record.LoginName); Assert.AreEqual(_player.IpAddress ?? LocalIPAddress, record.UserIP); Assert.AreEqual(0, record.TotalWinLoss); }
private async Task CreateOWR() { var player = _player; _paymentTestHelper.MakeDeposit(player.Id, 1000); await _gamesTestHelper.PlaceAndWinBet(1000, 10000, player.Id); var offlineWithdrawalRequest = new OfflineWithdrawRequest { Amount = 1, NotificationType = NotificationType.None, BankAccountTime = _paymentRepository.PlayerBankAccounts.First().Created.ToString(), BankTime = _paymentRepository.Banks.First().Created.ToString(), PlayerBankAccountId = _paymentRepository .PlayerBankAccounts .Include(x => x.Player) .First(x => x.Player.Id == player.Id) .Id, Remarks = "asd", RequestedBy = _actorInfoProvider.Actor.UserName }; _withdrawalService.Request(offlineWithdrawalRequest); }
public async Task Can_not_create_ow_with_age_greater_then_setted_up() { var brand = _brandQueries.GetBrands().First(); CreateAvcConfiguration( new AVCConfigurationDTO { Brand = brand.Id, VipLevels = new[] { brand.DefaultVipLevelId.Value }, Currency = brand.DefaultCurrency, HasFraudRiskLevel = false, HasAccountAge = true, AccountAge = 4, AccountAgeOperator = ComparisonEnum.LessOrEqual, Status = AutoVerificationCheckStatus.Active } ); _paymentTestHelper.MakeDeposit(player.Id, 1000); await _gamesTestHelper.PlaceAndWinBet(1000, 10000, player.Id); Balance.Main = 10000; var offlineWithdrawalRequest = new OfflineWithdrawRequest { Amount = 1, NotificationType = NotificationType.None, BankAccountTime = _paymentRepository.PlayerBankAccounts.First().Created.ToString(), BankTime = _paymentRepository.Banks.First().Created.ToString(), PlayerBankAccountId = _paymentRepository .PlayerBankAccounts .Include(x => x.Player) .First(x => x.Player.Id == player.Id) .Id, Remarks = "asd", RequestedBy = _actorInfoProvider.Actor.UserName }; _withdrawalService.Request(offlineWithdrawalRequest); var accountAgeFailed = _fraudRepository.WithdrawalVerificationLogs.Any( o => o.VerificationStep == VerificationStep.AccountAge && !o.IsSuccess); Assert.IsTrue(accountAgeFailed); }
public async Task Can_create_OW_request() { _paymentTestHelper.MakeDeposit(_player.Id, 1000); await _gamesTestHelper.PlaceAndWinBet(1000, 10000, _player.Id); Balance.Main = 10000; var offlineWithdrawalRequest = new OfflineWithdrawRequest { Amount = 1, NotificationType = NotificationType.None, BankAccountTime = _paymentRepository.PlayerBankAccounts.First().Created.ToString(), BankTime = _paymentRepository.Banks.First().Created.ToString(), PlayerBankAccountId = _paymentRepository .PlayerBankAccounts .Include(x => x.Player) .First(x => x.Player.Id == _player.Id) .Id, Remarks = "asd", RequestedBy = _actorInfoProvider.Actor.UserName }; var response = _withdrawalService.Request(offlineWithdrawalRequest); var requests = _paymentRepository.OfflineWithdraws.ToList(); Assert.IsNotEmpty(requests); var withdrawLockBalance = _paymentQueries.GetWithdrawalLockBalance(_player.Id); withdrawLockBalance.Should().Be(1); _paymentTestHelper.AssertBalance(_player.Id , total: 10000, playable: 9999, main: 9999, free: 9999, withdrawalLock: 1); }