From 00c144a8d219345519fa1ecccca3f7137a86b7d6 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Thu, 10 Dec 2015 20:04:01 -0800 Subject: [PATCH] increase coverage of ServerCallContext --- src/csharp/Grpc.Core.Tests/ClientServerTest.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs index e3df143fc9..e324471120 100644 --- a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs @@ -262,7 +262,7 @@ namespace Grpc.Core.Tests } [Test] - public void PeerInfoPresent() + public void ServerCallContext_PeerInfoPresent() { helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) => { @@ -273,6 +273,18 @@ namespace Grpc.Core.Tests Assert.IsTrue(peer.Contains(Host)); } + [Test] + public void ServerCallContext_HostAndMethodPresent() + { + helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) => + { + Assert.IsTrue(context.Host.Contains(Host)); + Assert.AreEqual("/tests.Test/Unary", context.Method); + return "PASS"; + }); + Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); + } + [Test] public async Task Channel_WaitForStateChangedAsync() { -- GitLab