public void Cannot_create_OW_request_exceeding_transaction_limit() { var paymentSettings = new PaymentSettings { Id = new Guid("50797305-5320-4086-BA1C-9D062DDF53D9"), BrandId = _player.BrandId, VipLevel = _player.VipLevel.Id.ToString(), CurrencyCode = _player.CurrencyCode, MinAmountPerTransaction = 10, MaxAmountPerTransaction = 20, MaxAmountPerDay = 30, MaxTransactionPerDay = 40, MaxTransactionPerWeek = 50, MaxTransactionPerMonth = 60 }; _paymentRepository.PaymentSettings.Add(paymentSettings); var offlineWithdrawalRequest = new OfflineWithdrawRequest { Amount = 21, NotificationType = NotificationType.None, BankAccountTime = _paymentRepository.PlayerBankAccounts.First().Created.ToString(), BankTime = _paymentRepository.Banks.First().Created.ToString(), PlayerBankAccountId = _paymentRepository .PlayerBankAccounts .Include(x => x.Player) .First(x => x.Player.Id == _player.Id) .Id, Remarks = "asd", RequestedBy = _actorInfoProvider.Actor.UserName }; var response = _withdrawalService.Request(offlineWithdrawalRequest); }
public void Cannot_create_OWs_more_than_transaction_limit_per_week() { const int transactionPerWeek = 10; var player = _player; var paymentSettings = new PaymentSettings { Id = new Guid("50797305-5320-4086-BA1C-9D062DDF53D9"), BrandId = player.BrandId, VipLevel = player.VipLevel.Id.ToString(), CurrencyCode = player.CurrencyCode, MinAmountPerTransaction = -10, MaxAmountPerTransaction = 100, MaxAmountPerDay = 100, MaxTransactionPerDay = 100, MaxTransactionPerWeek = transactionPerWeek, MaxTransactionPerMonth = 60 }; _paymentRepository.PaymentSettings.Add(paymentSettings); for (int i = 0; i < 10; i++) { var offlineWithdrawalRequest = new OfflineWithdrawRequest { Amount = 1, NotificationType = NotificationType.None, BankAccountTime = _paymentRepository.PlayerBankAccounts.First().Created.ToString(), BankTime = _paymentRepository.Banks.First().Created.ToString(), PlayerBankAccountId = _paymentRepository .PlayerBankAccounts .Include(x => x.Player) .First(x => x.Player.Id == player.Id) .Id, Remarks = "asd", RequestedBy = _actorInfoProvider.Actor.UserName }; _withdrawalService.Request(offlineWithdrawalRequest); } var lastRequest = new OfflineWithdrawRequest { Amount = 1, NotificationType = NotificationType.None, BankAccountTime = _paymentRepository.PlayerBankAccounts.First().Created.ToString(), BankTime = _paymentRepository.Banks.First().Created.ToString(), PlayerBankAccountId = _paymentRepository .PlayerBankAccounts .Include(x => x.Player) .First(x => x.Player.Id == player.Id) .Id, Remarks = "asd", RequestedBy = _actorInfoProvider.Actor.UserName }; var response = _withdrawalService.Request(lastRequest); }