Oops, forgot that microkernel does not work with interceptors. Still, this
one fails:
[Test]
public void TransientInterceptor()
{
var interceptorCreated = false;
var interceptorReleased = false;
var c = new WindsorContainer();
c.Kernel.ComponentCreated += (model, instance) =>
{
if (model.Implementation == typeof(AnInterceptor))
{
interceptorCreated = true;
}
};
c.Kernel.ComponentDestroyed += (model, instance) =>
{
if (model.Implementation == typeof(AnInterceptor))
{
interceptorReleased = true;
}
};
c.Register(
Component.For<AComponent>().LifeStyle.Transient,
Component.For<AnInterceptor>().LifeStyle.Transient);
var component = c.Resolve<AComponent>();
c.Kernel.ReleaseComponent(component);
Assert.IsTrue(interceptorCreated);
Assert.IsTrue(interceptorReleased);
}
вторник, 6 ноября 2012 г., 10:59:53 UTC+2 пользователь Vladimir Okhotnikov
написал:
>
> Hi
>
> I have a following failing test in an empty project with Windsor 3.1 from
> NuGet:
>
> ...
> The test fails on the very last line, i.e. ComponentDestroyed for the
> interceptor is never being called. Is it a bug or am I missing something?
>
> Regards,
> Vladimir Okhotnikov
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/castle-project-users/-/bsZpi7xyNf0J.
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.