|
|
|
@ -154,5 +154,28 @@ namespace Grpc.Core.Tests |
|
|
|
|
await call.RequestStream.CompleteAsync(); |
|
|
|
|
Assert.AreEqual("PASS", await call); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void ForeignPropagationTokenInterpretedAsNull() |
|
|
|
|
{ |
|
|
|
|
Assert.IsNull(new ForeignContextPropagationToken().AsImplOrNull()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public async Task ForeignPropagationTokenIsIgnored() |
|
|
|
|
{ |
|
|
|
|
helper.UnaryHandler = new UnaryServerMethod<string, string>((request, context) => |
|
|
|
|
{ |
|
|
|
|
return Task.FromResult("PASS"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var callOptions = new CallOptions(propagationToken: new ForeignContextPropagationToken()); |
|
|
|
|
await Calls.AsyncUnaryCall(helper.CreateUnaryCall(callOptions), "xyz"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// For testing, represents context propagation token that's not generated by Grpc.Core |
|
|
|
|
private class ForeignContextPropagationToken : ContextPropagationToken |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|