public void Can_change_payment_level() { //setup var brand = _brandTestHelper.CreateBrand(); var player = _playerTestHelper.CreatePlayer(); var paymentLevel = _paymentTestHelper.CreatePaymentLevel(brand.Id, player.CurrencyCode); //act _playerCommands.ChangePaymentLevel(new ChangePaymentLevelData { PlayerId = player.Id, PaymentLevelId = paymentLevel.Id, Remarks = "test" }); //assert var playerData = _playerRepository.Players.FirstOrDefault(x => x.Id == player.Id); playerData.PaymentLevelId.Should().Be(paymentLevel.Id); var playerPaymentLevel = _paymentRepository.PlayerPaymentLevels.FirstOrDefault(x => x.PlayerId == player.Id); playerPaymentLevel.PaymentLevel.Id.Should().Be(paymentLevel.Id); var eventRepository = Container.Resolve <IEventRepository>(); eventRepository.Events.Where(x => x.DataType == typeof(PlayerPaymentLevelChanged).Name).Should().NotBeEmpty(); }
public void Can_change_players_payment_level() { //create 2 players for the brand var player1 = _playerTestHelper.CreatePlayer(true, _brand.Id); var player2 = _playerTestHelper.CreatePlayer(true, _brand.Id); //create payment level for a brand var paymentLevelsPage = _dashboardPage.Menu.ClickPaymentLevelsMenuItem(); var newPaymentLevelForm = paymentLevelsPage.OpenNewPaymentLevelForm(); var bankAccount = _paymentTestHelper.CreateBankAccount(_brand.Id, DefaultCurrency); var paymentLevelCode = TestDataGenerator.GetRandomString(); var paymentLevelName = paymentLevelCode + "Name"; var submittedPaymentLevelForm = newPaymentLevelForm.Submit(_brand.Name, paymentLevelCode, paymentLevelName, bankAccount.AccountId, false); submittedPaymentLevelForm.CloseTab("View Payment Level"); //open admin page var paymentLevelSettingsPage = _dashboardPage.Menu.ClickPaymentLevelSettingsMenuItem(); //filte by brand , should list 2 players after filter paymentLevelSettingsPage.FilterGrid(_brand.Name); //select players paymentLevelSettingsPage.SelectPlayer(player1.Username); paymentLevelSettingsPage.SelectPlayer(player2.Username); //click [set Payment Level] button var setPaymentLevelPage = paymentLevelSettingsPage.OpenSetPaymentLevelPage(); //input data and submit setPaymentLevelPage.Submit(paymentLevelName, "change players:" + player1.Username + "," + player2.Username + ", payment level"); //confirmed message Assert.AreEqual("The payment level has been assigned", setPaymentLevelPage.ConfirmationMessage); //check player 1's payment level in player manager var player1PaymentLevel = GetPlayerPaymentLevel(player1.Username); Assert.AreEqual(paymentLevelName, player1PaymentLevel); //check player 2's payment level in player manager var player2PaymentLevel = GetPlayerPaymentLevel(player2.Username); Assert.AreEqual(paymentLevelName, player2PaymentLevel); }
public void Can_unverify_deposit() { // create a player _playerTestHelper = _container.Resolve <PlayerTestHelper>(); _paymentTestHelper = _container.Resolve <PaymentTestHelper>(); var player = _playerTestHelper.CreatePlayer(true, DefaultBrandId); // create and confirm offline deposit var deposit = _paymentTestHelper.CreateOfflineDeposit(player.Id, Amount); _paymentTestHelper.ConfirmOfflineDeposit(deposit); var referenceCode = deposit.TransactionNumber; //var referenceCode = deposit.BankReferenceNumber; // unverify offline deposit _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin(); var playerDepositVerifyPage = _dashboardPage.Menu.ClickPlayerDepositVerifyItem(); playerDepositVerifyPage.FilterGrid(player.Username); playerDepositVerifyPage.SelectConfirmedDeposit(referenceCode); var unverifyForm = playerDepositVerifyPage.OpenUnverifyForm(); unverifyForm.EnterRemarks(" This deposit is unverified."); unverifyForm.Submit(); Assert.AreEqual("Offline deposit request has been unverified successfully", unverifyForm.ConfirmationMessage); Assert.AreEqual(referenceCode, unverifyForm.ReferenceCode); Assert.AreEqual("Unverified", unverifyForm.Status); }
public override void BeforeEach() { base.BeforeEach(); _driver.Logout(); _playerTestHelper = _container.Resolve <PlayerTestHelper>(); _paymentTestHelper = _container.Resolve <PaymentTestHelper>(); _player = _playerTestHelper.CreatePlayer(); _playerBankAccount = _paymentTestHelper.CreatePlayerBankAccount(_player.Id, _player.BrandId); _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin(); _playerBankAccountVerifyPage = _dashboardPage.Menu.ClickPlayerBankAccountVerifyMenuItem(); }
public async Task Can_generate_player_auth_token() { var player = PlayerTestHelper.CreatePlayer(); WaitForPlayerRegistered(player.Id); var token = await _brandOperations.GetPlayerAuthTokenAsync(player.Id, TestDataGenerator.GetRandomIpAddress(), PlatformType.Mobile); Assert.IsNotNullOrEmpty(token); }
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 Core.Messaging.Data.Player SetUpPlayerMessageTest(MessageDeliveryMethod messageDeliveryMethod, bool enableAccountAlert = true) { var player = _playerTestHelper.CreatePlayer(); var messagingPlayer = MessagingRepository.Players.Single(x => x.Id == player.Id); if (messageDeliveryMethod == MessageDeliveryMethod.Email) { _emailNotificationWorker.Start(); messagingPlayer.AccountAlertEmail = enableAccountAlert; } else { _smsNotificationWorker.Start(); messagingPlayer.AccountAlertSms = enableAccountAlert; } return(messagingPlayer); }
public void Can_assign_VIP_level_to_player_with_permission() { var defaultLicenseeId = _brandTestHelper.GetDefaultLicensee(); var brand = _brandTestHelper.CreateBrand(defaultLicenseeId, isActive: true); _driver.Navigate().Refresh(); _dashboardPage.BrandFilter.SelectAll(); // create a user with permissions to view and assign VIP level for a player var permissions = new[] { _securityTestHelper.GetPermission(Permissions.View, Modules.PlayerManager), _securityTestHelper.GetPermission(Permissions.Update, Modules.PlayerManager), _securityTestHelper.GetPermission(Permissions.AssignVipLevel, Modules.PlayerManager) }; var role = _securityTestHelper.CreateRole(new[] { _defaultLicensee.Id }, permissions); Thread.Sleep(5000); //wait for new Role event proceeds. WaitHelper.WaitUntil(() => _securityTestHelper.IsRoleExistInDb(role.Id)); const string password = "******"; var user = _securityTestHelper.CreateAdmin(_defaultLicensee.Id, new[] { brand }, password: password, roleId: role.Id); // create a player var player = _playerTestHelper.CreatePlayer(isActive: true, brandId: brand.Id); //create a VIP Level var vipLevel = _brandTestHelper.CreateVipLevel(brand.Id, isDefault: false); // login as the user and assign VIP level to the player _dashboardPage = _driver.LoginToAdminWebsiteAs(user.Username, password); _dashboardPage.BrandFilter.SelectAll(); var playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem(); var playerInfo = playerManagerPage.OpenPlayerInfoPage(player.Username); playerInfo.OpenAccountInformationSection(); var changeVipLevelDialog = playerInfo.OpenChangeVipLevelDialog(); changeVipLevelDialog.Submit(vipLevel.Name); Assert.AreEqual(vipLevel.Name, playerInfo.VipLevel); }
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(); _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); }
public async Task Can_get_lobby_data() { var brandId = new Guid("00000000-0000-0000-0000-000000000138"); var brand = _gameRepository.Brands.Include(x => x.BrandLobbies).Single(x => x.Id == brandId); var lobbyId = brand.BrandLobbies.First().LobbyId; var player = PlayerTestHelper.CreatePlayer(true, brand.Id); var playerId = player.Id; WaitForPlayerRegistered(playerId); var data = await _productOperations.GetProductsForPlayerAsync( lobbyId, playerId, "http://example.org/", TestDataGenerator.GetRandomIpAddress(), string.Empty); Assert.AreEqual(playerId, data.player.id); Assert.AreEqual(lobbyId, data.products.lobbyid); Assert.AreNotEqual(0, data.products.groups.Count()); //Assert.AreNotEqual(0, data.products.providers.Count()); }