|
|
|
@ -185,6 +185,9 @@ namespace Grpc.IntegrationTesting |
|
|
|
|
case "unimplemented_service": |
|
|
|
|
RunUnimplementedService(new UnimplementedService.UnimplementedServiceClient(channel)); |
|
|
|
|
break; |
|
|
|
|
case "special_status_message": |
|
|
|
|
await RunSpecialStatusMessageAsync(client); |
|
|
|
|
break; |
|
|
|
|
case "unimplemented_method": |
|
|
|
|
RunUnimplementedMethod(client); |
|
|
|
|
break; |
|
|
|
@ -567,6 +570,33 @@ namespace Grpc.IntegrationTesting |
|
|
|
|
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) |
|
|
|
|
{ |
|
|
|
|
Console.WriteLine("running unimplemented_service"); |
|
|
|
|