Ejemplo n.º 1
0
        public void Can_create_Avc_configuration()
        {
            var id = Guid.NewGuid();

            Container.Resolve <BrandTestHelper>().CreateBrand(isActive: true);
            var avcConfiguration = new AVCConfigurationDTO
            {
                Id                = id,
                Brand             = _brandQueries.GetBrands().First().Id,
                Currency          = _brandQueries.GetBrands().First().DefaultCurrency,
                HasFraudRiskLevel = false,
                HasWinnings       = true,
                WinningRules      = new List <WinningRuleDTO>
                {
                    FraudTestDataHelper.GenerateWinningRule(),
                FraudTestDataHelper.GenerateWinningRule()
                }
            };

            _avcConfigurationCommands.Create(avcConfiguration);

            var latestAutoVerificationCheckCriteria = _avcConfigurationQueries.GetAutoVerificationCheckConfiguration(id);

            Assert.NotNull(latestAutoVerificationCheckCriteria);

            //The default state of criteria at creation must be Inactive
            Assert.AreEqual(AutoVerificationCheckStatus.Inactive, latestAutoVerificationCheckCriteria.Status);
        }
Ejemplo n.º 2
0
        public void Cannot_execute_AVCConfigurationCommands_without_permissions()
        {
            // Arrange
            LogWithNewAdmin(Modules.AutoVerificationConfiguration, Permissions.View);

            // Act
            Assert.Throws <InsufficientPermissionsException>(() => _avcConfigurationCommands.Create(new AVCConfigurationDTO()));
        }
Ejemplo n.º 3
0
        public ActionResult Verification(AVCConfigurationDTO data)
        {
            var callMadeForCreation = data.Id == Guid.Empty;

            try
            {
                if (callMadeForCreation)
                {
                    _avcConfigurationCommands.Create(data);
                }
                else
                {
                    _avcConfigurationCommands.Update(data);
                }
            }
            catch (ValidationException e)
            {
                return(this.Failed(e));
            }
            catch (Exception e)
            {
                return(this.Failed(e));
            }

            return(this.Success(new
            {
                requestMadeForCreation = callMadeForCreation
            }));
        }
 private void CreateAvcConfiguration(AVCConfigurationDTO avcConfiguration)
 {
     Container.Resolve <BrandTestHelper>().CreateBrand(isActive: true);
     avcConfiguration.Id = Guid.NewGuid();
     _avcConfigurationCommands.Create(avcConfiguration);
 }
Ejemplo n.º 5
0
 public AutoVerificationCheckConfiguration CreateConfiguration(AVCConfigurationDTO configuration)
 {
     return(_avcConfigurationCommands.Create(configuration));
 }