public void WHEN_Passing_BlockHelper_After_ComposerHost_Init_Completed_SHOULD_Register_To_ViewEngine()
        {
            //Arrange
            string helperName = GetRandom.String(32);
            Mock <IHandlebarsBlockHelper> helper = CreateBlockHelper(helperName);

            //Act
            _composerHost.Init();
            _composerHost.RegisterHandlebarsHelper(helper.Object);

            //Assert
            Handlebars.Configuration.BlockHelpers.Should().ContainKey(helperName);
            Handlebars.Configuration.Helpers.Should().NotContainKey(helperName);
        }
Example #2
0
        public static void OnInitialized()
        {
            if (!HostingEnvironment.IsHosted)
            {
                return;
            }

            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            LogProvider.SetCurrentLogProvider(C1LogProvider.Instance);

            // Needed by C1, do not remove!

            _host.Init();

            var log = LogProvider.GetCurrentClassLogger();

            log.Info("Application Starting");

            DynamicTypeManager.EnsureCreateStore(typeof(ComposerPage));
            DynamicTypeManager.EnsureCreateStore(typeof(CategoryPage));

            var functions = MvcFunctionRegistry.NewFunctionCollection();

            RegisterFunctions(functions);
            RegisterFunctionRoutes(functions);

            DataEvents <IPage> .OnAfterAdd += UpdateAfterPageChanged;

            log.Info("Application Started");
        }