add special_status_message testcase to C# interop client

pull/18448/head
Jan Tattermusch 6 years ago
parent 4686f6d518
commit 877f426d35
  1. 30
      src/csharp/Grpc.IntegrationTesting/InteropClient.cs

@ -185,6 +185,9 @@ namespace Grpc.IntegrationTesting
case "unimplemented_service": case "unimplemented_service":
RunUnimplementedService(new UnimplementedService.UnimplementedServiceClient(channel)); RunUnimplementedService(new UnimplementedService.UnimplementedServiceClient(channel));
break; break;
case "special_status_message":
await RunSpecialStatusMessageAsync(client);
break;
case "unimplemented_method": case "unimplemented_method":
RunUnimplementedMethod(client); RunUnimplementedMethod(client);
break; break;
@ -567,6 +570,33 @@ namespace Grpc.IntegrationTesting
Console.WriteLine("Passed!"); Console.WriteLine("Passed!");
} }
private static async Task RunSpecialStatusMessageAsync(TestService.TestServiceClient client)
{
Console.WriteLine("running special_status_message");
var echoStatus = new EchoStatus
{
Code = 2,
Message = "\t\ntest with whitespace\r\nand Unicode BMP ☺ and non-BMP 😈\t\n"
};
try
{
await client.UnaryCallAsync(new SimpleRequest
{
ResponseStatus = echoStatus
});
Assert.Fail();
}
catch (RpcException e)
{
Assert.AreEqual(StatusCode.Unknown, e.Status.StatusCode);
Assert.AreEqual(echoStatus.Message, e.Status.Detail);
}
Console.WriteLine("Passed!");
}
public static void RunUnimplementedService(UnimplementedService.UnimplementedServiceClient client) public static void RunUnimplementedService(UnimplementedService.UnimplementedServiceClient client)
{ {
Console.WriteLine("running unimplemented_service"); Console.WriteLine("running unimplemented_service");

Loading…
Cancel
Save