TestServerCallContext.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #if GRPC_SUPPORT_WATCH
  17. using System;
  18. using System.Threading;
  19. using System.Threading.Tasks;
  20. using Grpc.Core;
  21. namespace Grpc.HealthCheck.Tests
  22. {
  23. internal class TestServerCallContext : ServerCallContext
  24. {
  25. private readonly CancellationToken _cancellationToken;
  26. public TestServerCallContext(CancellationToken cancellationToken)
  27. {
  28. _cancellationToken = cancellationToken;
  29. }
  30. protected override string MethodCore { get; }
  31. protected override string HostCore { get; }
  32. protected override string PeerCore { get; }
  33. protected override DateTime DeadlineCore { get; }
  34. protected override Metadata RequestHeadersCore { get; }
  35. protected override CancellationToken CancellationTokenCore => _cancellationToken;
  36. protected override Metadata ResponseTrailersCore { get; }
  37. protected override Status StatusCore { get; set; }
  38. protected override WriteOptions WriteOptionsCore { get; set; }
  39. protected override AuthContext AuthContextCore { get; }
  40. protected override ContextPropagationToken CreatePropagationTokenCore(ContextPropagationOptions options)
  41. {
  42. throw new NotImplementedException();
  43. }
  44. protected override Task WriteResponseHeadersAsyncCore(Metadata responseHeaders)
  45. {
  46. throw new NotImplementedException();
  47. }
  48. }
  49. }
  50. #endif