예제 #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);
        }