Я хочу написать тест, который проверяет сопоставления в замке Виндзор. Я использую ASP MVC2, где я использую Castle Windsor для сопоставления своих репозиториев.
Я прочитал эту статью:
и на основе этого я создал свой 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