|
|
|
@ -335,6 +335,22 @@ namespace Grpc.Core.Tests |
|
|
|
|
Assert.AreEqual(StatusCode.Unimplemented, ex.Status.StatusCode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void StatusDetailIsUtf8() |
|
|
|
|
{ |
|
|
|
|
// some japanese and chinese characters |
|
|
|
|
var nonAsciiString = "\u30a1\u30a2\u30a3 \u62b5\u6297\u662f\u5f92\u52b3\u7684"; |
|
|
|
|
helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) => |
|
|
|
|
{ |
|
|
|
|
context.Status = new Status(StatusCode.Unknown, nonAsciiString); |
|
|
|
|
return ""; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); |
|
|
|
|
Assert.AreEqual(StatusCode.Unknown, ex.Status.StatusCode); |
|
|
|
|
Assert.AreEqual(nonAsciiString, ex.Status.Detail); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void ServerCallContext_PeerInfoPresent() |
|
|
|
|
{ |
|
|
|
|