Пример #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 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.ServerError != ServerErrorCode.SerializeResponse)
                {
                    throw;
                }
            }
        }