add MathService.Fib test with deadline

pull/2643/head
Jan Tattermusch 10 years ago
parent f7cfc8a7b8
commit 4106259c79
  1. 21
      src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs

@ -165,6 +165,27 @@ namespace math.Tests
}).Wait();
}
[Test]
public void FibWithDeadline()
{
Task.Run(async () =>
{
using (var call = client.Fib(new FibArgs.Builder { Limit = 0 }.Build(),
deadline: DateTime.UtcNow.AddMilliseconds(500)))
{
try
{
await call.ResponseStream.ToList();
Assert.Fail();
}
catch (RpcException e)
{
Assert.AreEqual(StatusCode.DeadlineExceeded, e.Status.StatusCode);
}
}
}).Wait();
}
// TODO: test Fib with limit=0 and cancellation
[Test]
public void Sum()

Loading…
Cancel
Save