Пример #1
0
        public void Cannot_execute_WithdrawalService_without_permissions()
        {
            // Arrange
            LogWithNewAdmin(Modules.OfflineDepositRequests, Permissions.View);

            // Act
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsForVerification());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsForAcceptance());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsForApproval());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsCanceled());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsFailedAutoWagerCheck());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsOnHold());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Request(new OfflineWithdrawRequest()));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Verify(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Unverify(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Approve(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Reject(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.PassWager(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.FailWager(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.PassInvestigation(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.FailInvestigation(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Accept(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Revert(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Cancel(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.SaveExemption(new Exemption()));
        }
        public ActionResult RequestedList(SearchPackage searchPackage)
        {
            var data = SearchOfflineWithdraws(
                searchPackage,
                obj => new[]
            {
                obj.PlayerBankAccount.Player.Username,
                obj.PlayerBankAccount.Bank.Brand.Name,
                obj.PlayerBankAccount.Bank.BankName,
                obj.TransactionNumber,
                obj.PlayerBankAccount.Province,
                obj.PlayerBankAccount.City,
                obj.PlayerBankAccount.Branch,
                obj.PlayerBankAccount.SwiftCode,
                obj.PlayerBankAccount.Address,
                obj.PlayerBankAccount.AccountName,
                obj.PlayerBankAccount.AccountNumber,
                obj.Amount.ToString(CultureInfo.InvariantCulture),
                obj.Created.ToString(CultureInfo.InvariantCulture),
                obj.CreatedBy,
                obj.Remarks
            },
                _service.GetWithdrawalsForVerification());

            return(new JsonResult
            {
                Data = data,
                MaxJsonLength = int.MaxValue,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Пример #3
0
        public async Task Can_revert_withdrawal_request()
        {
            var player = _player;

            _walletRepository.SaveChanges();
            _paymentTestHelper.MakeDeposit(player.Id, 1000);
            await _gamesTestHelper.PlaceAndWinBet(1000, 10000, player.Id);

            Balance.Main = 10000;

            var response = _paymentTestHelper.MakeWithdraw(player.Id, _actorInfoProvider.Actor.UserName, 100);

            //assert balance after request
            _paymentTestHelper.AssertBalance(_player.Id
                                             , total: 10000, playable: 9900, main: 9900, free: 9900, withdrawalLock: 100);

            //have to revert withdraw,before unverify
            var revertRemarks = TestDataGenerator.GetRandomString(10);

            _withdrawalService.Revert(response.Id, revertRemarks);
            var ow = _withdrawalService.GetWithdrawalsForVerification();

            Assert.IsNotEmpty(ow);
            Assert.AreEqual(1, ow.Count());

            //assert balance after revert
            _paymentTestHelper.AssertBalance(_player.Id
                                             , total: 10000, playable: 9900, main: 9900, free: 9900, withdrawalLock: 100);

            var withdraw = _paymentRepository.OfflineWithdraws.FirstOrDefault(x => x.Id == response.Id);

            withdraw.Status.Should().Be(WithdrawalStatus.Reverted);
            withdraw.RevertedTime.Should().BeCloseTo(DateTimeOffset.Now, 60000);
            withdraw.RevertedBy.Should().Be(_actorInfoProvider.Actor.UserName);
            withdraw.Remarks.Should().Be(revertRemarks);
        }