Castle.Windsor and HttpContextWrapper
问题 HttpContextWrapper and HttpContextBase, as explained here, were introduced to make HttpContext more mockable/testable. I'm trying to use it with S#arp Architecture, and hitting some problems. My MVC Controllers are set up to accept an HttpContextBase argument in the constructor, and during Application_Start, HttpContextBase is registered with Castle.Windor as follows: container.Register(Component.For<HttpContextBase>().UsingFactoryMethod( () => new HttpContextWrapper(HttpContext.Current)));