fixup tests

pull/6641/head
Jan Tattermusch 9 years ago
parent 18ef23ee39
commit a41c58c26d
  1. 20
      src/csharp/Grpc.Core.Tests/Internal/AsyncCallTest.cs

@ -212,7 +212,23 @@ namespace Grpc.Core.Internal.Tests
AssertUnaryResponseSuccess(asyncCall, fakeCall, resultTask); AssertUnaryResponseSuccess(asyncCall, fakeCall, resultTask);
var ex = Assert.Throws<RpcException>(() => requestStream.WriteAsync("request1")); var ex = Assert.Throws<RpcException>(() => requestStream.WriteAsync("request1"));
//TODO: add assert. Assert.AreEqual(Status.DefaultSuccess, ex.Status);
}
[Test]
public void ClientStreaming_WriteAfterReceivingStatusThrowsRpcException2()
{
var resultTask = asyncCall.ClientStreamingCallAsync();
var requestStream = new ClientRequestStream<string, string>(asyncCall);
fakeCall.UnaryResponseClientHandler(true,
new ClientSideStatus(new Status(StatusCode.OutOfRange, ""), new Metadata()),
CreateResponsePayload(),
new Metadata());
AssertUnaryResponseError(asyncCall, fakeCall, resultTask, StatusCode.OutOfRange);
var ex = Assert.Throws<RpcException>(() => requestStream.WriteAsync("request1"));
Assert.AreEqual(StatusCode.OutOfRange, ex.Status.StatusCode);
} }
[Test] [Test]
@ -375,7 +391,7 @@ namespace Grpc.Core.Internal.Tests
AssertStreamingResponseSuccess(asyncCall, fakeCall, readTask); AssertStreamingResponseSuccess(asyncCall, fakeCall, readTask);
var ex = Assert.ThrowsAsync<RpcException>(async () => await requestStream.WriteAsync("request1")); var ex = Assert.ThrowsAsync<RpcException>(async () => await requestStream.WriteAsync("request1"));
//TODO: add assert. Assert.AreEqual(Status.DefaultSuccess, ex.Status);
} }
[Test] [Test]

Loading…
Cancel
Save