/// <summary> /// The Umbraco Application Starting event. /// </summary> /// <param name="umbracoApplication"> /// The umbraco application. /// </param> /// <param name="applicationContext"> /// The application context. /// </param> protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { base.ApplicationStarting(umbracoApplication, applicationContext); // Initialize Merchello Log.Info("Attempting to initialize Merchello"); try { MerchelloBootstrapper.Init(new WebBootManager()); Log.Info("Initialization of Merchello complete"); } catch (Exception ex) { Log.Error("Initialization of Merchello failed", ex); } }
public void Web_BootManager_Can_Create_MerchelloContext() { MerchelloBootstrapper.Init(new WebBootManager(true) { IsUnitTest = true }); var context = MerchelloContext.Current; Assert.NotNull(context); var service = context.Services.CustomerService; Assert.NotNull(service); Assert.IsTrue(_initEventCalled); Assert.IsTrue(_startingEventCalled); Assert.IsTrue(_completedEventCalled); }
/// <summary> /// The Umbraco Application Starting event. /// </summary> /// <param name="umbracoApplication"> /// The umbraco application. /// </param> /// <param name="applicationContext"> /// The application context. /// </param> protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { base.ApplicationStarting(umbracoApplication, applicationContext); BootManagerBase.MerchelloStarted += BootManagerBaseOnMerchelloStarted; try { // Initialize Merchello Log.Info("Attempting to initialize Merchello"); MerchelloBootstrapper.Init(new WebBootManager(applicationContext), applicationContext); Log.Info("Initialization of Merchello complete"); } catch (Exception ex) { Log.Error("Initialization of Merchello failed", ex); } this.RegisterContentFinders(); }