1 #region Copyright notice and license
2 // Copyright 2015 gRPC authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 #endregion
16 
17 #if GRPC_SUPPORT_WATCH
18 using System;
19 using System.Threading;
20 using System.Threading.Tasks;
21 
22 using Grpc.Core;
23 
24 namespace Grpc.HealthCheck.Tests
25 {
26     internal class TestServerCallContext : ServerCallContext
27     {
28         private readonly CancellationToken _cancellationToken;
29 
TestServerCallContext(CancellationToken cancellationToken)30         public TestServerCallContext(CancellationToken cancellationToken)
31         {
32             _cancellationToken = cancellationToken;
33         }
34 
35         protected override string MethodCore { get; }
36         protected override string HostCore { get; }
37         protected override string PeerCore { get; }
38         protected override DateTime DeadlineCore { get; }
39         protected override Metadata RequestHeadersCore { get; }
40         protected override CancellationToken CancellationTokenCore => _cancellationToken;
41         protected override Metadata ResponseTrailersCore { get; }
42         protected override Status StatusCore { get; set; }
43         protected override WriteOptions WriteOptionsCore { get; set; }
44         protected override AuthContext AuthContextCore { get; }
45 
CreatePropagationTokenCore(ContextPropagationOptions options)46         protected override ContextPropagationToken CreatePropagationTokenCore(ContextPropagationOptions options)
47         {
48             throw new NotImplementedException();
49         }
50 
WriteResponseHeadersAsyncCore(Metadata responseHeaders)51         protected override Task WriteResponseHeadersAsyncCore(Metadata responseHeaders)
52         {
53             throw new NotImplementedException();
54         }
55     }
56 }
57 #endif
58