Тестирование отображений nhibernate Castle Windsor в httpModules не зарегистрировано

Я хочу написать тест, который проверяет сопоставления в замке Виндзор. Я использую ASP MVC2, где я использую Castle Windsor для сопоставления своих репозиториев.

Я прочитал эту статью:

http://weblogs.asp.net/bsimser/archive/2008/06/04/the-first-spec-you-should-write-when-using-castle. aspx

и на основе этого я создал свой MS Test

 [TestMethod()]
        public void GetContainerTest()
        {
            MooseMvc.Infrastructure.DependencyInjectionInitialiser target = new MooseMvc.Infrastructure.DependencyInjectionInitialiser(); // TODO: Initialize to an appropriate value
            IWindsorContainer container = target.GetContainer();
            foreach (IHandler assignableHandler in container.Kernel.GetAssignableHandlers(typeof(object)))
            {             
                container.Resolve(assignableHandler.ComponentModel.Service);
            }
        }

Данные для target.getcontainer () реализуют

 this._windsorContainer.Register(Component.For()
                .ImplementedBy(typeof(TConcreteType)).LifeStyle.PerWebRequest);

Я получаю следующее сообщение:

 Looks like you forgot to register the http module 
Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule Add '' to the  section on your web.config.
If you're running IIS7 in Integrated Mode you will need to  add it to
 section under 

7
задан cpoDesign 6 January 2012 в 19:48
поделиться