diff --git a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs index d06c55040be..a12ed31e95d 100644 --- a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs @@ -150,12 +150,12 @@ namespace Grpc.Core.Tests var ex = Assert.Throws(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); Assert.AreEqual(StatusCode.Unauthenticated, ex.Status.StatusCode); - Assert.IsTrue(ex.Status.DebugErrorString.Contains("Error received from peer")); // a different debug error string set by grpc client + StringAssert.Contains("Error received from peer", ex.Status.DebugErrorString, "Is \"Error received from peer\" still a valid substring to search for in the client-generated error message from C-core?"); Assert.AreEqual(0, ex.Trailers.Count); var ex2 = Assert.ThrowsAsync(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc")); Assert.AreEqual(StatusCode.Unauthenticated, ex2.Status.StatusCode); - Assert.IsTrue(ex2.Status.DebugErrorString.Contains("Error received from peer")); // a different debug error string set by grpc client + StringAssert.Contains("Error received from peer", ex2.Status.DebugErrorString, "Is \"Error received from peer\" still a valid substring to search for in the client-generated error message from C-core?"); Assert.AreEqual(0, ex2.Trailers.Count); }