public void TestShutdown_TransportShutdownIsInitiated() { using (var environment = new InProcTestEnvironment()) using (var target = new RpcClient(_loopbackEndPoint, environment.Configuration, null)) { int isShutdownCompleted = 0; target.EnsureConnected(); target.Transport.ShutdownCompleted += (sender, e) => Interlocked.Exchange(ref isShutdownCompleted, 1); target.Shutdown(); Assert.That(target.Transport.IsClientShutdown); Assert.That(isShutdownCompleted, Is.EqualTo(1)); } }
public void TestShutdown_TransportShutdownIsInitiated() { using ( var environment = new InProcTestEnvironment() ) using ( var target = new RpcClient( _loopbackEndPoint, environment.Configuration, null ) ) { int isShutdownCompleted = 0; target.EnsureConnected(); target.Transport.ShutdownCompleted += ( sender, e ) => Interlocked.Exchange( ref isShutdownCompleted, 1 ); target.Shutdown(); Assert.That( target.Transport.IsClientShutdown ); Assert.That( isShutdownCompleted, Is.EqualTo( 1 ) ); } }