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

WillApplyCustomInterceptorsWhenCallingMethodsAsynchronously() private method

		public void WillApplyCustomInterceptorsWhenCallingMethodsAsynchronously()
		{
			windsorContainer.Register(
				Component.For<TraceInterceptor>(),
				Component.For<IOperations>()
					.Named("operations")
					.AsWcfClient(new DefaultClientModel()
					{
						Endpoint = WcfEndpoint
							.BoundTo(new NetTcpBinding { PortSharingEnabled = true })
							.At("net.tcp://localhost/Operations")
					})
					.Interceptors(InterceptorReference.ForType<TraceInterceptor>()).Anywhere
				);

			TraceInterceptor.Reset();
			Assert.IsNull(TraceInterceptor.MethodCalled);

			var client = windsorContainer.Resolve<IOperations>("operations");
			var call = client.BeginWcfCall(p => p.GetValueFromConstructor());
			Assert.AreEqual(42, call.End());
			Assert.AreEqual("GetValueFromConstructor", TraceInterceptor.MethodCalled.Name);
		}
WcfClientFixture