I am trying to use Castle Windsor with MS Test. The test class seems to use the default constructor. How to configure the Lock to allow the service in the designer?
Here are the constructors of the Test Class:
private readonly IWebBrowser _browser;
public DepressionSummaryTests()
{
}
public DepressionSummaryTests(IWebBrowser browser)
{
_browser = browser;
}
My component in the application configuration looks like this:
<castle>
<components>
<component id="browser"
service="ConversationSummary.IWebBrowser, ConversationSummary"
type="ConversationSummary.Browser" />
</components>
</castle>
Here is my application container:
public class ApplicationContainer : WindsorContainer
{
private static IWindsorContainer container;
static ApplicationContainer()
{
container = new WindsorContainer(new XmlInterpreter(new ConfigResource("castle")));
}
private static IWindsorContainer Container
{
get { return container; }
}
public static IWebBrowser Browser
{
get { return (IWebBrowser) Container.Resolve("browser"); }
}
}
MS test requires a default constructor. What am I missing?
Thank!
source
share