public override void FixtureSetup() { base.FixtureSetup(); PreTestDataWorker.DeleteAllCustomers(); var bootManager = new WebBootManager(); bootManager.Initialize(); _address = new Address() { Name = "Test", Address1 = "111 Somewhere Outwhere", Locality = "Out There", PostalCode = "98225", Region = "WA", CountryCode = "US", Email = "*****@*****.**" }; InvoiceService.Saved += InvoiceServiceSaved; OrderService.Saved += OrderServiceSaved; //var invoiceProvider = (InvoiceIndexer)ExamineManager.Instance.IndexProviderCollection["MerchelloInvoiceIndexer"]; //invoiceProvider.RebuildIndex(); }
public override void FixtureSetup() { base.FixtureSetup(); PreTestDataWorker.DeleteAllPaymentMethods(); PreTestDataWorker.DeleteAllShipCountries(); // Merchello CoreBootStrap var bootManager = new WebBootManager(); bootManager.Initialize(); _merchelloContext = Core.MerchelloContext.Current; var defaultCatalog = PreTestDataWorker.WarehouseService.GetDefaultWarehouse().WarehouseCatalogs.FirstOrDefault(); if (defaultCatalog == null) { Assert.Ignore("Default WarehouseCatalog is null"); } var us = _merchelloContext.Services.StoreSettingService.GetCountryByCode("US"); var usCountry = new ShipCountry(defaultCatalog.Key, us); ((ServiceContext)_merchelloContext.Services).ShipCountryService.Save(usCountry); #region Settings -> Taxation var taxProvider = _merchelloContext.Gateways.Taxation.CreateInstance(Constants.ProviderKeys.Taxation.FixedRateTaxationProviderKey); taxProvider.DeleteAllTaxMethods(); var gwTaxMethod = taxProvider.CreateTaxMethod("US", 0); gwTaxMethod.TaxMethod.Provinces["WA"].PercentAdjustment = 8.7M; taxProvider.SaveTaxMethod(gwTaxMethod); #endregion _address = new Address() { Address1 = "114 W. Magnolia St.", Address2 = "Suite 504", Locality = "Bellingham", Region = "WA", CountryCode = "US" }; var gateway = _merchelloContext.Gateways.Payment.GetAllActivatedProviders().FirstOrDefault(); var provider = _merchelloContext.Gateways.Payment.CreateInstance(gateway.Key); var resource = provider.ListResourcesOffered().FirstOrDefault(x => x.ServiceCode == "Cash"); var method = provider.CreatePaymentMethod(resource, "Cash", "Cash Payments"); provider.SavePaymentMethod(method); _paymentMethodKey = method.PaymentMethod.Key; }
public virtual void FixtureSetup() { // Sets Umbraco SqlSytax and ensure database is setup var dbPreTestDataWorker = new DbPreTestDataWorker(); // Merchello CoreBootStrap var bootManager = new WebBootManager(dbPreTestDataWorker.TestLogger, dbPreTestDataWorker.SqlSyntaxProvider); bootManager.Initialize(); if (MerchelloContext.Current == null) { Assert.Ignore("MerchelloContext.Current is null"); } }
public override void FixtureSetup() { base.FixtureSetup(); var bootManager = new WebBootManager(); bootManager.Initialize(); _customerIndexer = (CustomerIndexer)ExamineManager.Instance.IndexProviderCollection["MerchelloCustomerIndexer"]; _searcher = ExamineManager.Instance.SearchProviderCollection["MerchelloCustomerSearcher"]; _customerService = PreTestDataWorker.CustomerService; CustomerService.Created += CustomerServiceCreated; CustomerService.Saved += CustomerServiceSaved; CustomerService.Deleted += CustomerServiceDeleted; }