Пример #1
0
        public MagicOnionClientCallTest(SomeObject payload)
        {
            _payload     = payload;
            _httpHandler = new StubHttpMessageHandler(MessagePackMarshallerFactory.Default, payload);
            _channel     = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions {
                HttpHandler = _httpHandler
            });

            _proxy = MagicOnion.Client.MagicOnionClient.Create <ITestServiceMagicOnion>(_channel);
        }
Пример #2
0
        public ProtobufGrpcClientCallTest(SomeObject payload)
        {
            _payload     = payload;
            _httpHandler = new StubHttpMessageHandler(ProtobufMarshallerFactory.Default, _payload);
            _channel     = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions {
                HttpHandler = _httpHandler
            });

            _proxy = _channel.CreateGrpcService <ITestService>();
        }
Пример #3
0
        public NativeGrpcClientCallTest(SomeObject payload)
        {
            _payload = DomainExtensions.CopyToProto(payload);

            _httpHandler = new StubHttpMessageHandler(_payload);
            _channel     = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions {
                HttpHandler = _httpHandler
            });

            _proxy = new TestServiceNative.TestServiceNativeClient(_channel);
        }
Пример #4
0
        public ServiceModelGrpcProtoClientCallTest(SomeObject payload)
        {
            _payload     = DomainExtensions.CopyToProto(payload);
            _httpHandler = new StubHttpMessageHandler(GoogleProtoMarshallerFactory.Default, new Message <SomeObjectProto>(_payload));
            _channel     = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions {
                HttpHandler = _httpHandler
            });

            var clientFactory = new ClientFactory(new ServiceModelGrpcClientOptions {
                MarshallerFactory = GoogleProtoMarshallerFactory.Default
            });

            _proxy = clientFactory.CreateClient <ITestService>(_channel);
        }
Пример #5
0
        public ServiceModelGrpcClientCallTest(IMarshallerFactory marshallerFactory, SomeObject payload)
        {
            _payload     = payload;
            _httpHandler = new StubHttpMessageHandler(marshallerFactory, new Message <SomeObject>(payload));
            _channel     = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions {
                HttpHandler = _httpHandler
            });

            var clientFactory = new ClientFactory(new ServiceModelGrpcClientOptions {
                MarshallerFactory = marshallerFactory
            });

            _proxy = clientFactory.CreateClient <ITestService>(_channel);
        }