Пример #1
0
        public virtual void FixtureSetup()
        {
            var syntax = (DbSyntax)Enum.Parse(typeof(DbSyntax), ConfigurationManager.AppSettings["syntax"]);

            // sets up the Umbraco SqlSyntaxProvider Singleton OBSOLETE
            SqlSyntaxProviderTestHelper.EstablishSqlSyntax(syntax);

            var sqlSyntax = SqlSyntaxProviderTestHelper.SqlSyntaxProvider(syntax);

            //AutoMapperMappings.CreateMappings();
            var logger = Logger.CreateWithDefaultLog4NetConfiguration();

            var cache = new CacheHelper(
                new ObjectCacheRuntimeCacheProvider(),
                new StaticCacheProvider(),
                new NullCacheProvider());

            var serviceContext = new ServiceContext(new RepositoryFactory(cache, logger, sqlSyntax), new PetaPocoUnitOfWorkProvider(logger), logger, new TransientMessageFactory());

            _dbPreTestDataWorker = new DbPreTestDataWorker(serviceContext);

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

            // Merchello CoreBootStrap
            var bootManager = new Web.WebBootManager(logger, _dbPreTestDataWorker.SqlSyntaxProvider);

            bootManager.Initialize();


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


            //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());


            ExamineManager.Instance.IndexProviderCollection["MerchelloProductIndexer"].RebuildIndex();
            ExamineManager.Instance.IndexProviderCollection["MerchelloCustomerIndexer"].RebuildIndex();
        }
        public virtual void FixtureSetup()
        {
            var syntax = (DbSyntax)Enum.Parse(typeof(DbSyntax), ConfigurationManager.AppSettings["syntax"]);

            // sets up the Umbraco SqlSyntaxProvider Singleton OBSOLETE
            SqlSyntaxProviderTestHelper.EstablishSqlSyntax(syntax);

            var sqlSyntax = SqlSyntaxProviderTestHelper.SqlSyntaxProvider(syntax);

            //AutoMapperMappings.CreateMappings();
            var logger = Logger.CreateWithDefaultLog4NetConfiguration();

            var cache = new CacheHelper(
                new ObjectCacheRuntimeCacheProvider(),
                new StaticCacheProvider(),
                new NullCacheProvider());

            var serviceContext = new ServiceContext(new RepositoryFactory(cache, logger, sqlSyntax), new PetaPocoUnitOfWorkProvider(logger), logger, new TransientMessageFactory());

            _dbPreTestDataWorker = new DbPreTestDataWorker(serviceContext);

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

            // Merchello CoreBootStrap
            var bootManager = new Web.WebBootManager(logger, _dbPreTestDataWorker.SqlSyntaxProvider);
            bootManager.Initialize();

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

            //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());

            ExamineManager.Instance.IndexProviderCollection["MerchelloProductIndexer"].RebuildIndex();
            ExamineManager.Instance.IndexProviderCollection["MerchelloCustomerIndexer"].RebuildIndex();
        }
        public virtual void FixtureSetup()
        {
            //AutoMapperMappings.CreateMappings();
            var logger         = Logger.CreateWithDefaultLog4NetConfiguration();
            var serviceContext = new ServiceContext(new RepositoryFactory(), new PetaPocoUnitOfWorkProvider(logger), logger, new TransientMessageFactory());

            _dbPreTestDataWorker = new DbPreTestDataWorker(serviceContext);

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

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

            bootManager.Initialize();


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


            //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());


            ExamineManager.Instance.IndexProviderCollection["MerchelloProductIndexer"].RebuildIndex();
            ExamineManager.Instance.IndexProviderCollection["MerchelloCustomerIndexer"].RebuildIndex();
        }
        public virtual void FixtureSetup()
        {
            //AutoMapperMappings.CreateMappings();
            var logger = Logger.CreateWithDefaultLog4NetConfiguration();
            var serviceContext = new ServiceContext(new RepositoryFactory(), new PetaPocoUnitOfWorkProvider(logger), logger, new TransientMessageFactory());

            _dbPreTestDataWorker = new DbPreTestDataWorker(serviceContext);

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

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

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

            //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());

            ExamineManager.Instance.IndexProviderCollection["MerchelloProductIndexer"].RebuildIndex();
            ExamineManager.Instance.IndexProviderCollection["MerchelloCustomerIndexer"].RebuildIndex();
        }