public void ThrowsRpcExceptionIfHandlerThrows()
        {
            TestRpcService.BindService(Server, mockService);
            TestRequest request       = new TestRequest();
            bool        handlerDidRun = false;

            mockService.TestCall(request, Arg.Any <ServerCallContext>()).Returns <TestResponse>(
                x =>
            {
                handlerDidRun = true;
                throw new InvalidOperationException();
            });
            Assert.Throws <RpcException>(() => client.TestCall(request));
            Assert.True(handlerDidRun);
        }
        public void TestCallSucceeds()
        {
            TestRpcService.BindService(Server, mockService);
            TestRequest request = new TestRequest()
            {
                Message = "hello"
            };

            mockService.TestCall(request, Arg.Any <ServerCallContext>()).Returns(
                new TestResponse {
                Message = "(internal)" + request.Message
            });

            TestResponse response = client.TestCall(request);

            Assert.That(response, Is.Not.Null);
            Assert.That(response.Message, Is.Not.Null);
            Assert.That(response.Message, Is.EqualTo("(internal)"));
        }