Пример #1
0
 public ActionResult WagerConfiguration(WagerConfigurationDTO wagerConfigurationDTO)
 {
     try
     {
         string message;
         if (wagerConfigurationDTO.Id == Guid.Empty)
         {
             _wagerConfigurationCommands.CreateWagerConfiguration(wagerConfigurationDTO, CurrentUser.Id);
             message = "Wagering configuration has been created successfully";
         }
         else
         {
             _wagerConfigurationCommands.UpdateWagerConfiguration(wagerConfigurationDTO, CurrentUser.Id);
             message = "Wagering configuration has been updated successfully";
         }
         return(this.Success(message));
     }
     catch (ValidationError e)
     {
         return(this.Failed(e));
     }
     catch (Exception e)
     {
         return(this.Failed(e));
     }
 }
        public void Cannnot_create_wagering_configuration_without_currency()
        {
            var wageringConfigDTO = new WagerConfigurationDTO
            {
                BrandId = _brand.Id,
                IsDepositWageringCheck          = false,
                IsManualAdjustmentWageringCheck = true,
                IsRebateWageringCheck           = false
            };

            Assert.Throws <RegoValidationException>(() => _wagerConfigurationCommands.CreateWagerConfiguration(wageringConfigDTO, Guid.Empty));
        }
Пример #3
0
        private WagerConfigurationDTO CreateValidWagerConfigurationDto()
        {
            var brandTestHelper = Container.Resolve <BrandTestHelper>();

            var licensee = brandTestHelper.CreateLicensee();
            var brand    = brandTestHelper.CreateBrand(licensee, isActive: true);

            var data = new WagerConfigurationDTO()
            {
                BrandId = brand.Id,
                IsDepositWageringCheck = true,
                Currency = brand.DefaultCurrency
            };

            return(data);
        }
        public void Cannnot_create_duplicate_wagering_configuration()
        {
            var wageringConfigDTOFirst = new WagerConfigurationDTO
            {
                BrandId = _brand.Id,
                IsDepositWageringCheck          = false,
                IsManualAdjustmentWageringCheck = true,
                IsRebateWageringCheck           = false,
                Currency = _brand.DefaultCurrency
            };

            var wageringConfigDTOSecond = new WagerConfigurationDTO
            {
                BrandId = _brand.Id,
                IsDepositWageringCheck          = false,
                IsManualAdjustmentWageringCheck = true,
                IsRebateWageringCheck           = false,
                Currency = _brand.DefaultCurrency
            };

            _wagerConfigurationCommands.CreateWagerConfiguration(wageringConfigDTOFirst, Guid.Empty);

            Assert.Throws <RegoValidationException>(() => _wagerConfigurationCommands.CreateWagerConfiguration(wageringConfigDTOSecond, Guid.Empty));
        }