public override void BeforeEach() { base.BeforeEach(); Country = BrandHelper.CreateCountry("CA", "Canada"); Culture = BrandHelper.CreateCulture("en-CA", "English (Canada)"); Currency = BrandHelper.CreateCurrency("CAD", "Canadian Dollar"); }
public Currency CreateCurrency(string code, string name) { var currency = _brandRepository.Currencies.SingleOrDefault(c => c.Code == code); if (currency == null) { currency = new Currency { Code = code, Name = name }; _brandRepository.Currencies.Add(currency); } return(currency); }
public Brand CreateBrand( Licensee licensee = null, Country country = null, Culture culture = null, Currency currency = null, bool isActive = false) { licensee = licensee ?? _brandRepository.Licensees.FirstOrDefault() ?? CreateLicensee(); var products = licensee.Products; country = country ?? licensee.Countries.First(); culture = culture ?? licensee.Cultures.First(); currency = currency ?? licensee.Currencies.First(); var brandId = CreateBrand(licensee, PlayerActivationMethod.Automatic); CreateWallet(licensee.Id, brandId, products.Select(x => x.ProductId).ToArray()); AssignCountry(brandId, country.Code); AssignCurrency(brandId, currency.Code); _brandRepository.SaveChanges(); AssignCulture(brandId, culture.Code); AssignProducts(brandId, products.Select(x => x.ProductId).ToArray()); CreateRiskLevel(brandId); AssignBrandCredentials(brandId); _paymentTestHelper.CreateBank(brandId, country.Code); _paymentTestHelper.CreateBankAccount(brandId, currency.Code); _paymentTestHelper.CreatePaymentGatewaySettings(brandId); _paymentTestHelper.CreatePaymentLevel(brandId, currency.Code); CreateVipLevel(brandId); if (isActive) { _brandCommands.ActivateBrand(new ActivateBrandRequest { BrandId = brandId, Remarks = TestDataGenerator.GetRandomString() }); } return(_brandQueries.GetBrandOrNull(brandId)); }