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 void Wagering_amount_setted_sucessfully() { var player = _playerQueries.GetPlayers().ToList().First(); _paymentTestHelper.MakeDeposit(player.Id, 1000); var deposit = _paymentRepository.OfflineDeposits.FirstOrDefault(x => x.PlayerId == player.Id); Assert.NotNull(deposit); Assert.AreEqual(deposit.DepositWagering, 1000); }
public async Task Can_get_player_balance() { var amount = TestDataGenerator.GetRandomDepositAmount(); var player = PlayerTestHelper.CreatePlayer(); WaitForPlayerRegistered(player.Id); var balanceOfNew = await _brandOperations.GetPlayerBalanceAsync(player.Id, player.CurrencyCode); PaymentTestHelper.MakeDeposit(player.Id, amount, waitForProcessing: true); var balanceDeposited = await _brandOperations.GetPlayerBalanceAsync(player.Id, player.CurrencyCode); Assert.AreEqual(0, balanceOfNew); Assert.AreEqual(amount, balanceDeposited); }
public override void BeforeAll() { base.BeforeAll(); _paymentTestHelper = _container.Resolve <PaymentTestHelper>(); _playerCommands = _container.Resolve <PlayerCommands>(); _brandTestHelper = _container.Resolve <BrandTestHelper>(); _playerTestHelper = _container.Resolve <PlayerTestHelper>(); _autoVerificationConfigurationTestHelper = _container.Resolve <AutoVerificationConfigurationTestHelper>(); _riskProfileCheckTestHelper = _container.Resolve <RiskProfileCheckTestHelper>(); //create a not default VIP Level for Brand _vipLevel = _brandTestHelper.CreateNotDefaultVipLevel(DefaultBrandId); //create a player for the DefaultBrandId var player = _playerTestHelper.CreatePlayer(isActive: true, brandId: DefaultBrandId); var playerId = player.Id; _player = _container.Resolve <PlayerQueries>().GetPlayer(playerId); _playerUsername = _player.Username; _paymentTestHelper.CreatePlayerBankAccount(playerId, DefaultBrandId, true); //change the VIP Level for Player _playerCommands.ChangeVipLevel(playerId, _vipLevel.Id, "changed vip level"); //deposit _paymentTestHelper.MakeDeposit(_playerUsername, 100); _paymentTestHelper.MakeDeposit(_playerUsername, 200); _paymentTestHelper.MakeDeposit(_playerUsername, 300); //create Auto Verification configuration which expected to be failed _avcConfigurationBuilder = new AvcConfigurationBuilder(DefaultBrandId, new [] { _vipLevel.Id }, "CAD"); _avcConfigurationBuilder.SetupTotalDepositAmount(1500, ComparisonEnum.GreaterOrEqual); _avcDTO = _avcConfigurationBuilder.Configuration; _avc = _autoVerificationConfigurationTestHelper.CreateConfiguration(_avcDTO); _autoVerificationConfigurationTestHelper.Activate(_avc.Id); //create Risk Profile Check configuration _riskProfileCheckConfigurationBuilder = new RiskProfileCheckConfigurationBuilder(DefaultBrandId, _avcDTO.Licensee, "CAD", new List <Guid> { _vipLevel.Id }); _rpcDTO = _riskProfileCheckConfigurationBuilder.Configuration; var createdConfigurationEntity = _riskProfileCheckTestHelper.CreateConfiguration(_rpcDTO); _rpcDTO.Id = createdConfigurationEntity.Id; }
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 void Validate_if_Amount_less_or_equal_than_MainBalance() { // Arrange _paymentTestHelper.MakeDeposit(_playerId, 1); BonusBalance.Main = 1; var transferFundRequest = new TransferFundRequest { Amount = 1, PlayerId = _playerId, TransferType = TransferFundType.FundIn, WalletId = _walletTemplateId.ToString() }; //Act (await _validationService.Validate(transferFundRequest)).IsValid .Should().BeTrue(); }
public override void BeforeAll() { base.BeforeAll(); _paymentTestHelper = _container.Resolve <PaymentTestHelper>(); _playerCommands = _container.Resolve <PlayerCommands>(); _brandTestHelper = _container.Resolve <BrandTestHelper>(); _playerTestHelper = _container.Resolve <PlayerTestHelper>(); _autoVerificationConfigurationTestHelper = _container.Resolve <AutoVerificationConfigurationTestHelper>(); //create a not default VIP Level for Brand _vipLevel = _brandTestHelper.CreateNotDefaultVipLevel(DefaultBrandId); //create a player for the DefaultBrandId var player = _playerTestHelper.CreatePlayer(isActive: true, brandId: DefaultBrandId); var playerId = player.Id; _player = _container.Resolve <PlayerQueries>().GetPlayer(playerId); _playerUsername = _player.Username; _paymentTestHelper.CreatePlayerBankAccount(playerId, DefaultBrandId, true); //change the VIP Level for Player _playerCommands.ChangeVipLevel(playerId, _vipLevel.Id, "changed vip level"); //deposit _paymentTestHelper.MakeDeposit(_playerUsername, 100); _paymentTestHelper.MakeDeposit(_playerUsername, 200); _paymentTestHelper.MakeDeposit(_playerUsername, 300); _avcConfigurationBuilder = new AvcConfigurationBuilder(DefaultBrandId, new[] { _vipLevel.Id }, "CAD"); _avcDTO = _avcConfigurationBuilder.Configuration; _avc = _autoVerificationConfigurationTestHelper.CreateConfiguration(_avcDTO); _autoVerificationConfigurationTestHelper.Activate(_avc.Id); }
public override void BeforeAll() { base.BeforeAll(); //create a player _playerTestHelper = _container.Resolve<PlayerTestHelper>(); _paymentTestHelper = _container.Resolve<PaymentTestHelper>(); _player = _playerTestHelper.CreatePlayerForMemberWebsite(currencyCode: "CAD"); //deposit money to the player's main balance _paymentTestHelper.MakeDeposit(_player.Username, DepositAmount); //navigate to brand website _brandWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); _brandWebsiteLoginPage.NavigateToMemberWebsite(); }
public override void BeforeEach() { base.BeforeEach(); Container.Resolve <PaymentWorker>().Start(); _reportRepository = Container.Resolve <IReportRepository>(); _gamesTestHelper = Container.Resolve <GamesTestHelper>(); _reportQueries = Container.Resolve <ReportQueries>(); _random = new Random(); _player = Container.Resolve <PlayerTestHelper>().CreatePlayer(); PaymentTestHelper.MakeDeposit(_player.Id, 1000000); _game = _gamesTestHelper.GetMainWalletGame(_player.Id); }
private void CancelOfflineWithdrawalRequest(WithdrawalStatus stateToGetInto) { _paymentTestHelper.MakeDeposit(_player.Id, 2000); Balance.Main = 2000; var response = _paymentTestHelper.MakeWithdraw(_player.Id, amount: 100); _withdrawalService.Revert(response.Id, "Revert to Verification Queue"); /* */ //Cancel withdrawal request if (stateToGetInto == WithdrawalStatus.Canceled) { _withdrawalService.Cancel(response.Id, "Cancel Withdrawal Request"); } else if (stateToGetInto == WithdrawalStatus.Unverified) { _withdrawalService.Unverify(response.Id, "Unverify Withdrawal Request"); } //Assert there's nothing in the "On Hold Queue" var withdrawalsInTheOnHoldQueue = _withdrawalService.GetWithdrawalsOnHold(); Assert.IsEmpty(withdrawalsInTheOnHoldQueue); //Assert there's nothing in the "Release Queue" var withdrawalsInTheReleaseQueue = _withdrawalService.GetWithdrawalsForApproval(); Assert.IsEmpty(withdrawalsInTheReleaseQueue); //Assert there's nothing in the "Acceptance Queue" var withdrawalsInTheAccQueue = _withdrawalService.GetWithdrawalsForAcceptance(); Assert.IsEmpty(withdrawalsInTheAccQueue); //Assert there's nothing in the "Verification Queue" var withdrawalsInTheVerificationQueue = _withdrawalService.GetWithdrawalsForVerificationQueue(); Assert.IsEmpty(withdrawalsInTheVerificationQueue); }
public override void BeforeAll() { base.BeforeAll(); _paymentTestHelper = _container.Resolve <PaymentTestHelper>(); _playerCommands = _container.Resolve <PlayerCommands>(); _playerTestHelper = _container.Resolve <PlayerTestHelper>(); _autoVerificationConfigurationTestHelper = _container.Resolve <AutoVerificationConfigurationTestHelper>(); var brand = _container.Resolve <BrandQueries>().GetBrand(DefaultBrandId); _vipLevel = brand.DefaultVipLevel; //create a not default VIP Level for Brand //create a player for the DefaultBrandId _player = _playerTestHelper.CreatePlayer(isActive: true, brandId: DefaultBrandId); var playerId = _player.Id; _playerUsername = _player.Username; _paymentTestHelper.CreatePlayerBankAccount(playerId, DefaultBrandId, true); //change the VIP Level for Player _playerCommands.ChangeVipLevel(playerId, _vipLevel.Id, "changed vip level"); //deposit _paymentTestHelper.MakeDeposit(_playerUsername, 200); //create Auto Verification configuration which expected to be failed _avcConfigurationBuilder = new AvcConfigurationBuilder(DefaultBrandId, new[] { _vipLevel.Id }, "CAD"); _avcConfigurationBuilder.SetupTotalDepositAmount(1500, ComparisonEnum.GreaterOrEqual); _avcDTO = _avcConfigurationBuilder.Configuration; _avc = _autoVerificationConfigurationTestHelper.CreateConfiguration(_avcDTO); _autoVerificationConfigurationTestHelper.Activate(_avc.Id); }
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_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); }
public override void BeforeEach() { base.BeforeEach(); _driver.Logout(); _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin(); _dashboardPage.BrandFilter.SelectAll(); _playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem(); _brandTestHelper = _container.Resolve <BrandTestHelper>(); _paymentTestHelper = _container.Resolve <PaymentTestHelper>(); _playerQueries = _container.Resolve <PlayerQueries>(); _gamesTestHelper = _container.Resolve <GamesTestHelper>(); var avcTestHelper = _container.Resolve <AutoVerificationConfigurationTestHelper>(); var playerTestHelper = _container.Resolve <PlayerTestHelper>(); var brandQueries = _container.Resolve <BrandQueries>(); var playerCommands = _container.Resolve <PlayerCommands>(); //create a brand for a default licensee _brand = brandQueries.GetBrand(DefaultBrandId); //create a not default VIP Level for Brand var vipLevel = _brandTestHelper.CreateNotDefaultVipLevel(DefaultBrandId); //create Auto Verification Configuration for custom Brand var gameRepository = _container.Resolve <IGameRepository>(); var avcConfigurationBuilder = new AvcConfigurationBuilder(_brand.Id, new[] { vipLevel.Id }, "CAD"); avcConfigurationBuilder .SetupWinnings(new List <WinningRuleDTO> { new WinningRuleDTO { Id = Guid.NewGuid(), ProductId = gameRepository.GameProviders.Single(g => g.Name == "Mock Sport Bets").Id, Comparison = ComparisonEnum.Greater, Amount = 200, Period = PeriodEnum.FromSignUp } }); var configuration = avcConfigurationBuilder.Configuration; var createdConfiguration = avcTestHelper.CreateConfiguration(configuration); avcTestHelper.Activate(createdConfiguration.Id); // create a player with a bound bank account for a brand var player = playerTestHelper.CreatePlayer(true, _brand.Id); _playerUsername = player.Username; _playerFirstname = player.FirstName; _playerLastname = player.LastName; _playerFullname = _playerFirstname + " " + _playerLastname; _paymentTestHelper.CreatePlayerBankAccount(player.Id, DefaultBrandId, true); //change the VIP Level for Player playerCommands.ChangeVipLevel(player.Id, vipLevel.Id, "changed vip level"); //deposit some money _paymentTestHelper.MakeDeposit(_playerUsername, 400); Thread.Sleep(5000); //wait for Deposit created event processing }
public void Withdrawal_goes_directly_to_acceptance_queue_after_exemption_applied() { var brandId = _brandQueries.GetBrands().First().Id; var licenseeId = _brandQueries.GetBrands().First().Licensee.Id; var currency = _brandQueries.GetBrands().First().DefaultCurrency; var vipLevelId = (Guid)_brandQueries.GetBrands().First().DefaultVipLevelId; var playerId = new Guid(); var playersAffectedByAvc = _playerQueries.GetPlayers() .Where(player => player.BrandId == brandId && player.Brand.LicenseeId == licenseeId && player.CurrencyCode == currency && player.VipLevelId == vipLevelId); if (playersAffectedByAvc.Any()) { playerId = playersAffectedByAvc.FirstOrDefault().Id; } //Create a new avc that has a withdrawal exemption CreateAvcConfiguration(new AVCConfigurationDTO { Licensee = licenseeId, Brand = brandId, Currency = currency, VipLevels = new[] { vipLevelId }, HasWithdrawalExemption = true, HasWithdrawalCount = true, TotalWithdrawalCountAmount = 85, TotalWithdrawalCountOperator = ComparisonEnum.Greater, Status = AutoVerificationCheckStatus.Active }); _paymentTestHelper.MakeDeposit(playerId, 1000); Balance.Main = 1000; //Setup an exemption for a particular player that will make a withdrawal request later in the test case. var playerExemption = new Exemption { Exempt = true, ExemptFrom = DateTime.UtcNow.AddDays(-2).ToString(CultureInfo.InvariantCulture), ExemptTo = DateTime.UtcNow.AddDays(2).ToString(CultureInfo.InvariantCulture), ExemptLimit = 1, PlayerId = playerId }; _withdrawalService.SaveExemption(playerExemption); //Create the offline withdrawal request MakeWithdrawalRequest(playerId, playersAffectedByAvc); var numberOfVerifiedWithdrawals = _withdrawalService .GetWithdrawalsVerified().Count(wd => wd.PlayerBankAccount.Player.Id == playerId); Assert.AreEqual(1, numberOfVerifiedWithdrawals); //Since we are allowed to only one exemption, this means that on the next withdrawal //we must have our withdrawal request in the verification queue but not in the acceptance queue MakeWithdrawalRequest(playerId, playersAffectedByAvc); Assert.AreEqual(1, numberOfVerifiedWithdrawals); }
//[Test, Ignore("Configuration of bonus is not available for R1")] public void Can_redeem_refer_friends_bonus() { const decimal bonusAmount = 150; const decimal wageringCondition = 2; const decimal minDepositAmount = 200; const decimal actualDepositAmount = 250; const decimal requiredWagering = actualDepositAmount * wageringCondition; //create a bonus template var bonusTemplateManagerPage = _dashboardPage.Menu.ClickBonusTemplateMenuItem(); var submittedBonusTemplateForm = bonusTemplateManagerPage.OpenNewBonusTemplateForm() .SelectLicenseeAndBrand(LicenseeName, BrandName) .SetTemplateName(_bonusTemplateName) .SelectBonusType(BonusType.ReferFriend) .SelectIssuanceMode(IssuanceMode.ManualByPlayer) .NavigateToRules() .SelectCurrency("CAD") .EnterReferFriendsConfiguration(minDepositAmount, wageringCondition) .EnterBonusTier(bonusAmount, 1, 1) .NavigateToSummary(); var bonusManagerPage = submittedBonusTemplateForm.Menu.ClickBonusMenuItem(); var newBonusForm = bonusManagerPage.OpenNewBonusForm(); //create a bonus var submittedBonusForm = newBonusForm.Submit(_bonusName, TestDataGenerator.GetRandomString(6), _bonusTemplateName, 0); submittedBonusForm.SwitchToBonusList(); ActivateBonus(_bonusName); //create a referrer var referrerData = _driver.LoginAsSuperAdminAndCreatePlayer(LicenseeName, BrandName, "CAD"); //refer a friend _driver.Manage().Cookies.DeleteAllCookies(); var memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); memberWebsiteLoginPage.NavigateToMemberWebsite(); var playerProfilePage = memberWebsiteLoginPage.Login(referrerData.LoginName, referrerData.Password); var referFriendPage = playerProfilePage.Menu.ClickReferFriendsMenu(); referFriendPage.ReferFriend(); Assert.AreEqual("Phone numbers successfully submitted.", referFriendPage.Message); _driver.Manage().Cookies.DeleteAllCookies(); //register referred var referralId = new PlayerRepository().Players.Single(a => a.Username == referrerData.LoginName).ReferralId; var referredRegistrationData = TestDataGenerator.CreateValidPlayerDataForMemberWebsite("CAD"); var registerPage = new RegisterPage(_driver); registerPage.NavigateToMemberWebsite(referralId.ToString()); registerPage.Register(referredRegistrationData); //depositing missing funds in order to complete wagering _paymentTestHelper.MakeDeposit(referredRegistrationData.Username, requiredWagering - actualDepositAmount); //make deposit for referred _driver.MakeOfflineDeposit(referredRegistrationData.Username, actualDepositAmount, referredRegistrationData.FullName); _driver.Manage().Cookies.DeleteAllCookies(); //complete wagering requirements for referred memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); memberWebsiteLoginPage.NavigateToMemberWebsite(); _driver.Manage().Cookies.DeleteAllCookies(); _driver.Navigate().Refresh(); playerProfilePage = memberWebsiteLoginPage.Login(referredRegistrationData.Username, referredRegistrationData.Password); var gameListPage = playerProfilePage.Menu.ClickPlayGamesMenu(); var gamePage = gameListPage.StartGame("Poker"); gamePage.PlaceInitialBet(requiredWagering, ""); gamePage.WinBet(requiredWagering); _driver.Manage().Cookies.DeleteAllCookies(); //claim refer a friend bonus reward memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); memberWebsiteLoginPage.NavigateToMemberWebsite(); playerProfilePage = memberWebsiteLoginPage.Login(referrerData.LoginName, referrerData.Password); var claimBonusPage = playerProfilePage.Menu.ClickClaimBonusSubMenu(); claimBonusPage.ClaimBonus(); Assert.AreEqual("Redemption claimed successfully.", claimBonusPage.MessageValue); //login to admin site _driver.Logout(); _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin(); var playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem(); //check the bonus playerManagerPage.SelectPlayer(referrerData.LoginName); var playerInfoPage = playerManagerPage.OpenPlayerInfoPage(); playerInfoPage.OpenTransactionsSection(); var playersBonusAmount = playerInfoPage.GetTransactionBonusAmount("Bonus"); Assert.AreEqual(bonusAmount, playersBonusAmount); //deactivate bonus DeactivateBonus(); }
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); }