Castle.Facilities.WcfIntegration.Tests.WcfClientFixture.CanCallChannelOperationsAsynchronouslyOnAsyncService C# (CSharp) Method

CanCallChannelOperationsAsynchronouslyOnAsyncService() private method

		public void CanCallChannelOperationsAsynchronouslyOnAsyncService()
		{
			using (var localContainer = new WindsorContainer()
								.AddFacility<WcfFacility>(f => f.CloseTimeout = TimeSpan.Zero)
				.Register(
					Component.For<IAsyncOperations>()
						.ImplementedBy<AsyncOperations>()
						.DependsOn(new { number = 22 })
						.AsWcfService(new DefaultServiceModel().AddEndpoints(
							WcfEndpoint.BoundTo(new NetNamedPipeBinding(NetNamedPipeSecurityMode.None))
								.At("net.pipe://localhost/Operations")
								)
						),
					Component.For<IOperations>()
						.Named("operations")
						.AsWcfClient(new DefaultClientModel()
						{
							Endpoint = WcfEndpoint
								.BoundTo(new NetNamedPipeBinding(NetNamedPipeSecurityMode.None))
								.At("net.pipe://localhost/Operations")
						})
					))
			{
				var client = localContainer.Resolve<IOperations>("operations");
				var result = client.BeginWcfCall(p => p.GetValueFromConstructor(),
					(IAsyncResult ar) => Assert.AreEqual(22, client.EndWcfCall<int>(ar)), null);
				Assert.True(result.AsyncWaitHandle.WaitOne(5000));
			}
		}
WcfClientFixture