public void WillApplyChannelFactoryAwareExtensionsOnModel()
{
using (var localContainer = new WindsorContainer()
.AddFacility<WcfFacility>(f => f.CloseTimeout = TimeSpan.Zero)
.Register(
Component.For<IOperations>()
.AsWcfClient(new DefaultClientModel()
{
Endpoint = WcfEndpoint
.BoundTo(new NetTcpBinding { PortSharingEnabled = true })
.At("net.tcp://localhost/Operations")
}.AddExtensions(new ChannelFactoryListener()))
))
{
var client = localContainer.Resolve<IOperations>();
Assert.IsTrue(ChannelFactoryListener.CreatedCalled);
Assert.IsTrue(ChannelFactoryListener.OpeningCalled);
Assert.IsTrue(ChannelFactoryListener.OpenedCalled);
client.GetValueFromConstructor();
Assert.IsFalse(ChannelFactoryListener.ClosingCalled);
Assert.IsFalse(ChannelFactoryListener.ClosedCalled);
}
Assert.IsTrue(ChannelFactoryListener.ClosingCalled);
Assert.IsTrue(ChannelFactoryListener.ClosedCalled);
}