Example #1
0
        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);
        }
Example #2
0
        public void MyTest()
        {
            var offlineDeposit = _paymentTestHelper.CreateOfflineDeposit(_player.Id, 10000M);

            _paymentTestHelper.ConfirmOfflineDeposit(offlineDeposit);
            _paymentTestHelper.VerifyOfflineDeposit(offlineDeposit, true);

            var offlineDepositApprove = new OfflineDepositApprove
            {
                Id           = offlineDeposit.Id,
                ActualAmount = 9988.77M,
                Fee          = 10.50M,
                PlayerRemark = "Player remark",
                Remark       = "Approve remark"
            };

            // Act
            _commandsHandler.Approve(offlineDepositApprove);

            var gameRepository = Container.Resolve <IGameRepository>();

            Assert.AreEqual(gameRepository.Wallets.Single().Balance, 9999.27M);
        }
        public void Can_process_confirm_deposit()
        {
            // Arrange
            var depositAmount = TestDataGenerator.GetRandomDepositAmount();
            var deposit       = PaymentTestHelper.CreateOfflineDeposit(_player.Id, depositAmount);

            // Act
            PaymentTestHelper.ConfirmOfflineDeposit(deposit);

            // Assert
            Assert.AreEqual(1, _reportRepository.DepositRecords.Count());
            var record = _reportRepository.DepositRecords.Single();

            Assert.AreEqual(deposit.Id, record.DepositId);
            Assert.AreEqual(depositAmount, record.Amount);
            Assert.AreEqual(OfflineDepositStatus.Processing.ToString(), record.Status);
        }
        public void Can_process_verify_deposit()
        {
            // Arrange
            var depositAmount = TestDataGenerator.GetRandomDepositAmount();
            var deposit       = PaymentTestHelper.CreateOfflineDeposit(_player.Id, depositAmount);

            PaymentTestHelper.ConfirmOfflineDeposit(deposit);

            // Act
            PaymentTestHelper.VerifyOfflineDeposit(deposit, true);

            // Assert
            Assert.AreEqual(1, _reportRepository.DepositRecords.Count());
            var record = _reportRepository.DepositRecords.Single();

            Assert.AreEqual(deposit.Id, record.DepositId);
            Assert.Less(DateTimeOffset.Now.AddDays(-2), record.Verified);
            Assert.AreEqual(_actorInfoProvider.Actor.UserName, record.VerifiedBy);
            Assert.AreEqual(OfflineDepositStatus.Verified.ToString(), record.Status);
        }
Example #5
0
        public async Task Can_get_FirstDeposit_bonus_with_automatic_issuance_mode_via_member_website()
        {
            //create a bonus template and a bonus - Bonus type:First, Reward Type: Fixed, Issuance:Automatic
            var walletTemplateId = _brand.WalletTemplates.First().Id;
            var info             = new CreateUpdateTemplateInfo
            {
                Name             = TestDataGenerator.GetRandomString(),
                TemplateType     = BonusType.FirstDeposit,
                BrandId          = _brand.Id,
                WalletTemplateId = walletTemplateId,
                Mode             = IssuanceMode.Automatic
            };
            var rules = new CreateUpdateTemplateRules
            {
                RewardTiers = new List <CreateUpdateRewardTier>
                {
                    new CreateUpdateRewardTier
                    {
                        CurrencyCode = "CAD",
                        BonusTiers   = new List <CreateUpdateTemplateTier> {
                            new CreateUpdateTemplateTier {
                                Reward = 19
                            }
                        }
                    }
                }
            };

            var bonusTemplate = await _bonusTestHelper.CreateTemplate(info : info, rules : rules);

            var bonus = await _bonusTestHelper.CreateBonus(bonusTemplate);

            _bonusName = bonus.Name;
            if (bonus.IsActive)
            {
                _activeBonusesNamesList.Add(_bonusName);
            }

            //create a player
            var player = _playerTestHelper.CreatePlayerForMemberWebsite(currencyCode: "CAD");

            //login to member site
            var memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver);

            memberWebsiteLoginPage.NavigateToMemberWebsite();
            var playerProfilePage = memberWebsiteLoginPage.Login(player.Username, player.Password);

            CashierPage cashierPage = playerProfilePage.Menu.OpenCashierPage();
            var         offlineDepositRequestPage = cashierPage.OpenOfflineDepositPage();

            offlineDepositRequestPage.Submit(amount: "113", playerRemark: "my deposit");
            Assert.AreEqual("Congratulation on your deposit!", offlineDepositRequestPage.GetConfirmationMessage());
            var playerId = _playerQueries.GetPlayerByUsername(player.Username).Id;

            //Wait for record in DB
            WaitForOfflineDeposit(playerId, amount: 113, timeout: TimeSpan.FromSeconds(20));
            var firstdeposit = GetLastDepositByPlayerId(playerId);

            _paymentTestHelper.ConfirmOfflineDeposit(firstdeposit);
            _paymentTestHelper.VerifyOfflineDeposit(firstdeposit, true);
            _paymentTestHelper.ApproveOfflineDeposit(firstdeposit, true);

            //re-login to member site
            memberWebsiteLoginPage.NavigateToMemberWebsite();
            _driver.Logout();

            //make sure that we've got a bonus
            playerProfilePage = memberWebsiteLoginPage.Login(player.Username, player.Password);
            playerProfilePage.Menu.OpenCashierPage();
            Assert.AreEqual("19", cashierPage.GetBonusBalance());

            //deactivate bonus
            DeactivateBonus();
        }