예제 #1
0
        public async Task Async_Client_NotSerializableParameters_EnsureBoltSerializationException()
        {
            var client = CreateChannel();
            Mock<ITestContract> server = Server();
            var arg = new NotSerializableType(10);

            server.Setup(v => v.MethodWithNotSerializableType(It.IsAny<NotSerializableType>()));

            try
            {
                await client.MethodWithNotSerializableTypeAsync(arg);
            }
            catch (BoltClientException e) when (e.Error == ClientErrorCode.SerializeParameters)
            {
                // ok
            }
        }
예제 #2
0
 public virtual Task MethodWithNotSerializableTypeAsync(NotSerializableType arg)
 {
     return this.SendAsync(__MethodWithNotSerializableTypeAction, arg);
 }
예제 #3
0
        public async Task Async_Client_NotSerializableReturnValue_EnsureBoltServerException()
        {
            var client = CreateChannel();
            Mock<ITestContract> server = Server();
            var arg = new NotSerializableType(10);

            server.Setup(v => v.FunctionWithNotSerializableType()).Returns(arg);

            try
            {
                await client.FunctionWithNotSerializableTypeAsync();
            }
            catch (BoltServerException e)
            {
                if (e.Error != ServerErrorCode.SerializeResponse)
                {
                    throw;
                }
            }
        }
예제 #4
0
 public virtual void MethodWithNotSerializableType(NotSerializableType arg)
 {
     this.Send(__MethodWithNotSerializableTypeAction, arg);
 }