Непосредственно из Unit Test FactorySupportTestCase (которые являются вашими друзьями):
[Test]
public void FactorySupport_UsingProxiedFactory_WorksFine()
{
container.AddFacility("factories", new FactorySupportFacility());
container.AddComponent("standard.interceptor", typeof(StandardInterceptor));
container.AddComponent("factory", typeof(CalulcatorFactory));
AddComponent("calculator", typeof(ICalcService), typeof(CalculatorService), "Create");
ICalcService service = (ICalcService) container["calculator"];
Assert.IsNotNull(service);
}
private void AddComponent(string key, Type service, Type type, string factoryMethod)
{
MutableConfiguration config = new MutableConfiguration(key);
config.Attributes["factoryId"] = "factory";
config.Attributes["factoryCreate"] = factoryMethod;
container.Kernel.ConfigurationStore.AddComponentConfiguration(key, config);
container.Kernel.AddComponent(key, service, type);
}