Ejemplo n.º 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);
        }
Ejemplo n.º 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>();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }