Exemplo n.º 1
0
        static object Deserialize(MessageType messageType, byte[] data)
        {
            try
            {
                var contractType = ContractUtility.GetContractType(messageType);

                return(Deserialize(contractType, data));
            }
            catch
            {
                throw new Exception("InvalidProtocolBufferException");
            }
        }
Exemplo n.º 2
0
        public void SupportAllMessageTypes()
        {
            bool allSupported = true;

            foreach (var messageType in ((MessageType[])Enum.GetValues(typeof(MessageType))))
            {
                try
                {
                    ContractUtility.GetContractType(messageType);
                }
                catch (Exception ex)
                {
                    Log.Error(ex.ToString());
                    allSupported = false;
                }
                Assert.True(allSupported, "Not all message types supported.");
            }
        }