public void Deserialize_SerializationRepresentation_DeserializedObject()
        {
            var subject = new DataContractDeserializer();
            var deserialized = subject.Deserialize<Serializable>(Serializable.DataContractString("s", 3m));

                Assert.That(deserialized.D, Is.EqualTo(3m));
                Assert.That(deserialized.S, Is.EqualTo("s"));
        }
Beispiel #2
0
        public void Deserialize_SerializationRepresentation_DeserializedObject()
        {
            var subject      = new DataContractDeserializer();
            var deserialized = subject.Deserialize <Serializable>(Serializable.DataContractString("s", 3m));

            Assert.That(deserialized.D, Is.EqualTo(3m));
            Assert.That(deserialized.S, Is.EqualTo("s"));
        }
Beispiel #3
0
        public void Deserialize_InvalidSerializationRepresentation_Extepcion()
        {
            var subject = new DataContractDeserializer();

            Assert.That(() => subject.Deserialize <Serializable>("invalid"), Throws.InstanceOf <SerializationException>());
        }
        public void Deserialize_InvalidSerializationRepresentation_Extepcion()
        {
            var subject = new DataContractDeserializer();

            Assert.That(() => subject.Deserialize<Serializable>("invalid"), Throws.InstanceOf<SerializationException>());
        }