public virtual void TestFixtureSetup()
        {
            this.TestCustomer = MerchelloContext.Current.Services.CustomerService.CreateCustomerWithKey(
                Guid.NewGuid().ToString(),
                "first",
                "last",
                "*****@*****.**");

            this.BraintreeProviderSettings = TestHelper.GetBraintreeProviderSettings();

            AutoMapperMappings.CreateMappings();

            this.Gateway = this.BraintreeProviderSettings.AsBraintreeGateway();

            this.BraintreeApiService = new BraintreeApiService(this.BraintreeProviderSettings);
        }
Example #2
0
        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();

            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;
        }
        public virtual void FixtureSetup()
        {
            var serviceContext = new ServiceContext(new PetaPocoUnitOfWorkProvider());

            _dbPreTestDataWorker = new DbPreTestDataWorker(serviceContext);


            if (!GatewayProviderResolver.HasCurrent)
            {
                GatewayProviderResolver.Current = new GatewayProviderResolver(
                    PluginManager.Current.ResolveGatewayProviders(),
                    serviceContext.GatewayProviderService,
                    new NullCacheProvider());
            }



            MerchelloContext = new MerchelloContext(serviceContext,
                                                    new GatewayContext(serviceContext, GatewayProviderResolver.Current),
                                                    new CacheHelper(new NullCacheProvider(),
                                                                    new NullCacheProvider(),
                                                                    new NullCacheProvider()));

            if (!TriggerResolver.HasCurrent)
            {
                TriggerResolver.Current = new TriggerResolver(PluginManager.Current.ResolveObservableTriggers());
            }

            if (!MonitorResolver.HasCurrent)
            {
                MonitorResolver.Current = new MonitorResolver(MerchelloContext.Gateways.Notification, PluginManager.Current.ResolveObserverMonitors());
            }

            AutoMapperMappings.CreateMappings();
            ExamineManager.Instance.IndexProviderCollection["MerchelloProductIndexer"].RebuildIndex();
            ExamineManager.Instance.IndexProviderCollection["MerchelloCustomerIndexer"].RebuildIndex();
        }
 public void FixtureSetup()
 {
     AutoMapperMappings.CreateMappings();
 }