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 async Task Can_unverify_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); //assert balance after request _paymentTestHelper.AssertBalance(_player.Id , total: 10000, playable: 9999, main: 9999, free: 9999, withdrawalLock: 1); //have to revert withdraw,before unverify _withdrawalService.Revert(response.Id, TestDataGenerator.GetRandomString(10)); var unverifyRemarks = TestDataGenerator.GetRandomString(10); _withdrawalService.Unverify(response.Id, unverifyRemarks); //assert balance after Unverify _paymentTestHelper.AssertBalance(_player.Id , total: 10000, playable: 10000, main: 10000, free: 10000, withdrawalLock: 0); var withdraw = _paymentRepository.OfflineWithdraws.FirstOrDefault(x => x.Id == response.Id); withdraw.Status.Should().Be(WithdrawalStatus.Unverified); withdraw.Unverified.Should().BeCloseTo(DateTimeOffset.Now, 60000); withdraw.UnverifiedBy.Should().Be(_actorInfoProvider.Actor.UserName); withdraw.Remarks.Should().Be(unverifyRemarks); }
public ActionResult Unverify(Guid requestId, string remarks) { try { _service.Unverify(requestId, remarks); return(this.Success("app:payment.withdraw.successfullyUnverified")); } catch (Exception exception) { return(this.Failed(exception)); } }
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); }