|
|
@ -124,6 +124,24 @@ namespace Grpc.Core.Internal.Tests |
|
|
|
Assert.IsTrue(fakeCall.IsDisposed); |
|
|
|
Assert.IsTrue(fakeCall.IsDisposed); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void SyncUnary_RequestSerializationExceptionDoesntLeakResources() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string nullRequest = null; // will throw when serializing |
|
|
|
|
|
|
|
Assert.Throws(typeof(ArgumentNullException), () => asyncCall.UnaryCall(nullRequest)); |
|
|
|
|
|
|
|
Assert.AreEqual(0, channel.GetCallReferenceCount()); |
|
|
|
|
|
|
|
Assert.IsTrue(fakeCall.IsDisposed); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void SyncUnary_StartCallFailureDoesntLeakResources() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
fakeCall.MakeStartCallFail(); |
|
|
|
|
|
|
|
Assert.Throws(typeof(InvalidOperationException), () => asyncCall.UnaryCall("request1")); |
|
|
|
|
|
|
|
Assert.AreEqual(0, channel.GetCallReferenceCount()); |
|
|
|
|
|
|
|
Assert.IsTrue(fakeCall.IsDisposed); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void ClientStreaming_StreamingReadNotAllowed() |
|
|
|
public void ClientStreaming_StreamingReadNotAllowed() |
|
|
|
{ |
|
|
|
{ |
|
|
|