/// <summary>
        /// Application_s the start.
        /// </summary>
// ReSharper disable InconsistentNaming
        protected void Application_Start()
// ReSharper restore InconsistentNaming
        {
            DependencyResolver.SetResolver(new AutofacDependencyResolver(DependencyInjection.Container));

            AreaRegistration.RegisterAllAreas();
            AutoMapperMappings.Initialize();

            ModelBinders.Binders.Add(typeof(Media), new MediaModelBinder());
            ModelBinders.Binders.Add(typeof(Album), new AlbumModelBinder());
            RegisterRoutes(RouteTable.Routes);

            //RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);
        }
        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);
        }
Exemple #3
0
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            var config    = GlobalConfiguration.Configuration;
            var container = StructuremapMvc.StructureMapDependencyScope.Container;

            config.DependencyResolver = new StructureMapDependencyResolver(container);

            MartenDocumentStore.BootMartenDocumentStore();

            AutoMapperMappings.BootAutoMapper();
        }
Exemple #4
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;
        }
Exemple #5
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();
        }
        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.BindMappings();
 }
 public void FixtureSetup()
 {
     AutoMapperMappings.CreateMappings();
 }