Exemple #1
0
        public NativeGrpcServerCallTest(SomeObject payload)
        {
            _server = new TestServer(new WebHostBuilder().UseStartup <Startup>());
            _client = _server.CreateClient();

            _request = new StubHttpRequest(
                _client,
                "/TestServiceNative/PingPong",
                MessageSerializer.Create(DomainExtensions.CopyToProto(payload)));
        }
Exemple #2
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);
        }
Exemple #3
0
        public NativeGrpcCombinedCallTest(SomeObject payload)
        {
            _payload = DomainExtensions.CopyToProto(payload);
            _server  = new TestServer(new WebHostBuilder().UseStartup <Startup>());
            _client  = _server.CreateClient();

            _channel = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions {
                HttpClient = _client
            });

            _proxy = new TestServiceNative.TestServiceNativeClient(_channel);
        }
Exemple #4
0
        public ServiceModelGrpcProtoServerCallTest(SomeObject payload)
        {
            var builder = new WebHostBuilder().UseStartup <Startup>();

            _server = new TestServer(builder);
            _client = _server.CreateClient();

            var proto = DomainExtensions.CopyToProto(payload);

            _request = new StubHttpRequest(
                _client,
                "/ITestService/PingPongProto",
                MessageSerializer.Create(GoogleProtoMarshallerFactory.Default, new Message <SomeObjectProto>(proto)));
        }
Exemple #5
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);
        }
Exemple #6
0
        public ServiceModelGrpcProtoCombinedCallTest(SomeObject payload)
        {
            _payload = DomainExtensions.CopyToProto(payload);

            var builder = new WebHostBuilder().UseStartup <Startup>();

            _server = new TestServer(builder);
            _client = _server.CreateClient();

            _channel = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions {
                HttpClient = _client
            });
            _clientFactory = new ClientFactory(new ServiceModelGrpcClientOptions {
                MarshallerFactory = GoogleProtoMarshallerFactory.Default
            });
            _proxy = _clientFactory.CreateClient <ITestService>(_channel);
        }