Merge pull request #1213 from fengari/system_timers_timer_opt
[mono.git] / mcs / class / System.XML / Test / System.Xml.Serialization / XmlSerializerTestClasses.cs
index f3626055bea9b8b54fbfd2fe0a2f73ef2a317928..62b3698c8370b86be8543b05441ba6af55b8237f 100644 (file)
@@ -432,6 +432,7 @@ namespace MonoTests.System.Xml.TestClasses
        public class ReadOnlyProperties
        {
                string[] strArr = new string[2] { "string1", "string2" };
+               List<string> strList = new List<string> { "listString1" };
 
                public string[] StrArr
                {
@@ -442,8 +443,21 @@ namespace MonoTests.System.Xml.TestClasses
                {
                        get { return "fff"; }
                }
+
+               public IList<string> StrList { get { return strList; } }
+       }
+
+       [Serializable]
+       public class ReadOnlyListProperty {
+               List<string> strList = new List<string> { "listString1", "listString2" };
+
+               public List<string> StrList
+               {
+                       get { return strList; }
+               }
        }
 
+
        [XmlRoot ("root")]
        public class ListDefaults
        {
@@ -959,5 +973,149 @@ namespace MonoTests.System.Xml.TestClasses
                {
                }
        }
+
+       public class Bug704813Type
+       {
+               IEnumerable<string> foo = new List<string> ();
+               public IEnumerable<string> Foo {
+                       get { return foo; }
+               }
+       }
+
+       public class Bug708178Type
+       {
+               List<string> foo = new List<string> ();
+
+               [XmlArray("Foo"), XmlArrayItem("Foo", typeof(string))]
+               public List<string> Foo {
+                       get { return foo; }
+               }                
+       }
+
+       [XmlRoot("root")]
+       public class ExplicitlyOrderedMembersType1
+       {
+               [XmlElement("child0", Order = 4)]
+               public string Child0;
+
+               [XmlElement("child", Order = 0)]
+               public string Child1;
+
+               [XmlElement("child", Order = 2)]
+               public string Child2;
+       }
+
+       [XmlRoot("root")]
+       public class ExplicitlyOrderedMembersType2
+       {
+               [XmlElement("child0", Order = 4)]
+               public string Child0;
+
+               [XmlElement("child")] // wrong. Needs to be Ordered as well.
+               public string Child1;
+
+               [XmlElement("child", Order = 2)]
+               public string Child2;
+       }
+
+       [XmlRoot("root")]
+       public class ExplicitlyOrderedMembersType3
+       {
+               [XmlElement("child0", Order = 1)] // it's between 0 and 2. After two "child" elements, child0 is not recognized as this member.
+               public string Child0;
+
+               [XmlElement("child", Order = 0)]
+               public string Child1;
+
+               [XmlElement("child", Order = 2)]
+               public string Child2;
+       }
+
+       [XmlRoot("root")]
+       public class ExplicitlyOrderedMembersType4
+       {
+               [XmlElement("child0", Order = 1)] // it's between 0 and 2. After two "child" elements, child0 is not recognized as this member.
+               public string Child0;
+               
+               [XmlElement("child", Order = 0)]
+               public string Child1;
+               
+               [XmlElement("child", Order = 2)]
+               public string Child2;
+               
+               [XmlAttribute]
+               public string Child3;
+       }
+
+       [XmlRoot ("root")]
+       public class NullableDatesAndTimes {
+               [XmlElementAttribute ("MyTime", DataType = "time", IsNullable = false)]
+               public DateTime MyTime;
+                       
+               [XmlElementAttribute ("MyTimeNullable", DataType = "time", IsNullable = true)]
+               public DateTime? MyTimeNullable;
+               
+               [XmlElementAttribute ("MyDate", DataType = "date", IsNullable = false)]
+               public DateTime MyDate;
+               
+               [XmlElementAttribute ("MyDateNullable", DataType = "date", IsNullable = true)]
+               public DateTime? MyDateNullable;
+       }
+
+       public class NotExactDateParseClass
+       {
+               [XmlElementAttribute (DataType = "date")]
+               public DateTime SomeDate;
+       }
+
+       public class Bug8468BaseClass
+       {
+               public string Base;
+       }
+
+       public class Bug8468MidClass: Bug8468BaseClass
+       {
+               public string Mid;
+       }
+
+       [XmlRoot("Test", Namespace="http://test-namespace")]
+       public class Bug8468Subclass: Bug8468MidClass
+       {
+       }
+
+       [XmlRoot("Test")]
+       public class Bug8468SubclassNoNamespace: Bug8468MidClass
+       {
+       }
+
+       [XmlRoot("Test", Namespace="")]
+       public class Bug8468BaseClassV2
+       {
+               public string Base;
+       }
+
+       public class Bug8468MidClassV2: Bug8468BaseClassV2
+       {
+               public string Mid;
+       }
+
+       [XmlRoot("Test", Namespace="http://test-namespace")]
+       public class Bug8468SubclassV2: Bug8468MidClassV2
+       {
+       }
+
+       [XmlRoot("Test")]
+       public class Bug8468SubclassNoNamespaceV2: Bug8468MidClassV2
+       {
+       }
+       
+       [XmlRoot("Test")]
+       public class Bug9193Class
+       {
+               [XmlElement ("Data", Order=0)]
+               public string[] Data;
+               [XmlElement ("Extra", Order=1)]
+               public string[] Extra;
+       }
 }