Example #1
0
        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()));
            AutoMapperMappings.BindMappings();
            ExamineManager.Instance.IndexProviderCollection["MerchelloProductIndexer"].RebuildIndex();
        }
Example #2
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;
        }
Example #3
0
 public void FixtureSetup()
 {
     AutoMapperMappings.BindMappings();
 }