Example #1
0
 public void WaitForStateChangedAsync_InvalidArgument()
 {
     using (var channel = new Channel("localhost", Credentials.Insecure))
     {
         Assert.Throws(typeof(ArgumentException), () => channel.WaitForStateChangedAsync(ChannelState.FatalFailure));
     }
 }
Example #2
0
 public void WaitForStateChangedAsync_InvalidArgument()
 {
     var channel = new Channel("localhost", ChannelCredentials.Insecure);
     Assert.ThrowsAsync(typeof(ArgumentException), async () => await channel.WaitForStateChangedAsync(ChannelState.FatalFailure));
     channel.ShutdownAsync().Wait();
 }
 public async Task OperationsThrowAfterShutdown()
 {
     var channel = new Channel("localhost", ChannelCredentials.Insecure);
     await channel.ShutdownAsync();
     Assert.ThrowsAsync(typeof(ObjectDisposedException), async () => await channel.WaitForStateChangedAsync(ChannelState.Idle));
     Assert.Throws(typeof(ObjectDisposedException), () => { var x = channel.ResolvedTarget; });
     Assert.ThrowsAsync(typeof(TaskCanceledException), async () => await channel.ConnectAsync());
 }
 public async Task ShutdownFinishesWaitForStateChangedAsync()
 {
     var channel = new Channel("localhost", ChannelCredentials.Insecure);
     var stateChangedTask = channel.WaitForStateChangedAsync(ChannelState.Idle);
     var shutdownTask = channel.ShutdownAsync();
     await stateChangedTask;
     await shutdownTask;
 }