public virtual void FixtureSetup()
        {
            // Sets Umbraco SqlSytax and ensure database is setup
            DbPreTestDataWorker = new DbPreTestDataWorker();
            DbPreTestDataWorker.ValidateDatabaseSetup();
            DbPreTestDataWorker.DeleteAllAnonymousCustomers();

            // Merchello CoreBootStrap
            var bootManager = new WebBootManager();
            bootManager.Initialize();

            if(MerchelloContext.Current == null) Assert.Ignore("MerchelloContext.Current is null");

            CurrentCustomer = DbPreTestDataWorker.MakeExistingAnonymousCustomer();

            // Product saves

            ProductService.Created += ProductServiceCreated;
            ProductService.Saved += ProductServiceSaved;
            ProductService.Deleted += ProductServiceDeleted;
            ProductVariantService.Created += ProductVariantServiceCreated;
            ProductVariantService.Saved += ProductVariantServiceSaved;
            ProductVariantService.Deleted += ProductVariantServiceDeleted;

            // BasketCheckout
               // ItemCacheService.Saved += BasketItemCacheSaved;
        }
        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");
        }
Exemple #3
0
        public virtual void FixtureSetup()
        {
            //AutoMapperMappings.CreateMappings();

            // Umbraco Application
            var applicationMock    = new Mock <UmbracoApplication>();
            var applicationContext = new Mock <ApplicationContext>();

            // Sets Umbraco SqlSytax and ensure database is setup
            DbPreTestDataWorker = new DbPreTestDataWorker();
            DbPreTestDataWorker.ValidateDatabaseSetup();
            DbPreTestDataWorker.DeleteAllAnonymousCustomers();


            // Merchello CoreBootStrap
            var bootManager = new WebBootManager(DbPreTestDataWorker.TestLogger, DbPreTestDataWorker.SqlSyntaxProvider);

            bootManager.Initialize(applicationContext.Object);


            if (MerchelloContext.Current == null)
            {
                Assert.Ignore("MerchelloContext.Current is null");
            }

            CurrentCustomer = DbPreTestDataWorker.MakeExistingAnonymousCustomer();


            // Product saves
            ProductService.Created        += ProductServiceCreated;
            ProductService.Saved          += ProductServiceSaved;
            ProductService.Deleted        += ProductServiceDeleted;
            ProductVariantService.Created += ProductVariantServiceCreated;
            ProductVariantService.Saved   += ProductVariantServiceSaved;
            ProductVariantService.Deleted += ProductVariantServiceDeleted;

            // BasketCheckout
            // ItemCacheService.Saved += BasketItemCacheSaved;

            SalePreparationBase.Finalizing += SalePreparationBaseOnFinalizing;

            EntityCollectionService.Created += EntityCollectionServiceOnCreated;
            EntityCollectionService.Deleted += EntityCollectionServiceOnDeleted;
        }
Exemple #4
0
        public virtual void FixtureSetup()
        {
            AutoMapperMappings.BindMappings();

            // Umbraco Application
            var applicationMock = new Mock <UmbracoApplication>();

            // Sets Umbraco SqlSytax and ensure database is setup
            DbPreTestDataWorker = new DbPreTestDataWorker();
            DbPreTestDataWorker.ValidateDatabaseSetup();
            DbPreTestDataWorker.DeleteAllAnonymousCustomers();

            // Merchello CoreBootStrap
            var bootManager = new WebBootManager();

            bootManager.Initialize();


            if (MerchelloContext.Current == null)
            {
                Assert.Ignore("MerchelloContext.Current is null");
            }

            CurrentCustomer = DbPreTestDataWorker.MakeExistingAnonymousCustomer();


            // Product saves
            ProductService.Created        += ProductServiceCreated;
            ProductService.Saved          += ProductServiceSaved;
            ProductService.Deleted        += ProductServiceDeleted;
            ProductVariantService.Created += ProductVariantServiceCreated;
            ProductVariantService.Saved   += ProductVariantServiceSaved;
            ProductVariantService.Deleted += ProductVariantServiceDeleted;

            // BasketCheckout
            // ItemCacheService.Saved += BasketItemCacheSaved;
        }
        public virtual void FixtureSetup()
        {
            //AutoMapperMappings.CreateMappings();

            // Umbraco Application
            var applicationMock = new Mock<UmbracoApplication>();

            // Sets Umbraco SqlSytax and ensure database is setup
            DbPreTestDataWorker = new DbPreTestDataWorker();
            DbPreTestDataWorker.ValidateDatabaseSetup();
            DbPreTestDataWorker.DeleteAllAnonymousCustomers();

            // Merchello CoreBootStrap
            var bootManager = new WebBootManager(DbPreTestDataWorker.TestLogger);
            bootManager.Initialize();

            if(MerchelloContext.Current == null) Assert.Ignore("MerchelloContext.Current is null");

            CurrentCustomer = DbPreTestDataWorker.MakeExistingAnonymousCustomer();

            // Product saves
            ProductService.Created += ProductServiceCreated;
            ProductService.Saved += ProductServiceSaved;
            ProductService.Deleted += ProductServiceDeleted;
            ProductVariantService.Created += ProductVariantServiceCreated;
            ProductVariantService.Saved += ProductVariantServiceSaved;
            ProductVariantService.Deleted += ProductVariantServiceDeleted;

            // BasketCheckout
               // ItemCacheService.Saved += BasketItemCacheSaved;

            SalePreparationBase.Finalizing += SalePreparationBaseOnFinalizing;

            EntityCollectionService.Created += EntityCollectionServiceOnCreated;
            EntityCollectionService.Deleted += EntityCollectionServiceOnDeleted;
        }
        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();

            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;
        }
        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;
        }