Merge pull request #1410 from alesliehughes/master
[mono.git] / mcs / class / System.Runtime.Serialization / Test / System.Runtime.Serialization / XmlObjectSerializerTest.cs
index 9500cfee151300bb1020e79f8a0f14b996c71446..0fc956d862074bef6efc18df22ce0de563bbe21e 100755 (executable)
@@ -814,6 +814,34 @@ namespace MonoTests.System.Runtime.Serialization
                        Assert.AreEqual (4, el.SelectNodes ("a:int", nsmgr).Count, "#4");
                }
 
+               [Test]
+               public void SerializeArrayOfAnyTypeGuid ()
+               {
+                       DataContractSerializer ser = new DataContractSerializer (typeof(object[]));
+                       StringWriter sw = new StringWriter ();
+                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
+                               ser.WriteObject (w, new object[] { Guid.Empty });
+                       }
+
+                       XmlComparer.AssertAreEqual (
+                               "<ArrayOfanyType xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\"><anyType xmlns:d2p1=\"http://schemas.microsoft.com/2003/10/Serialization/\" i:type=\"d2p1:guid\">00000000-0000-0000-0000-000000000000</anyType></ArrayOfanyType>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeArrayOfAnyTypeChar ()
+               {
+                       DataContractSerializer ser = new DataContractSerializer (typeof(object[]));
+                       StringWriter sw = new StringWriter ();
+                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
+                               ser.WriteObject (w, new object[] { new char () });
+                       }
+
+                       XmlComparer.AssertAreEqual (
+                               "<ArrayOfanyType xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\"><anyType xmlns:d2p1=\"http://schemas.microsoft.com/2003/10/Serialization/\" i:type=\"d2p1:char\">0</anyType></ArrayOfanyType>",
+                               sw.ToString ());
+               }
+
                [Test]
                public void DeserializeEnum ()
                {