// // DO NOT EDIT. // swift-format-ignore-file // // Generated by the protocol buffer compiler. // Source: test.proto // import GRPC import NIO import SwiftProtobuf internal final class Codegentest_FooTestClient: Codegentest_FooClientProtocol { private let fakeChannel: FakeChannel internal var defaultCallOptions: CallOptions internal var interceptors: Codegentest_FooClientInterceptorFactoryProtocol? internal var channel: GRPCChannel { return self.fakeChannel } internal init( fakeChannel: FakeChannel = FakeChannel(), defaultCallOptions callOptions: CallOptions = CallOptions(), interceptors: Codegentest_FooClientInterceptorFactoryProtocol? = nil ) { self.fakeChannel = fakeChannel self.defaultCallOptions = callOptions self.interceptors = interceptors } /// Make a unary response for the Bar RPC. This must be called /// before calling 'bar'. See also 'FakeUnaryResponse'. /// /// - Parameter requestHandler: a handler for request parts sent by the RPC. internal func makeBarResponseStream( _ requestHandler: @escaping (FakeRequestPart) -> () = { _ in } ) -> FakeUnaryResponse { return self.fakeChannel.makeFakeUnaryResponse(path: "/codegentest.Foo/Bar", requestHandler: requestHandler) } internal func enqueueBarResponse( _ response: Codegentest_BarResponse, _ requestHandler: @escaping (FakeRequestPart) -> () = { _ in } ) { let stream = self.makeBarResponseStream(requestHandler) // This is the only operation on the stream; try! is fine. try! stream.sendMessage(response) } /// Returns true if there are response streams enqueued for 'Bar' internal var hasBarResponsesRemaining: Bool { return self.fakeChannel.hasFakeResponseEnqueued(forPath: "/codegentest.Foo/Bar") } }