public void TestDataContractWithPropertyHavingSameQName() { // DataContract2 has a property of DataContract3. DataContract2 and // DataContract3 both have the same QName specified in their // respective DataContractAttribute. This was causing a failure due // to the QName being saved in the SerializationMap twice. Bug 4794. var serializer2 = new DataContractSerializer(typeof(DataContract2)); var d = new DataContract2(); var ms = new MemoryStream(2048); Assert.IsNotNull(serializer2, "Failed to create the serializer for DataContract2"); serializer2.WriteObject(ms, d); ms.Position = 0; var d2 = serializer2.ReadObject(ms) as DataContract2; Assert.IsNotNull(d2, "Failed to deserialize the data buffer into a DataContract2"); }
public void TestDataContractWithPropertyHavingSameQName () { // DataContract2 has a property of DataContract3. DataContract2 and // DataContract3 both have the same QName specified in their // respective DataContractAttribute. This was causing a failure due // to the QName being saved in the SerializationMap twice. Bug 4794. var serializer2 = new DataContractSerializer (typeof(DataContract2)); var d = new DataContract2 (); var ms = new MemoryStream (2048); Assert.IsNotNull (serializer2, "Failed to create the serializer for DataContract2"); serializer2.WriteObject (ms, d); ms.Position = 0; var d2 = serializer2.ReadObject (ms) as DataContract2; Assert.IsNotNull (d2, "Failed to deserialize the data buffer into a DataContract2"); }