public void Init() { var cmsRegistry = new CmsIocModule(); var dataRegistry = new DataNinectModule(); _container.Register(new List <IRegistry> { cmsRegistry, new ServicesNinjectModule(), dataRegistry }); MenuGen.MenuGen.Init(x => x.Container.Register(new List <IRegistry> { //dataRegistry })); //IocConfig.Configure(_container); AutoMapperConfiguration.Configure(); RazorViewEngineConfig.Configure(); RouteConfig.RegisterRoutes(RouteTable.Routes); //TODO: need to think more about what routes to add to a user's MVC project _templateEngine = (ITemplateEngine)_container.Resolve <ITemplateEngine>(); _templateEngine.GenerateTemplates(Assembly.GetCallingAssembly()); ControllerBuilder.Current.SetControllerFactory(new IocControllerFactory(_container)); }
public void ProcessMvcFiles_ControllerDoesNotSubclassCmsController_DoesNotCreateSectionTemplate() { //arrange //act _templateEngine.GenerateTemplates(_assembly); //assert var sectionTemplates = _sectionTemplateService.GetAllSectionTemplates(); sectionTemplates.Count().Should().Be.EqualTo(NumValidControllersInCurrentProject); }