Exemple #1
0
        public void Cannot_activate_brand_over_licensee_brand_limit()
        {
            var licensee = BrandHelper.CreateLicensee();

            licensee.AllowedBrandCount = 1;
            var brand = BrandHelper.CreateBrand(licensee);

            BrandCommands.ActivateBrand(new ActivateBrandRequest {
                BrandId = brand.Id, Remarks = "remarks"
            });

            var newBrand = BrandHelper.CreateBrand(BrandRepository.Licensees.Single(x => x.Id == licensee.Id));

            BrandHelper.AssignCountry(newBrand.Id, Country.Code);
            BrandHelper.AssignCulture(newBrand.Id, Culture.Code);
            PaymentHelper.CreatePaymentLevel(newBrand.Id, Currency.Code);
            BrandHelper.CreateWallet(licensee.Id, newBrand.Id);

            Action action = () => BrandCommands.ActivateBrand(new ActivateBrandRequest {
                BrandId = newBrand.Id, Remarks = "remarks"
            });

            action.ShouldThrow <ValidationException>()
            .Where(x => x.Message.Contains("licenseeBrandLimitExceeded"));
        }
Exemple #2
0
        public void WhenNewPaymentLevelIsCreated()
        {
            ScenarioContext.Current.Should().ContainKey("brandId");
            var brandId      = ScenarioContext.Current.Get <Guid>("brandId");
            var paymentLevel = PaymentHelper.CreatePaymentLevel(brandId, "CAD", true);

            ScenarioContext.Current.Add("paymentLevelId", paymentLevel.Id);
        }
Exemple #3
0
        public void Cannot_Activate_Brand_Without_Country()
        {
            var licensee = BrandHelper.CreateLicensee();
            var brandId  = BrandHelper.CreateBrand(licensee, PlayerActivationMethod.Automatic);

            BrandHelper.AssignCurrency(brandId, Currency.Code);
            BrandHelper.AssignCulture(brandId, Culture.Code);
            PaymentHelper.CreateBank(brandId, Country.Code);
            PaymentHelper.CreateBankAccount(brandId, Currency.Code);
            PaymentHelper.CreatePaymentLevel(brandId, Currency.Code);
            BrandHelper.CreateWallet(licensee.Id, brandId);
            BrandHelper.CreateVipLevel(brandId);

            Action action = () => BrandCommands.ActivateBrand(new ActivateBrandRequest {
                BrandId = brandId, Remarks = "remarks"
            });

            action.ShouldThrow <ValidationException>()
            .Where(x => x.Message.Contains("noAssignedCountry"));
        }