aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core.Tests/CallOptionsTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.Core.Tests/CallOptionsTest.cs')
-rw-r--r--src/csharp/Grpc.Core.Tests/CallOptionsTest.cs16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/csharp/Grpc.Core.Tests/CallOptionsTest.cs b/src/csharp/Grpc.Core.Tests/CallOptionsTest.cs
index a3a613be74..99a2d47e6e 100644
--- a/src/csharp/Grpc.Core.Tests/CallOptionsTest.cs
+++ b/src/csharp/Grpc.Core.Tests/CallOptionsTest.cs
@@ -54,10 +54,20 @@ namespace Grpc.Core.Tests
var deadline = DateTime.UtcNow;
Assert.AreEqual(deadline, options.WithDeadline(deadline).Deadline.Value);
- var token = new CancellationTokenSource().Token;
- Assert.AreEqual(token, options.WithCancellationToken(token).CancellationToken);
+ var cancellationToken = new CancellationTokenSource().Token;
+ Assert.AreEqual(cancellationToken, options.WithCancellationToken(cancellationToken).CancellationToken);
+
+ var writeOptions = new WriteOptions();
+ Assert.AreSame(writeOptions, options.WithWriteOptions(writeOptions).WriteOptions);
+
+ var propagationToken = new ContextPropagationToken(CallSafeHandle.NullInstance, DateTime.UtcNow,
+ CancellationToken.None, ContextPropagationOptions.Default);
+ Assert.AreSame(propagationToken, options.WithPropagationToken(propagationToken).PropagationToken);
+
+ var credentials = new FakeCallCredentials();
+ Assert.AreSame(credentials, options.WithCredentials(credentials).Credentials);
- // Change original instance is unchanged.
+ // Check that the original instance is unchanged.
Assert.IsNull(options.Headers);
Assert.IsNull(options.Deadline);
Assert.AreEqual(CancellationToken.None, options.CancellationToken);