aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.IntegrationTesting/InteropClient.cs
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2015-08-07 20:52:21 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2015-08-07 20:52:21 -0700
commitc8d7b8498c97694fcfc9d82d5aae64598697e7dd (patch)
tree0476bfbea21e4e3cd2f2e2bbf31ed9258822ab88 /src/csharp/Grpc.IntegrationTesting/InteropClient.cs
parent2615f39b208efec60619ee431e17acbf4d60a458 (diff)
polishing tests
Diffstat (limited to 'src/csharp/Grpc.IntegrationTesting/InteropClient.cs')
-rw-r--r--src/csharp/Grpc.IntegrationTesting/InteropClient.cs22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs
index 7411d91d5a..6802de489d 100644
--- a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs
+++ b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs
@@ -404,15 +404,8 @@ namespace Grpc.IntegrationTesting
await Task.Delay(1000);
cts.Cancel();
- try
- {
- var response = await call.ResponseAsync;
- Assert.Fail();
- }
- catch (RpcException e)
- {
- Assert.AreEqual(StatusCode.Cancelled, e.Status.StatusCode);
- }
+ var ex = Assert.Throws<RpcException>(async () => await call.ResponseAsync);
+ Assert.AreEqual(StatusCode.Cancelled, ex.Status.StatusCode);
}
Console.WriteLine("Passed!");
}
@@ -435,15 +428,8 @@ namespace Grpc.IntegrationTesting
cts.Cancel();
- try
- {
- await call.ResponseStream.MoveNext();
- Assert.Fail();
- }
- catch (RpcException e)
- {
- Assert.AreEqual(StatusCode.Cancelled, e.Status.StatusCode);
- }
+ var ex = Assert.Throws<RpcException>(async () => await call.ResponseStream.MoveNext());
+ Assert.AreEqual(StatusCode.Cancelled, ex.Status.StatusCode);
}
Console.WriteLine("Passed!");
}