Author: atsushi
Date: 2007-09-25 13:56:10 -0400 (Tue, 25 Sep 2007)
New Revision: 86350

Modified:
   trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog
   
trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs
Log:
2007-09-25  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * XmlSerializerTests.cs : another XmlSchemaProvider test; use it
          as a member of an array.



Modified: trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog  
2007-09-25 17:50:50 UTC (rev 86349)
+++ trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog  
2007-09-25 17:56:10 UTC (rev 86350)
@@ -1,5 +1,10 @@
 2007-09-25  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * XmlSerializerTests.cs : another XmlSchemaProvider test; use it
+         as a member of an array.
+
+2007-09-25  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * XmlSerializerTests.cs : added deserialization test for
          XmlSchemaProviderAttribute use.
        * XmlReflectionImporterTests.cs : added test for conclict resolution

Modified: 
trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs
===================================================================
--- 
trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs  
    2007-09-25 17:50:50 UTC (rev 86349)
+++ 
trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs  
    2007-09-25 17:56:10 UTC (rev 86350)
@@ -2671,6 +2671,16 @@
                        Assert.AreEqual (Infoset ("<foo />"), WriterText);
                        xs.Deserialize (new StringReader ("<foo/>"));
                }
+
+               [Test]
+               public void XmlSchemaProviderQNameBecomesRootName2 ()
+               {
+                       string xml = 
"<XmlSchemaProviderQNameBecomesRootNameType2 
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"; 
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\";><Foo><foo 
/></Foo></XmlSchemaProviderQNameBecomesRootNameType2>";
+                       xs = new XmlSerializer (typeof 
(XmlSchemaProviderQNameBecomesRootNameType2));
+                       Serialize (new 
XmlSchemaProviderQNameBecomesRootNameType2 ());
+                       Assert.AreEqual (Infoset (xml), WriterText);
+                       xs.Deserialize (new StringReader (xml));
+               }
 #endif
 
                #endregion //GenericsSeralizationTests
@@ -2780,6 +2790,7 @@
 
                        public void ReadXml (XmlReader reader)
                        {
+                               reader.Skip ();
                        }
 
                        public void WriteXml (XmlWriter writer)
@@ -2788,14 +2799,22 @@
 
                        public static XmlQualifiedName GetXsdType (XmlSchemaSet 
xss)
                        {
-                               XmlSchema xs = new XmlSchema ();
-                               XmlSchemaComplexType ct = new 
XmlSchemaComplexType ();
-                               ct.Name = "foo";
-                               xs.Items.Add (ct);
-                               xss.Add (xs);
+                               if (xss.Count == 0) {
+                                       XmlSchema xs = new XmlSchema ();
+                                       XmlSchemaComplexType ct = new 
XmlSchemaComplexType ();
+                                       ct.Name = "foo";
+                                       xs.Items.Add (ct);
+                                       xss.Add (xs);
+                               }
                                return new XmlQualifiedName ("foo");
                        }
                }
+
+               public class XmlSchemaProviderQNameBecomesRootNameType2
+               {
+                       [XmlArrayItem (typeof 
(XmlSchemaProviderQNameBecomesRootNameType))]
+                       public object [] Foo = new object [] {new 
XmlSchemaProviderQNameBecomesRootNameType ()};
+               }
 #endif
 
                void CDataTextNodes_BadNode (object s, XmlNodeEventArgs e)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to