Well, I think the problem is simply that Im adding a session generated
by the SessionManager, into the container, but its not resolving it
later on.
A test case might look like:
[Test]
public void Should_resolve_session_provided_by_SessionManager()
{
IKernel kernel = new DefaultKernel();
kernel.Register(Component.For<ITestService>
().ImplementedBy<TestService>());
var session = sessionManager.OpenSession();
kernel.AddComponentInstance("NHibernate.Session",session);
var result = kernel.Resolve<ITestService>();
}
public class TestService:ITestService
{
private readonly ISession session;
public TestService (ISession session)
{
this.session = session;
}
public void DoWork()
{
throw new NotImplementedException();
}
}
public interface ITestService
{
void DoWork();
}
Is this what you mean?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---