Ejemplo n.º 1
0
        private T Deserialize <T>(string data, SerializerType serializerType)
        {
            switch (serializerType)
            {
            case SerializerType.DataContractJsonSerializer:
                return(SerializationFactory.DataContractJsonDeserialize <T>(data));

            case SerializerType.DataContractSerializer:
                return(SerializationFactory.DataContractDeSerialize <T>(data));

            case SerializerType.JsonNetSerializer:
                return(SerializationFactory.JsonNetDeserialize <T>(data));

            case SerializerType.XmlSerializer:
                return(SerializationFactory.XmlDeserialize <T>(data));
            }
            Assert.Fail("The serializer type {0} being tested is not supported in the test, add the respective test cases.", serializerType);
            return(default(T));
        }