Exemple #1
0
        public async Task GreeterSayHelloTest()
        {
            var request = new Greet.HelloRequest
            {
                Name = "YIM",
            };

            using var channel = GrpcChannel.ForAddress(LocalHttpsHost);
            var client     = new Greet.Greeter.GreeterClient(channel);
            var helloReply = await client.SayHelloAsync(request);

            Assert.Equal("Hello " + request.Name, helloReply.Message);
        }
Exemple #2
0
        public async Task UnsafeGrpcTest()
        {
            //Given
            var request = new Greet.HelloRequest
            {
                Name = "YIM",
            };

            //When
            using var channel = GrpcChannel.ForAddress(LocalHttpHost);
            var client     = new Greet.Greeter.GreeterClient(channel);
            var helloReply = await client.SayHelloAsync(request);

            //Then
            Assert.Equal("Hello " + request.Name, helloReply.Message);
        }