Esempio n. 1
0
        public async Task AsyncUnaryMethod_ServiceFailure()
        {
            var request = new ForwardingSourceMethod1Request {
                SourceName = "error"
            };
            var exception = await Assert.ThrowsAsync <RpcException>(async() => await _sourceClient.Method1Async(request));

            Assert.Equal(StatusCode.Internal, exception.StatusCode);
            Assert.Contains("Bang", exception.Message);
        }
Esempio n. 2
0
        public void BlockingUnaryMethod_ServiceFailure()
        {
            var request = new ForwardingSourceMethod1Request {
                SourceName = "error"
            };
            var exception = Assert.Throws <RpcException>(() => _sourceClient.Method1(request));

            Assert.Equal(StatusCode.Internal, exception.StatusCode);
            Assert.Contains("Bang", exception.Message);
        }
Esempio n. 3
0
 private ForwardingSourceMethod1Response ConvertResponse(ForwardingSourceMethod1Request request, ForwardingTargetMethod1Response response) =>
 new ForwardingSourceMethod1Response
 {
     SourceRequestName = request.SourceName,
     TargetResult      = $"yy:{response.TargetResult}"
 };
Esempio n. 4
0
 private ForwardingTargetMethod1Request ConvertRequest(ForwardingSourceMethod1Request request) =>
 new ForwardingTargetMethod1Request
 {
     TargetName = $"xx:{request.SourceName}"
 };