public void Cannot_execute_WagerConfigurationCommands_without_permissions() { // Arrange LogWithNewAdmin(Modules.WagerConfiguration, Permissions.View); // Act Assert.Throws <InsufficientPermissionsException>(() => _wagerConfigurationCommands.ActivateWagerConfiguration(new Guid(), new Guid())); Assert.Throws <InsufficientPermissionsException>(() => _wagerConfigurationCommands.DeactivateWagerConfiguration(new Guid(), new Guid())); Assert.Throws <InsufficientPermissionsException>(() => _wagerConfigurationCommands.CreateWagerConfiguration(new WagerConfigurationDTO(), new Guid())); Assert.Throws <InsufficientPermissionsException>(() => _wagerConfigurationCommands.UpdateWagerConfiguration(new WagerConfigurationDTO(), new Guid())); }
public ActionResult Activate(Guid id) { try { _wagerConfigurationCommands.ActivateWagerConfiguration(id, CurrentUser.Id); return(this.Success("ok")); } catch (ValidationError e) { return(this.Failed(e)); } catch (Exception e) { return(this.Failed(e)); } }
public async Task Can_create_OW_with_1x_auto_wager_check_with_gap_between_deposits() { var player = _player; var wagerId = _wageringConfigurationCommands.CreateWagerConfiguration(new WagerConfigurationDTO() { BrandId = player.BrandId, IsDepositWageringCheck = true, Currency = player.CurrencyCode }, Guid.NewGuid()); _wageringConfigurationCommands.ActivateWagerConfiguration(wagerId, Guid.NewGuid()); //Make deposit _paymentTestHelper.MakeDeposit(player.Id, 1000); //Make bet await _gamesTestHelper.PlaceAndWinBet(500, 600, player.Id); await _gamesTestHelper.PlaceAndWinBet(300, 600, player.Id); await _gamesTestHelper.PlaceAndWinBet(200, 600, player.Id); await _gamesTestHelper.PlaceAndWinBet(500, 600, player.Id); await _gamesTestHelper.PlaceAndWinBet(50, 600, player.Id); await _gamesTestHelper.PlaceAndWinBet(300, 600, player.Id); Balance.Main = 2750; var offlineWithdrawalRequest = new OfflineWithdrawRequest { Amount = 200, 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); //Make deposit _paymentTestHelper.MakeDeposit(player.Id, 500); //Make bet await _gamesTestHelper.PlaceAndWinBet(300, 600, player.Id); await _gamesTestHelper.PlaceAndWinBet(100, 600, player.Id); Balance.Main = 4050; 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); }