Exemple #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
            }
        }
 public virtual Task MethodWithNotSerializableTypeAsync(NotSerializableType arg)
 {
     return this.SendAsync(__MethodWithNotSerializableTypeAction, arg);
 }
Exemple #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;
                }
            }
        }
 public virtual void MethodWithNotSerializableType(NotSerializableType arg)
 {
     this.Send(__MethodWithNotSerializableTypeAction, arg);
 }