Exemple #1
0
        public void Can_update_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
            };

            _avcConfigurationCommands.Create(avcConfiguration);

            avcConfiguration.HasFraudRiskLevel = true;
            avcConfiguration.HasWinnings       = true;

            avcConfiguration.WinningRules = new List <WinningRuleDTO>
            {
                FraudTestDataHelper.GenerateWinningRule()
            };

            _avcConfigurationCommands.Update(avcConfiguration);
            Assert.IsTrue(_avcConfigurationQueries.GetAutoVerificationCheckConfiguration(id).HasFraudRiskLevel);
        }
Exemple #2
0
        public void Cannot_create_avc_configuration_with_invalid_brand()
        {
            // Arrange
            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()
                }
            };

            LogWithNewAdmin(Modules.AutoVerificationConfiguration, Permissions.Create);

            // Act
            Assert.Throws <InsufficientPermissionsException>(() => _avcConfigurationCommands.Create(avcConfiguration));
        }
Exemple #3
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);
        }