public void Can_process_submit_deposit()
        {
            // Arrange
            var depositAmount = TestDataGenerator.GetRandomDepositAmount();

            // Act
            var deposit = PaymentTestHelper.CreateOfflineDeposit(_player.Id, depositAmount);

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

            Assert.AreEqual(CurrentBrand.Name, record.Brand);
            Assert.AreEqual(CurrentBrand.Licensee.Name, record.Licensee);
            Assert.AreEqual(_player.Username, record.Username);
            Assert.AreEqual(_player.InternalAccount, record.IsInternalAccount);
            Assert.AreEqual(deposit.TransactionNumber, record.TransactionId);
            Assert.AreEqual(deposit.Id, record.DepositId);
            Assert.AreEqual("Offline-Bank", record.PaymentMethod);
            Assert.AreEqual(deposit.CurrencyCode, record.Currency);
            Assert.AreEqual(depositAmount, record.Amount);
            Assert.AreEqual(OfflineDepositStatus.New.ToString(), record.Status);
            Assert.Less(DateTimeOffset.Now.AddDays(-2), record.Submitted);
            Assert.AreEqual(_actorInfoProvider.Actor.UserName, record.SubmittedBy);
            Assert.AreEqual(deposit.DepositType.ToString(), record.DepositType);
            Assert.AreEqual(deposit.BankAccount.AccountName, record.BankAccountName);
            Assert.AreEqual(deposit.BankAccount.AccountId, record.BankAccountId);
            Assert.AreEqual("Test Bank", record.BankName);
            Assert.AreEqual("Province", record.BankProvince);
            Assert.AreEqual("Branch", record.BankBranch);
            Assert.AreEqual(deposit.BankAccount.AccountNumber, record.BankAccountNumber);
        }
Exemple #2
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);
        }
Exemple #3
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_export_report_data()
        {
            // Arrange
            PaymentTestHelper.CreateOfflineDeposit(_player.Id, TestDataGenerator.GetRandomDepositAmount());

            var filteredRecords = ReportController.FilterAndOrder(
                _reportQueries.GetDepositRecordsForExport(),
                new DepositRecord(),
                "Submitted", "asc");

            // Act
            var content = Encoding.Unicode.GetString(ReportController.ExportToExcel(filteredRecords));

            // Assert
            Assert.AreNotEqual(content.IndexOf("<table"), -1);
        }
        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);
        }