protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     _container = new WindsorContainer();
     _container.Configure(Settings.Default.Connection);
     var resolver = new WindsorDependencyResolver(_container);
     DependencyResolver.SetResolver(resolver);
     RegisterGlobalFilters(GlobalFilters.Filters);
     RegisterRoutes(RouteTable.Routes);
 }
Пример #2
0
        public void CanResolveHomeController()
        {
            //Arrange
            var windsorContainer = new WindsorContainer();
            windsorContainer.Configure();
            var resolver = new WindsorDependencyResolver(new WindsorIoCContainer(windsorContainer));
            DependencyResolver.SetResolver(resolver);
            IControllerActivator controllerActivator = new StandardControllerActivator();

            //Act
            IController controller = controllerActivator.Create(null, typeof (HomeController));

            //Assert
            Assert.IsNotNull(controller);
        }