Browse Source

2006-12-03 Hagit Yidov <[email protected]>

	* XmlSerializerTests.cs : added tests for serialization of generic types.
	* DeserializeTests.cs : added tests for deserialization of generic types.
	* XmlSerializerTestClasses.cs : added classes for tests which use generic types.

svn path=/trunk/mcs/; revision=68886
Yoni Klain 19 years ago
parent
commit
acef74c489

+ 6 - 0
mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog

@@ -1,3 +1,9 @@
+2006-12-03  Hagit Yidov  <[email protected]>
+
+	* XmlSerializerTests.cs : added tests for serialization of generic types.
+	* DeserializeTests.cs : added tests for deserialization of generic types.
+	* XmlSerializerTestClasses.cs : added classes for tests which use generic types.
+
 2006-12-01  Atsushi Enomoto  <[email protected]>
 
 	* XmlSerializerTests.cs : added tests for XmlArrayAttribute support.

File diff suppressed because it is too large
+ 452 - 184
mcs/class/System.XML/Test/System.Xml.Serialization/DeserializeTests.cs


+ 318 - 202
mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTestClasses.cs

@@ -1,10 +1,12 @@
 //
 // System.Xml.XmlSerializerTestClasses
 //
-// Author:
+// Authors:
 //   Erik LeBel <[email protected]>
+//   Hagit Yidov <[email protected]>
 //
 // (C) 2003 Erik LeBel
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
 //
 // Classes to use in the testing of the XmlSerializer
 //
@@ -15,6 +17,7 @@ using System.Collections;
 using System.Xml;
 using System.Xml.Schema;
 using System.Xml.Serialization;
+using System.Collections.Generic;
 
 namespace MonoTests.System.Xml.TestClasses
 {
@@ -25,7 +28,8 @@ namespace MonoTests.System.Xml.TestClasses
 	public enum EnumDefaultValueNF { e1 = 1, e2 = 2, e3 = 3 }
 
 	[Flags]
-	public enum FlagEnum { 
+	public enum FlagEnum
+	{
 		[XmlEnum ("one")]
 		e1 = 1,
 		[XmlEnum ("two")]
@@ -47,7 +51,8 @@ namespace MonoTests.System.Xml.TestClasses
 	}
 
 	[Flags]
-	public enum ZeroFlagEnum {
+	public enum ZeroFlagEnum
+	{
 		[XmlEnum ("zero")]
 		e0 = 0,
 		[XmlEnum ("o<n>e")]
@@ -58,7 +63,90 @@ namespace MonoTests.System.Xml.TestClasses
 		[XmlIgnore]
 		e4 = 4
 	}
-	
+
+	#region GenericsTestClasses
+
+	public class GenSimpleClass<T>
+	{
+		public T something = default (T);
+	}
+
+	public struct GenSimpleStruct<T>
+	{
+		public T something;
+		public GenSimpleStruct (int dummy)
+		{
+			something = default (T);
+		}
+	}
+
+	public class GenListClass<T>
+	{
+		public List<T> somelist = new List<T> ();
+	}
+
+	public class GenArrayClass<T>
+	{
+		public T[] arr = new T[3];
+	}
+
+	public class GenTwoClass<T1, T2>
+	{
+		public T1 something1 = default (T1);
+		public T2 something2 = default (T2);
+	}
+
+	public class GenDerivedClass<T1, T2> : GenTwoClass<string, int>
+	{
+		public T1 another1 = default (T1);
+		public T2 another2 = default (T2);
+	}
+
+	public class GenDerived2Class<T1, T2> : GenTwoClass<T1, T2>
+	{
+		public T1 another1 = default (T1);
+		public T2 another2 = default (T2);
+	}
+
+	public class GenNestedClass<TO, TI>
+	{
+		public TO outer = default (TO);
+		public class InnerClass<T>
+		{
+			public TI inner = default (TI);
+			public T something = default (T);
+		}
+	}
+
+	public struct GenComplexStruct<T1, T2>
+	{
+		public T1 something;
+		public GenSimpleClass<T1> simpleclass;
+		public GenSimpleStruct<T1> simplestruct;
+		public GenListClass<T1> listclass;
+		public GenArrayClass<T1> arrayclass;
+		public GenTwoClass<T1, T2> twoclass;
+		public GenDerivedClass<T1, T2> derivedclass;
+		public GenDerived2Class<T1, T2> derived2;
+		public GenNestedClass<T1, T2> nestedouter;
+		public GenNestedClass<T1, T2>.InnerClass<T1> nestedinner;
+		public GenComplexStruct (int dummy)
+		{
+			something = default (T1);
+			simpleclass = new GenSimpleClass<T1> ();
+			simplestruct = new GenSimpleStruct<T1> ();
+			listclass = new GenListClass<T1> ();
+			arrayclass = new GenArrayClass<T1> ();
+			twoclass = new GenTwoClass<T1, T2> ();
+			derivedclass = new GenDerivedClass<T1, T2> ();
+			derived2 = new GenDerived2Class<T1, T2> ();
+			nestedouter = new GenNestedClass<T1, T2> ();
+			nestedinner = new GenNestedClass<T1, T2>.InnerClass<T1> ();
+		}
+	}
+
+	#endregion // GenericsTestClasses
+
 	public class SimpleClass
 	{
 		public string something = null;
@@ -66,28 +154,28 @@ namespace MonoTests.System.Xml.TestClasses
 
 	public class StringCollection : CollectionBase
 	{
-		public void Add (String parameter) 
+		public void Add (String parameter)
 		{
 			List.Insert (Count, parameter);
 		}
-			
-		public String this [int index]
+
+		public String this[int index]
 		{
 			get
-			{ 
+			{
 				if (index < 0 || index > Count)
 					throw new ArgumentOutOfRangeException ();
-					
-				return (String) List [index]; 
+
+				return (String) List[index];
 			}
-			set { List [index] = value; }
+			set { List[index] = value; }
 		}
 	}
-	
+
 	public class StringCollectionContainer
 	{
-		StringCollection messages = new StringCollection();
-		
+		StringCollection messages = new StringCollection ();
+
 		public StringCollection Messages
 		{
 			get { return messages; }
@@ -96,22 +184,22 @@ namespace MonoTests.System.Xml.TestClasses
 
 	public class ArrayContainer
 	{
-		public object [] items = null;
+		public object[] items = null;
 	}
-	
+
 	public class ClassArrayContainer
 	{
-		public SimpleClass [] items = null;
+		public SimpleClass[] items = null;
 	}
-	
-	[XmlRoot("simple")]
+
+	[XmlRoot ("simple")]
 	public class SimpleClassWithXmlAttributes
 	{
-		[XmlAttribute("member")]
+		[XmlAttribute ("member")]
 		public string something = null;
 	}
-	
-	[XmlRoot("field")]
+
+	[XmlRoot ("field")]
 	public class Field
 	{
 		[XmlAttribute ("flag1")]
@@ -129,17 +217,17 @@ namespace MonoTests.System.Xml.TestClasses
 		[XmlAttribute ("flag4")]
 		public FlagEnum Flags4;
 
-		[XmlAttribute("modifiers")]
+		[XmlAttribute ("modifiers")]
 		public MapModifiers Modifiers;
 
-		[XmlAttribute ("modifiers2", Form=XmlSchemaForm.Unqualified)]
+		[XmlAttribute ("modifiers2", Form = XmlSchemaForm.Unqualified)]
 		public MapModifiers Modifiers2;
 
 		[XmlAttribute ("modifiers3")]
 		[DefaultValue (0)]
 		public MapModifiers Modifiers3;
 
-		[XmlAttribute ("modifiers4", Form=XmlSchemaForm.Unqualified)]
+		[XmlAttribute ("modifiers4", Form = XmlSchemaForm.Unqualified)]
 		[DefaultValue (MapModifiers.Protected)]
 		public MapModifiers Modifiers4;
 
@@ -199,89 +287,94 @@ namespace MonoTests.System.Xml.TestClasses
 	[Flags]
 	public enum MapModifiers
 	{
-		[XmlEnum("public")]
+		[XmlEnum ("public")]
 		[SoapEnum ("PuBlIc")]
 		Public = 0,
-		[XmlEnum("protected")]
+		[XmlEnum ("protected")]
 		Protected = 1,
 	}
 
 	public class MyList : ArrayList
 	{
 		object container;
-		
+
 		// NOTE: MyList has no public constructor
-		public MyList (object container) : base()
+		public MyList (object container)
+			: base ()
 		{
 			this.container = container;
 		}
 	}
-	
+
 	public class Container
 	{
 		public MyList Items;
-		
-		public Container () {
-			Items = new MyList(this);
+
+		public Container ()
+		{
+			Items = new MyList (this);
 		}
 	}
-	
+
 	public class Container2
 	{
 		public MyList Items;
-		
-		public Container2 () {
+
+		public Container2 ()
+		{
 		}
-		
-		public Container2 (bool b) {
-			Items = new MyList(this);
+
+		public Container2 (bool b)
+		{
+			Items = new MyList (this);
 		}
 	}
 
-	public class MyElem: XmlElement
+	public class MyElem : XmlElement
 	{
-		public MyElem (XmlDocument doc): base ("","myelem","", doc)
+		public MyElem (XmlDocument doc)
+			: base ("", "myelem", "", doc)
 		{
-			SetAttribute ("aa","1");
+			SetAttribute ("aa", "1");
 		}
 
 		[XmlAttribute]
-		public int kk=1;
+		public int kk = 1;
 	}
 
-	public class MyDocument: XmlDocument
+	public class MyDocument : XmlDocument
 	{
 		public MyDocument ()
 		{
 		}
 
 		[XmlAttribute]
-		public int kk=1;
+		public int kk = 1;
 	}
-	
+
 	public class CDataContainer
 	{
 		public XmlCDataSection cdata;
 	}
-	
+
 	public class NodeContainer
 	{
 		public XmlNode node;
 	}
-	
+
 	public class Choices
 	{
-		[XmlElementAttribute("ChoiceZero", typeof(string), IsNullable=false)]
-		[XmlElementAttribute("ChoiceOne", typeof(string), IsNullable=false)]
-		[XmlElementAttribute("ChoiceTwo", typeof(string), IsNullable=false)]
-		[XmlChoiceIdentifier("ItemType")]
+		[XmlElementAttribute ("ChoiceZero", typeof (string), IsNullable = false)]
+		[XmlElementAttribute ("ChoiceOne", typeof (string), IsNullable = false)]
+		[XmlElementAttribute ("ChoiceTwo", typeof (string), IsNullable = false)]
+		[XmlChoiceIdentifier ("ItemType")]
 		public string MyChoice;
 
 		[XmlIgnore]
 		public ItemChoiceType ItemType;
 	}
-	
-	[XmlType(IncludeInSchema = false)]
+
+	[XmlType (IncludeInSchema = false)]
 	public enum ItemChoiceType
 	{
 		ChoiceZero,
@@ -289,43 +382,46 @@ namespace MonoTests.System.Xml.TestClasses
 		StrangeOne,
 		ChoiceTwo,
 	}
-	
+
 	public class WrongChoices
 	{
-		[XmlElementAttribute("ChoiceZero", typeof(string), IsNullable=false)]
-		[XmlElementAttribute("StrangeOne", typeof(string), IsNullable=false)]
-		[XmlElementAttribute("ChoiceTwo", typeof(string), IsNullable=false)]
-		[XmlChoiceIdentifier("ItemType")]
+		[XmlElementAttribute ("ChoiceZero", typeof (string), IsNullable = false)]
+		[XmlElementAttribute ("StrangeOne", typeof (string), IsNullable = false)]
+		[XmlElementAttribute ("ChoiceTwo", typeof (string), IsNullable = false)]
+		[XmlChoiceIdentifier ("ItemType")]
 		public string MyChoice;
 
 		[XmlIgnore]
 		public ItemChoiceType ItemType;
 	}
-	
+
 	[XmlType ("Type with space")]
 	public class TestSpace
 	{
-	   [XmlElement (ElementName = "Element with space")]
-	   public int elem;
-	    
-	   [XmlAttribute (AttributeName = "Attribute with space")]
-	   public int attr; 
+		[XmlElement (ElementName = "Element with space")]
+		public int elem;
+
+		[XmlAttribute (AttributeName = "Attribute with space")]
+		public int attr;
 	}
 
 	[Serializable]
-	public class ReadOnlyProperties {
+	public class ReadOnlyProperties
+	{
 		string[] strArr = new string[2] { "string1", "string2" };
 
-		public string[] StrArr {
+		public string[] StrArr
+		{
 			get { return strArr; }
 		}
-		
-		public string dat {
+
+		public string dat
+		{
 			get { return "fff"; }
-		} 
+		}
 	}
-	
-	[XmlRoot("root")]
+
+	[XmlRoot ("root")]
 	public class ListDefaults
 	{
 		public ListDefaults ()
@@ -333,73 +429,74 @@ namespace MonoTests.System.Xml.TestClasses
 			ed = new SimpleClass ();
 			str = "hola";
 		}
-		
-	    public ArrayList list2;
-	    
-	    public MyList list3;
-	    
-	    public string[] list4;
-	    
-		[XmlElement("e", typeof(SimpleClass))]
-	    public ArrayList list5;
-	    
+
+		public ArrayList list2;
+
+		public MyList list3;
+
+		public string[] list4;
+
+		[XmlElement ("e", typeof (SimpleClass))]
+		public ArrayList list5;
+
 		[DefaultValue (null)]
-	    public SimpleClass ed;
-	    
+		public SimpleClass ed;
+
 		[DefaultValue (null)]
-	    public string str; 
+		public string str;
 	}
-	
+
 	public class clsPerson
 	{
 		public IList EmailAccounts;
 	}
-	
+
 	public class ArrayClass
 	{
-		public object names = new object[] { "un","dos" };
+		public object names = new object[] { "un", "dos" };
 	}
-	
+
 	public class CompositeValueType
 	{
 		public void Init ()
 		{
-	   		Items = new object[] { 1, 2 };
-	   		ItemsElementName = new ItemsChoiceType[] { ItemsChoiceType.In, ItemsChoiceType.Es };
+			Items = new object[] { 1, 2 };
+			ItemsElementName = new ItemsChoiceType[] { ItemsChoiceType.In, ItemsChoiceType.Es };
 		}
-	   
-		[XmlElementAttribute("Es", typeof(int))]
-		[XmlElementAttribute("In", typeof(int))]
-		[XmlChoiceIdentifierAttribute("ItemsElementName")]
+
+		[XmlElementAttribute ("Es", typeof (int))]
+		[XmlElementAttribute ("In", typeof (int))]
+		[XmlChoiceIdentifierAttribute ("ItemsElementName")]
 		public object[] Items;
-	   
-		[XmlElementAttribute("ItemsElementName")]
-		[XmlIgnoreAttribute()]
+
+		[XmlElementAttribute ("ItemsElementName")]
+		[XmlIgnoreAttribute ()]
 		public ItemsChoiceType[] ItemsElementName;
 	}
 
-	public enum ItemsChoiceType {
-	   In, Es
+	public enum ItemsChoiceType
+	{
+		In, Es
 	}
-	
+
 	public class ArrayAttributeWithType
 	{
-		[XmlAttribute (DataType="anyURI")]
-		public string[] at = new string [] { "a","b" };
+		[XmlAttribute (DataType = "anyURI")]
+		public string[] at = new string[] { "a", "b" };
 
-		[XmlAttribute (DataType="base64Binary")]
-		public byte[][] bin1 = new byte[][] { new byte[]{1,2},  new byte[]{1,2}};
-		
-		[XmlAttribute (DataType="base64Binary")]
-		public byte[] bin2 = new byte[] { 1,2 };
+		[XmlAttribute (DataType = "base64Binary")]
+		public byte[][] bin1 = new byte[][] { new byte[] { 1, 2 }, new byte[] { 1, 2 } };
+
+		[XmlAttribute (DataType = "base64Binary")]
+		public byte[] bin2 = new byte[] { 1, 2 };
 	}
-	
+
 	public class ArrayAttributeWithWrongType
 	{
-		[XmlAttribute (DataType="int")]
-		public string[] at = new string [] { "a","b" };
+		[XmlAttribute (DataType = "int")]
+		public string[] at = new string[] { "a", "b" };
 	}
-	
+
 	[XmlType ("Container")]
 	public class EntityContainer
 	{
@@ -407,78 +504,88 @@ namespace MonoTests.System.Xml.TestClasses
 		EntityCollection collection2;
 		EntityCollection collection3 = new EntityCollection ("root");
 		EntityCollection collection4 = new EntityCollection ("root");
-		
-		[XmlArray (IsNullable=true)]
-		public EntityCollection Collection1 {
+
+		[XmlArray (IsNullable = true)]
+		public EntityCollection Collection1
+		{
 			get { return collection1; }
 			set { collection1 = value; collection1.Container = "assigned"; }
 		}
-		
-		[XmlArray (IsNullable=false)]
-		public EntityCollection Collection2 {
+
+		[XmlArray (IsNullable = false)]
+		public EntityCollection Collection2
+		{
 			get { return collection2; }
 			set { collection2 = value; collection2.Container = "assigned"; }
 		}
-		
-		[XmlArray (IsNullable=true)]
-		public EntityCollection Collection3 {
+
+		[XmlArray (IsNullable = true)]
+		public EntityCollection Collection3
+		{
 			get { return collection3; }
 			set { collection3 = value; collection3.Container = "assigned"; }
 		}
-		
-		[XmlArray (IsNullable=false)]
-		public EntityCollection Collection4 {
+
+		[XmlArray (IsNullable = false)]
+		public EntityCollection Collection4
+		{
 			get { return collection4; }
 			set { collection4 = value; collection4.Container = "assigned"; }
 		}
 	}
-	
+
 	[XmlType ("Container")]
 	public class ArrayEntityContainer
 	{
 		Entity[] collection1;
 		Entity[] collection2;
-		Entity[] collection3 = new Entity [0];
-		Entity[] collection4 = new Entity [0];
-		
-		[XmlArray (IsNullable=true)]
-		public Entity[] Collection1 {
+		Entity[] collection3 = new Entity[0];
+		Entity[] collection4 = new Entity[0];
+
+		[XmlArray (IsNullable = true)]
+		public Entity[] Collection1
+		{
 			get { return collection1; }
 			set { collection1 = value; }
 		}
-		
-		[XmlArray (IsNullable=false)]
-		public Entity[] Collection2 {
+
+		[XmlArray (IsNullable = false)]
+		public Entity[] Collection2
+		{
 			get { return collection2; }
 			set { collection2 = value; }
 		}
-		
-		[XmlArray (IsNullable=true)]
-		public Entity[] Collection3 {
+
+		[XmlArray (IsNullable = true)]
+		public Entity[] Collection3
+		{
 			get { return collection3; }
 			set { collection3 = value; }
 		}
-		
-		[XmlArray (IsNullable=false)]
-		public Entity[] Collection4 {
+
+		[XmlArray (IsNullable = false)]
+		public Entity[] Collection4
+		{
 			get { return collection4; }
 			set { collection4 = value; }
 		}
 	}
-	
+
 	public class Entity
 	{
 		private string _name = string.Empty;
 		private string _parent = null;
 
 		[XmlAttribute]
-		public string Name {
+		public string Name
+		{
 			get { return _name; }
 			set { _name = value; }
 		}
 
-		[XmlIgnore] 
-		public string Parent {
+		[XmlIgnore]
+		public string Parent
+		{
 			get { return _parent; }
 			set { _parent = value; }
 		}
@@ -497,17 +604,18 @@ namespace MonoTests.System.Xml.TestClasses
 			_container = c;
 		}
 
-		public string Container {
+		public string Container
+		{
 			get { return _container; }
 			set { _container = value; }
 		}
 
 		public int Add (Entity value)
 		{
-			if(_container != null)
+			if (_container != null)
 				value.Parent = _container;
 
-			return base.Add(value);
+			return base.Add (value);
 		}
 
 		public new Entity this[int index]
@@ -516,60 +624,64 @@ namespace MonoTests.System.Xml.TestClasses
 			set { base[index] = value; }
 		}
 	}
-	
+
 	[XmlType ("Container")]
 	public class ObjectWithReadonlyCollection
 	{
 		EntityCollection collection1 = new EntityCollection ("root");
-		
-		public EntityCollection Collection1 {
+
+		public EntityCollection Collection1
+		{
 			get { return collection1; }
 		}
 	}
-	
+
 	[XmlType ("Container")]
 	public class ObjectWithReadonlyNulCollection
 	{
 		EntityCollection collection1;
-		
-		public EntityCollection Collection1 {
+
+		public EntityCollection Collection1
+		{
 			get { return collection1; }
 		}
 	}
-	
+
 	[XmlType ("Container")]
 	public class ObjectWithReadonlyArray
 	{
-		Entity[] collection1 = new Entity [0];
-		
-		public Entity[] Collection1 {
+		Entity[] collection1 = new Entity[0];
+
+		public Entity[] Collection1
+		{
 			get { return collection1; }
 		}
 	}
-	
-	[XmlInclude (typeof(SubclassTestSub))]
+
+	[XmlInclude (typeof (SubclassTestSub))]
 	public class SubclassTestBase
 	{
 	}
-	
-	public class SubclassTestSub: SubclassTestBase
+
+	public class SubclassTestSub : SubclassTestBase
 	{
 	}
-	
+
 	public class SubclassTestExtra
 	{
 	}
-	
+
 	public class SubclassTestContainer
 	{
-		[XmlElement ("a", typeof(SubclassTestBase))]
-		[XmlElement ("b", typeof(SubclassTestExtra))]
+		[XmlElement ("a", typeof (SubclassTestBase))]
+		[XmlElement ("b", typeof (SubclassTestExtra))]
 		public object data;
 	}
 
 	public class DictionaryWithIndexer : DictionaryBase
 	{
-		public TimeSpan this[int index] {
+		public TimeSpan this[int index]
+		{
 			get { return TimeSpan.MinValue; }
 		}
 
@@ -578,8 +690,8 @@ namespace MonoTests.System.Xml.TestClasses
 		}
 	}
 
-	[XmlRoot(Namespace="some:urn")]
-	[SoapTypeAttribute (Namespace="another:urn")]
+	[XmlRoot (Namespace = "some:urn")]
+	[SoapTypeAttribute (Namespace = "another:urn")]
 	public class PrimitiveTypesContainer
 	{
 		public PrimitiveTypesContainer ()
@@ -597,49 +709,51 @@ namespace MonoTests.System.Xml.TestClasses
 		public byte[] Password;
 		public char PathSeparatorCharacter;
 	}
-	
+
 	public class TestSchemaForm1
 	{
 		public PrintTypeResponse p1;
-		
-		[XmlElement(Namespace="urn:oo")]
+
+		[XmlElement (Namespace = "urn:oo")]
 		public PrintTypeResponse p2;
 	}
 
-	[XmlType (Namespace="urn:testForm")]
+	[XmlType (Namespace = "urn:testForm")]
 	public class TestSchemaForm2
 	{
 		public PrintTypeResponse p1;
-		
-		[XmlElement(Namespace="urn:oo")]
+
+		[XmlElement (Namespace = "urn:oo")]
 		public PrintTypeResponse p2;
 	}
 
-	[XmlType (Namespace="urn:responseTypes")]
-	public class PrintTypeResponse {
-		[XmlElement (Form=XmlSchemaForm.Unqualified, IsNullable=true)]
-	    public OutputType result;
-	    public PrintTypeResponse intern;
-	    
-	    public void Init ()
-	    {
-	    	result = new OutputType ();
-	    	result.data = "data1";
-	    	intern = new PrintTypeResponse ();
-	    	intern.result = new OutputType ();
-	    	intern.result.data = "data2";
-	    }
+	[XmlType (Namespace = "urn:responseTypes")]
+	public class PrintTypeResponse
+	{
+		[XmlElement (Form = XmlSchemaForm.Unqualified, IsNullable = true)]
+		public OutputType result;
+		public PrintTypeResponse intern;
+
+		public void Init ()
+		{
+			result = new OutputType ();
+			result.data = "data1";
+			intern = new PrintTypeResponse ();
+			intern.result = new OutputType ();
+			intern.result.data = "data2";
+		}
 	}
 
-	[XmlType (Namespace="urn:responseTypes")]
-	public class OutputType {
-	    
-		[XmlElement (Form=XmlSchemaForm.Unqualified, IsNullable=true)]
-	    public string data;
+	[XmlType (Namespace = "urn:responseTypes")]
+	public class OutputType
+	{
+
+		[XmlElement (Form = XmlSchemaForm.Unqualified, IsNullable = true)]
+		public string data;
 	}
 
-	[XmlRootAttribute ("testDefault", Namespace="urn:myNS", IsNullable=false)]
-	[SoapType("testDefault", Namespace="urn:myNS")]
+	[XmlRootAttribute ("testDefault", Namespace = "urn:myNS", IsNullable = false)]
+	[SoapType ("testDefault", Namespace = "urn:myNS")]
 	public class TestDefault
 	{
 		public string str;
@@ -663,8 +777,8 @@ namespace MonoTests.System.Xml.TestClasses
 		public FlagEnum_Encoded flagencoded = (FlagEnum_Encoded.e1 | FlagEnum_Encoded.e4);
 	}
 
-	[XmlType ("optionalValueType", Namespace="some:urn")]
-	[XmlRootAttribute ("optionalValue", Namespace="another:urn", IsNullable=false)]
+	[XmlType ("optionalValueType", Namespace = "some:urn")]
+	[XmlRootAttribute ("optionalValue", Namespace = "another:urn", IsNullable = false)]
 	public class OptionalValueTypeContainer
 	{
 		[DefaultValue (FlagEnum.e1 | FlagEnum.e4)]
@@ -682,7 +796,8 @@ namespace MonoTests.System.Xml.TestClasses
 
 		[XmlIgnore]
 		[SoapIgnore]
-		public bool IsEmptySpecified {
+		public bool IsEmptySpecified
+		{
 			get { return _isEmptySpecified; }
 			set { _isEmptySpecified = value; }
 		}
@@ -699,7 +814,7 @@ namespace MonoTests.System.Xml.TestClasses
 		public string GroupName;
 
 		[SoapAttribute (DataType = "base64Binary")]
-		public Byte [] GroupNumber;
+		public Byte[] GroupNumber;
 
 		[SoapAttribute (DataType = "date", AttributeName = "CreationDate")]
 		public DateTime Today;
@@ -719,10 +834,11 @@ namespace MonoTests.System.Xml.TestClasses
 		{
 			Vehicle v;
 			if (licNumber == string.Empty) {
-				v = new Car();
+				v = new Car ();
 				v.licenseNumber = "!!!!!!";
-			} else {
-				v = new Car();
+			}
+			else {
+				v = new Car ();
 				v.licenseNumber = licNumber;
 			}
 			return v;
@@ -739,7 +855,7 @@ namespace MonoTests.System.Xml.TestClasses
 		public string weight;
 	}
 
-	public class Car: Vehicle
+	public class Car : Vehicle
 	{
 	}
 

+ 402 - 60
mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs

@@ -3,8 +3,10 @@
 //
 // Author:
 //   Erik LeBel <[email protected]>
+//   Hagit Yidov <[email protected]>
 //
 // (C) 2003 Erik LeBel
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
 //
 //
 // NOTES:
@@ -61,8 +63,10 @@ namespace MonoTests.System.XmlSerialization
 			xtw.Formatting = Formatting.None;
 		}
 
-		private string WriterText {
-			get {
+		private string WriterText
+		{
+			get
+			{
 				string val = sw.GetStringBuilder ().ToString ();
 				int offset = val.IndexOf ('>') + 1;
 				val = val.Substring (offset);
@@ -220,7 +224,7 @@ namespace MonoTests.System.XmlSerialization
 		[Test]
 		public void TestSerializeIntArray ()
 		{
-			Serialize (new int [] { 1, 2, 3, 4 });
+			Serialize (new int[] { 1, 2, 3, 4 });
 			Assert.AreEqual (Infoset (string.Format (CultureInfo.InvariantCulture,
 				"<ArrayOfInt xmlns:xsd='{0}' xmlns:xsi='{1}'><int>1</int><int>2</int><int>3</int><int>4</int></ArrayOfInt>",
 				XmlSchema.Namespace, XmlSchema.InstanceNamespace)), WriterText);
@@ -229,7 +233,7 @@ namespace MonoTests.System.XmlSerialization
 		[Test]
 		public void TestSerializeEmptyArray ()
 		{
-			Serialize (new int [] { });
+			Serialize (new int[] { });
 			Assert.AreEqual (Infoset (string.Format (CultureInfo.InvariantCulture,
 				"<ArrayOfInt xmlns:xsd='{0}' xmlns:xsi='{1}' />",
 				XmlSchema.Namespace, XmlSchema.InstanceNamespace)), WriterText);
@@ -496,7 +500,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize ("b", typeof (EnumDefaultValue));
 				Assert.Fail ("#A1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#A2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#A3");
 			}
@@ -504,7 +509,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize ("e1", typeof (EnumDefaultValue));
 				Assert.Fail ("#B1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#B2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#B3");
 			}
@@ -512,7 +518,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize ("e1,e2", typeof (EnumDefaultValue));
 				Assert.Fail ("#C1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#C2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#C3");
 			}
@@ -520,7 +527,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize (string.Empty, typeof (EnumDefaultValue));
 				Assert.Fail ("#D1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#D2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#D3");
 			}
@@ -528,7 +536,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize ("1", typeof (EnumDefaultValue));
 				Assert.Fail ("#E1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#E2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#E3");
 			}
@@ -536,7 +545,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize ("0", typeof (EnumDefaultValue));
 				Assert.Fail ("#F1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#F2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#F3");
 			}
@@ -544,7 +554,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize (new SimpleClass (), typeof (EnumDefaultValue));
 				Assert.Fail ("#G1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#G2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#G3");
 			}
@@ -619,7 +630,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize ("b", typeof (EnumDefaultValueNF));
 				Assert.Fail ("#A1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#A2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#A3");
 			}
@@ -627,7 +639,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize ("e2", typeof (EnumDefaultValueNF));
 				Assert.Fail ("#B1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#B2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#B3");
 			}
@@ -635,7 +648,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize (string.Empty, typeof (EnumDefaultValueNF));
 				Assert.Fail ("#C1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#C2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#C3");
 			}
@@ -643,7 +657,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize ("1", typeof (EnumDefaultValueNF));
 				Assert.Fail ("#D1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#D2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#D3");
 			}
@@ -651,7 +666,8 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize ("0", typeof (EnumDefaultValueNF));
 				Assert.Fail ("#E1");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				Assert.IsNotNull (ex.InnerException, "#E2");
 				Assert.AreEqual (typeof (InvalidCastException), ex.InnerException.GetType (), "#E3");
 			}
@@ -705,7 +721,7 @@ namespace MonoTests.System.XmlSerialization
 			f.Modifiers3 = MapModifiers.Public;
 			f.Modifiers4 = MapModifiers.Protected;
 			f.Modifiers5 = MapModifiers.Public;
-			f.Names = new string [] { "a", "b" };
+			f.Names = new string[] { "a", "b" };
 			Serialize (f, typeof (Field));
 			Assert.AreEqual (Infoset (string.Format (CultureInfo.InvariantCulture,
 				"<field xmlns:xsd='{0}' xmlns:xsi='{1}' flag1='one two' flag2='two'" +
@@ -761,11 +777,11 @@ namespace MonoTests.System.XmlSerialization
 				" flag2='' flag3='' flag4='' modifiers='PuBlIc'" +
 				" modifiers2='PuBlIc' modifiers4='PuBlIc' xmlns:q1='some:urn' />",
 #else
-				"<q1:field xmlns:xsd='{0}' xmlns:xsi='{1}' id='id1' flag1=''" +
+ "<q1:field xmlns:xsd='{0}' xmlns:xsi='{1}' id='id1' flag1=''" +
 				" flag2='' flag3='' flag4='' modifiers='PuBlIc'" +
 				" modifiers2='PuBlIc' modifiers4='PuBlIc' xmlns:q1='some:urn' />",
 #endif
-				XmlSchema.Namespace, XmlSchema.InstanceNamespace),
+ XmlSchema.Namespace, XmlSchema.InstanceNamespace),
 				sw.GetStringBuilder ().ToString (), "#A");
 
 			f.Flags1 = FlagEnum_Encoded.e1;
@@ -784,11 +800,11 @@ namespace MonoTests.System.XmlSerialization
 				" flag4='' modifiers='Protected' modifiers2='PuBlIc'" +
 				" xmlns:q1='some:urn' />",
 #else
-				"<q1:field xmlns:xsd='{0}' xmlns:xsi='{1}' id='id1' flag3='two'" +
+ "<q1:field xmlns:xsd='{0}' xmlns:xsi='{1}' id='id1' flag3='two'" +
 				" flag4='' modifiers='Protected' modifiers2='PuBlIc'" +
 				" xmlns:q1='some:urn' />",
 #endif
-				XmlSchema.Namespace, XmlSchema.InstanceNamespace),
+ XmlSchema.Namespace, XmlSchema.InstanceNamespace),
 				sw.GetStringBuilder ().ToString (), "#B");
 
 			f.Flags1 = FlagEnum_Encoded.e2;
@@ -808,12 +824,12 @@ namespace MonoTests.System.XmlSerialization
 				" modifiers3='Protected' modifiers4='PuBlIc' modifiers5='Protected'" +
 				" xmlns:q1='some:urn' />",
 #else
-				"<q1:field xmlns:xsd='{0}' xmlns:xsi='{1}' id='id1' flag1='two'" +
+ "<q1:field xmlns:xsd='{0}' xmlns:xsi='{1}' id='id1' flag1='two'" +
 				" flag2='two' flag4='' modifiers='PuBlIc' modifiers2='Protected'" +
 				" modifiers3='Protected' modifiers4='PuBlIc' modifiers5='Protected'" +
 				" xmlns:q1='some:urn' />",
 #endif
- 				XmlSchema.Namespace, XmlSchema.InstanceNamespace),
+ XmlSchema.Namespace, XmlSchema.InstanceNamespace),
 				sw.GetStringBuilder ().ToString (), "#C");
 
 			f.Flags1 = (FlagEnum_Encoded) 1;
@@ -861,7 +877,7 @@ namespace MonoTests.System.XmlSerialization
 			Group myGroup = new Group ();
 			myGroup.GroupName = ".NET";
 
-			Byte [] hexByte = new Byte [] { 0x64, 0x32 };
+			Byte[] hexByte = new Byte[] { 0x64, 0x32 };
 			myGroup.GroupNumber = hexByte;
 
 			DateTime myDate = new DateTime (2002, 5, 2);
@@ -962,10 +978,10 @@ namespace MonoTests.System.XmlSerialization
 		[Test]
 		public void TestSerializeByteArrays ()
 		{
-			Serialize (new byte [] { });
+			Serialize (new byte[] { });
 			Assert.AreEqual (Infoset ("<base64Binary />"), WriterText);
 
-			Serialize (new byte [] { 0xAB, 0xCD });
+			Serialize (new byte[] { 0xAB, 0xCD });
 			Assert.AreEqual (Infoset ("<base64Binary>q80=</base64Binary>"), WriterText);
 		}
 
@@ -1035,9 +1051,9 @@ namespace MonoTests.System.XmlSerialization
 #if NET_2_0
 				"<optionalValue xmlns:xsi='{1}' xmlns:xsd='{0}' xmlns='{2}' />",
 #else
-				"<optionalValue xmlns:xsd='{0}' xmlns:xsi='{1}' xmlns='{2}' />",
+ "<optionalValue xmlns:xsd='{0}' xmlns:xsi='{1}' xmlns='{2}' />",
 #endif
-				XmlSchema.Namespace, XmlSchema.InstanceNamespace, AnotherNamespace),
+ XmlSchema.Namespace, XmlSchema.InstanceNamespace, AnotherNamespace),
 				sw.ToString (), "#1");
 
 			attr = new XmlAttributes ();
@@ -1053,9 +1069,9 @@ namespace MonoTests.System.XmlSerialization
 #if NET_2_0
 				"<optionalValue xmlns:xsi='{1}' xmlns:xsd='{0}' xmlns='{2}'>" +
 #else
-				"<optionalValue xmlns:xsd='{0}' xmlns:xsi='{1}' xmlns='{2}'>" +
+ "<optionalValue xmlns:xsd='{0}' xmlns:xsi='{1}' xmlns='{2}'>" +
 #endif
-				"<Attributes xmlns='{3}'>one four</Attributes>" +
+ "<Attributes xmlns='{3}'>one four</Attributes>" +
 				"</optionalValue>", XmlSchema.Namespace, XmlSchema.InstanceNamespace,
 				AnotherNamespace, ANamespace), sw.ToString (), "#2");
 
@@ -1066,9 +1082,9 @@ namespace MonoTests.System.XmlSerialization
 #if NET_2_0
 				"<optionalValue xmlns:xsi='{1}' xmlns:xsd='{0}' xmlns='{2}'>" +
 #else
-				"<optionalValue xmlns:xsd='{0}' xmlns:xsi='{1}' xmlns='{2}'>" +
+ "<optionalValue xmlns:xsd='{0}' xmlns:xsi='{1}' xmlns='{2}'>" +
 #endif
-				"<Attributes xmlns='{3}'>one four</Attributes>" +
+ "<Attributes xmlns='{3}'>one four</Attributes>" +
 				"<Flags xmlns='{3}'>one</Flags>" +
 				"</optionalValue>",
 				XmlSchema.Namespace, XmlSchema.InstanceNamespace, AnotherNamespace,
@@ -1095,11 +1111,11 @@ namespace MonoTests.System.XmlSerialization
 			Serialize (container);
 			Assert.AreEqual (Infoset ("<ArrayContainer xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' />"), WriterText);
 
-			container.items = new object [] { 10, 20 };
+			container.items = new object[] { 10, 20 };
 			Serialize (container);
 			Assert.AreEqual (Infoset ("<ArrayContainer xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ><items><anyType xsi:type='xsd:int'>10</anyType><anyType xsi:type='xsd:int'>20</anyType></items></ArrayContainer>"), WriterText);
 
-			container.items = new object [] { 10, "hello" };
+			container.items = new object[] { 10, "hello" };
 			Serialize (container);
 			Assert.AreEqual (Infoset ("<ArrayContainer xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ><items><anyType xsi:type='xsd:int'>10</anyType><anyType xsi:type='xsd:string'>hello</anyType></items></ArrayContainer>"), WriterText);
 		}
@@ -1115,9 +1131,9 @@ namespace MonoTests.System.XmlSerialization
 			simple1.something = "hello";
 			SimpleClass simple2 = new SimpleClass ();
 			simple2.something = "hello";
-			container.items = new SimpleClass [2];
-			container.items [0] = simple1;
-			container.items [1] = simple2;
+			container.items = new SimpleClass[2];
+			container.items[0] = simple1;
+			container.items[1] = simple2;
 			Serialize (container);
 			Assert.AreEqual (Infoset ("<ClassArrayContainer xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ><items><SimpleClass><something>hello</something></SimpleClass><SimpleClass><something>hello</something></SimpleClass></items></ClassArrayContainer>"), WriterText);
 		}
@@ -1204,10 +1220,11 @@ namespace MonoTests.System.XmlSerialization
 			Assert.AreEqual (Infoset ("<SimpleClass xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>hello</SimpleClass>"), WriterText, "#2");
 
 			try {
-				attr.XmlText = new XmlTextAttribute (typeof (byte []));
+				attr.XmlText = new XmlTextAttribute (typeof (byte[]));
 				Serialize (simple, overrides);
 				Assert.Fail ("#A1: XmlText.Type does not match the type it serializes: this should have failed");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				// there was an error reflecting type 'MonoTests.System.Xml.TestClasses.SimpleClass'
 				Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#A2");
 				Assert.IsNotNull (ex.Message, "#A3");
@@ -1231,7 +1248,8 @@ namespace MonoTests.System.XmlSerialization
 				attr.XmlText.DataType = "sometype";
 				Serialize (simple, overrides);
 				Assert.Fail ("#B1: XmlText.DataType does not match the type it serializes: this should have failed");
-			} catch (InvalidOperationException ex) {
+			}
+			catch (InvalidOperationException ex) {
 				// There was an error reflecting type 'MonoTests.System.Xml.TestClasses.SimpleClass'.
 				Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
 				Assert.IsNotNull (ex.Message, "#B3");
@@ -1279,14 +1297,16 @@ namespace MonoTests.System.XmlSerialization
 			try {
 				Serialize (simple, root);
 				Assert.Fail ("Cannot serialize null object if XmlRoot's IsNullable == false");
-			} catch (NullReferenceException) {
+			}
+			catch (NullReferenceException) {
 			}
 
 			root.IsNullable = true;
 			try {
 				Serialize (simple, root);
 				Assert.Fail ("Cannot serialize null object if XmlRoot's IsNullable == true");
-			} catch (NullReferenceException) {
+			}
+			catch (NullReferenceException) {
 			}
 
 			simple = new SimpleClass ();
@@ -1310,8 +1330,8 @@ namespace MonoTests.System.XmlSerialization
 			overrides.Add (typeof (ClassArrayContainer), attr);
 
 			ClassArrayContainer container = new ClassArrayContainer ();
-			container.items = new SimpleClass [1];
-			container.items [0] = new SimpleClass ();
+			container.items = new SimpleClass[1];
+			container.items[0] = new SimpleClass ();
 			Serialize (container, overrides);
 			Assert.AreEqual (Infoset ("<simple xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ><items><SimpleClass /></items></simple>"), WriterText);
 
@@ -1792,7 +1812,7 @@ namespace MonoTests.System.XmlSerialization
 		public void TestSerializeXmlNodeArray ()
 		{
 			XmlDocument doc = new XmlDocument ();
-			Serialize (new XmlNode [] { doc.CreateAttribute ("at"), doc.CreateElement ("elem1"), doc.CreateElement ("elem2") }, typeof (object));
+			Serialize (new XmlNode[] { doc.CreateAttribute ("at"), doc.CreateElement ("elem1"), doc.CreateElement ("elem2") }, typeof (object));
 			Assert.AreEqual (Infoset ("<anyType at=\"\"><elem1/><elem2/></anyType>"), WriterText);
 		}
 
@@ -1951,9 +1971,9 @@ namespace MonoTests.System.XmlSerialization
 #if NET_2_0
 				"<PrimitiveTypesContainer xmlns:xsi='{1}' xmlns:xsd='{0}' xmlns='some:urn'>" +
 #else
-				"<PrimitiveTypesContainer xmlns:xsd='{0}' xmlns:xsi='{1}' xmlns='some:urn'>" +
+ "<PrimitiveTypesContainer xmlns:xsd='{0}' xmlns:xsi='{1}' xmlns='some:urn'>" +
 #endif
-				"<Number>2004</Number>" +
+ "<Number>2004</Number>" +
 				"<Name>some name</Name>" +
 				"<Index>56</Index>" +
 				"<Password>8w8=</Password>" +
@@ -1967,9 +1987,9 @@ namespace MonoTests.System.XmlSerialization
 #if NET_2_0
 				"<q1:PrimitiveTypesContainer xmlns:xsi='{1}' xmlns:xsd='{0}' id='id1' xmlns:q1='{2}'>" +
 #else
-				"<q1:PrimitiveTypesContainer xmlns:xsd='{0}' xmlns:xsi='{1}' id='id1' xmlns:q1='{2}'>" +
+ "<q1:PrimitiveTypesContainer xmlns:xsd='{0}' xmlns:xsi='{1}' id='id1' xmlns:q1='{2}'>" +
 #endif
-				"<Number xsi:type='xsd:int'>2004</Number>" +
+ "<Number xsi:type='xsd:int'>2004</Number>" +
 				"<Name xsi:type='xsd:string'>some name</Name>" +
 				"<Index xsi:type='xsd:unsignedByte'>56</Index>" +
 				"<Password xsi:type='xsd:base64Binary'>8w8=</Password>" +
@@ -2151,7 +2171,7 @@ namespace MonoTests.System.XmlSerialization
 #endif
 
 		[Test] // bug #79989, #79990
-		public void SerializeHexBinary()
+		public void SerializeHexBinary ()
 		{
 			XmlSerializer ser = new XmlSerializer (typeof (HexBinary));
 			sw = new StringWriter ();
@@ -2161,7 +2181,7 @@ namespace MonoTests.System.XmlSerialization
 			string expected = @"<?xml version=""1.0"" encoding=""utf-16""?><HexBinary xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" Data=""010203"" />";
 			Assert.AreEqual (Infoset (expected), WriterText);
 			HexBinary h = (HexBinary) ser.Deserialize (new StringReader (sw.ToString ()));
-			Assert.AreEqual (new byte [] {1, 2, 3}, h.Data);
+			Assert.AreEqual (new byte[] { 1, 2, 3 }, h.Data);
 		}
 
 		[Test]
@@ -2213,6 +2233,328 @@ namespace MonoTests.System.XmlSerialization
 			Assert.AreEqual (Infoset (expected), WriterText);
 		}
 
+		#region GenericsSeralizationTests
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenSimpleClassString ()
+		{
+			GenSimpleClass<string> simple = new GenSimpleClass<string> ();
+			Serialize (simple);
+			Assert.AreEqual (Infoset ("<GenSimpleClassOfString xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' />"), WriterText);
+
+			simple.something = "hello";
+
+			Serialize (simple);
+			Assert.AreEqual (Infoset ("<GenSimpleClassOfString xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something>hello</something></GenSimpleClassOfString>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenSimpleClassBool ()
+		{
+			GenSimpleClass<bool> simple = new GenSimpleClass<bool> ();
+			Serialize (simple);
+			Assert.AreEqual (Infoset ("<GenSimpleClassOfBoolean xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something>false</something></GenSimpleClassOfBoolean>"), WriterText);
+
+			simple.something = true;
+
+			Serialize (simple);
+			Assert.AreEqual (Infoset ("<GenSimpleClassOfBoolean xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something>true</something></GenSimpleClassOfBoolean>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenSimpleStructInt ()
+		{
+			GenSimpleStruct<int> simple = new GenSimpleStruct<int> (0);
+			Serialize (simple);
+			Assert.AreEqual (Infoset ("<GenSimpleStructOfInt32 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something>0</something></GenSimpleStructOfInt32>"), WriterText);
+
+			simple.something = 123;
+
+			Serialize (simple);
+			Assert.AreEqual (Infoset ("<GenSimpleStructOfInt32 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something>123</something></GenSimpleStructOfInt32>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenListClassString ()
+		{
+			GenListClass<string> genlist = new GenListClass<string> ();
+			Serialize (genlist);
+			Assert.AreEqual (Infoset ("<GenListClassOfString xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><somelist></somelist></GenListClassOfString>"), WriterText);
+
+			genlist.somelist.Add ("Value1");
+			genlist.somelist.Add ("Value2");
+
+			Serialize (genlist);
+			Assert.AreEqual (Infoset ("<GenListClassOfString xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><somelist><string>Value1</string><string>Value2</string></somelist></GenListClassOfString>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenListClassFloat ()
+		{
+			GenListClass<float> genlist = new GenListClass<float> ();
+			Serialize (genlist);
+			Assert.AreEqual (Infoset ("<GenListClassOfSingle xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><somelist></somelist></GenListClassOfSingle>"), WriterText);
+
+			genlist.somelist.Add (1);
+			genlist.somelist.Add (2.2F);
+
+			Serialize (genlist);
+			Assert.AreEqual (Infoset ("<GenListClassOfSingle xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><somelist><float>1</float><float>2.2</float></somelist></GenListClassOfSingle>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenListClassList ()
+		{
+			GenListClass<GenListClass<int>> genlist = new GenListClass<GenListClass<int>> ();
+			Serialize (genlist);
+			Assert.AreEqual (Infoset ("<GenListClassOfGenListClassOfInt32 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><somelist></somelist></GenListClassOfGenListClassOfInt32>"), WriterText);
+
+			GenListClass<int> inlist1 = new GenListClass<int> ();
+			inlist1.somelist.Add (1);
+			inlist1.somelist.Add (2);
+			GenListClass<int> inlist2 = new GenListClass<int> ();
+			inlist2.somelist.Add (10);
+			inlist2.somelist.Add (20);
+			genlist.somelist.Add (inlist1);
+			genlist.somelist.Add (inlist2);
+
+			Serialize (genlist);
+			Assert.AreEqual (Infoset ("<GenListClassOfGenListClassOfInt32 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><somelist><GenListClassOfInt32><somelist><int>1</int><int>2</int></somelist></GenListClassOfInt32><GenListClassOfInt32><somelist><int>10</int><int>20</int></somelist></GenListClassOfInt32></somelist></GenListClassOfGenListClassOfInt32>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenListClassArray ()
+		{
+			GenListClass<GenArrayClass<char>> genlist = new GenListClass<GenArrayClass<char>> ();
+			Serialize (genlist);
+			Assert.AreEqual (Infoset ("<GenListClassOfGenArrayClassOfChar xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><somelist></somelist></GenListClassOfGenArrayClassOfChar>"), WriterText);
+
+			GenArrayClass<char> genarr1 = new GenArrayClass<char> ();
+			genarr1.arr[0] = 'a';
+			genarr1.arr[1] = 'b';
+			genlist.somelist.Add (genarr1);
+			GenArrayClass<char> genarr2 = new GenArrayClass<char> ();
+			genarr2.arr[0] = 'd';
+			genarr2.arr[1] = 'e';
+			genarr2.arr[2] = 'f';
+			genlist.somelist.Add (genarr2);
+
+			Serialize (genlist);
+			Assert.AreEqual (Infoset ("<GenListClassOfGenArrayClassOfChar xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><somelist><GenArrayClassOfChar><arr><char>97</char><char>98</char><char>0</char></arr></GenArrayClassOfChar><GenArrayClassOfChar><arr><char>100</char><char>101</char><char>102</char></arr></GenArrayClassOfChar></somelist></GenListClassOfGenArrayClassOfChar>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenTwoClassCharDouble ()
+		{
+			GenTwoClass<char, double> gentwo = new GenTwoClass<char, double> ();
+			Serialize (gentwo);
+			Assert.AreEqual (Infoset ("<GenTwoClassOfCharDouble xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something1>0</something1><something2>0</something2></GenTwoClassOfCharDouble>"), WriterText);
+
+			gentwo.something1 = 'a';
+			gentwo.something2 = 2.2;
+
+			Serialize (gentwo);
+			Assert.AreEqual (Infoset ("<GenTwoClassOfCharDouble xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something1>97</something1><something2>2.2</something2></GenTwoClassOfCharDouble>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenDerivedClassDecimalShort ()
+		{
+			GenDerivedClass<decimal, short> derived = new GenDerivedClass<decimal, short> ();
+			Serialize (derived);
+			Assert.AreEqual (Infoset ("<GenDerivedClassOfDecimalInt16 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something2>0</something2><another1>0</another1><another2>0</another2></GenDerivedClassOfDecimalInt16>"), WriterText);
+
+			derived.something1 = "Value1";
+			derived.something2 = 1;
+			derived.another1 = 1.1M;
+			derived.another2 = -22;
+
+			Serialize (derived);
+			Assert.AreEqual (Infoset ("<GenDerivedClassOfDecimalInt16 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something1>Value1</something1><something2>1</something2><another1>1.1</another1><another2>-22</another2></GenDerivedClassOfDecimalInt16>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenDerivedSecondClassByteUlong ()
+		{
+			GenDerived2Class<byte, ulong> derived2 = new GenDerived2Class<byte, ulong> ();
+			Serialize (derived2);
+			Assert.AreEqual (Infoset ("<GenDerived2ClassOfByteUInt64 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something1>0</something1><something2>0</something2><another1>0</another1><another2>0</another2></GenDerived2ClassOfByteUInt64>"), WriterText);
+
+			derived2.something1 = 1;
+			derived2.something2 = 222;
+			derived2.another1 = 111;
+			derived2.another2 = 222222;
+
+			Serialize (derived2);
+			Assert.AreEqual (Infoset ("<GenDerived2ClassOfByteUInt64 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><something1>1</something1><something2>222</something2><another1>111</another1><another2>222222</another2></GenDerived2ClassOfByteUInt64>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenNestedClass ()
+		{
+			GenNestedClass<string, int>.InnerClass<bool> nested =
+				new GenNestedClass<string, int>.InnerClass<bool> ();
+			Serialize (nested);
+			Assert.AreEqual (Infoset ("<InnerClassOfStringInt32Boolean xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><inner>0</inner><something>false</something></InnerClassOfStringInt32Boolean>"), WriterText);
+
+			nested.inner = 5;
+			nested.something = true;
+
+			Serialize (nested);
+			Assert.AreEqual (Infoset ("<InnerClassOfStringInt32Boolean xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><inner>5</inner><something>true</something></InnerClassOfStringInt32Boolean>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenListClassListNested ()
+		{
+			GenListClass<GenListClass<GenNestedClass<int, int>.InnerClass<string>>> genlist =
+				new GenListClass<GenListClass<GenNestedClass<int, int>.InnerClass<string>>> ();
+			Serialize (genlist);
+			Assert.AreEqual (Infoset ("<GenListClassOfGenListClassOfInnerClassOfInt32Int32String xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><somelist></somelist></GenListClassOfGenListClassOfInnerClassOfInt32Int32String>"), WriterText);
+
+			GenListClass<GenNestedClass<int, int>.InnerClass<string>> inlist1 =
+				new GenListClass<GenNestedClass<int, int>.InnerClass<string>> ();
+			GenNestedClass<int, int>.InnerClass<string> inval1 = new GenNestedClass<int, int>.InnerClass<string> ();
+			inval1.inner = 1;
+			inval1.something = "ONE";
+			inlist1.somelist.Add (inval1);
+			GenNestedClass<int, int>.InnerClass<string> inval2 = new GenNestedClass<int, int>.InnerClass<string> ();
+			inval2.inner = 2;
+			inval2.something = "TWO";
+			inlist1.somelist.Add (inval2);
+			GenListClass<GenNestedClass<int, int>.InnerClass<string>> inlist2 =
+				new GenListClass<GenNestedClass<int, int>.InnerClass<string>> ();
+			GenNestedClass<int, int>.InnerClass<string> inval3 = new GenNestedClass<int, int>.InnerClass<string> ();
+			inval3.inner = 30;
+			inval3.something = "THIRTY";
+			inlist2.somelist.Add (inval3);
+			genlist.somelist.Add (inlist1);
+			genlist.somelist.Add (inlist2);
+
+			Serialize (genlist);
+			Assert.AreEqual (Infoset ("<GenListClassOfGenListClassOfInnerClassOfInt32Int32String xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><somelist><GenListClassOfInnerClassOfInt32Int32String><somelist><InnerClassOfInt32Int32String><inner>1</inner><something>ONE</something></InnerClassOfInt32Int32String><InnerClassOfInt32Int32String><inner>2</inner><something>TWO</something></InnerClassOfInt32Int32String></somelist></GenListClassOfInnerClassOfInt32Int32String><GenListClassOfInnerClassOfInt32Int32String><somelist><InnerClassOfInt32Int32String><inner>30</inner><something>THIRTY</something></InnerClassOfInt32Int32String></somelist></GenListClassOfInnerClassOfInt32Int32String></somelist></GenListClassOfGenListClassOfInnerClassOfInt32Int32String>"), WriterText);
+		}
+
+		public enum Myenum { one, two, three, four, five, six };
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenArrayClassEnum ()
+		{
+			GenArrayClass<Myenum> genarr = new GenArrayClass<Myenum> ();
+			Serialize (genarr);
+			Assert.AreEqual (Infoset ("<GenArrayClassOfMyenum xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><arr><Myenum>one</Myenum><Myenum>one</Myenum><Myenum>one</Myenum></arr></GenArrayClassOfMyenum>"), WriterText);
+
+			genarr.arr[0] = Myenum.one;
+			genarr.arr[1] = Myenum.three;
+			genarr.arr[2] = Myenum.five;
+
+			Serialize (genarr);
+			Assert.AreEqual (Infoset ("<GenArrayClassOfMyenum xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><arr><Myenum>one</Myenum><Myenum>three</Myenum><Myenum>five</Myenum></arr></GenArrayClassOfMyenum>"), WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenArrayStruct ()
+		{
+			GenArrayClass<GenSimpleStruct<uint>> genarr = new GenArrayClass<GenSimpleStruct<uint>> ();
+			Serialize (genarr);
+			Assert.AreEqual ("<:GenArrayClassOfGenSimpleStructOfUInt32 http://www.w3.org/2000/xmlns/:xsd='http://www.w3.org/2001/XMLSchema' http://www.w3.org/2000/xmlns/:xsi='http://www.w3.org/2001/XMLSchema-instance'><:arr><:GenSimpleStructOfUInt32><:something>0</></><:GenSimpleStructOfUInt32><:something>0</></><:GenSimpleStructOfUInt32><:something>0</></></></>", WriterText);
+
+			GenSimpleStruct<uint> genstruct = new GenSimpleStruct<uint> ();
+			genstruct.something = 111;
+			genarr.arr[0] = genstruct;
+			genstruct.something = 222;
+			genarr.arr[1] = genstruct;
+			genstruct.something = 333;
+			genarr.arr[2] = genstruct;
+
+			Serialize (genarr);
+			Assert.AreEqual ("<:GenArrayClassOfGenSimpleStructOfUInt32 http://www.w3.org/2000/xmlns/:xsd='http://www.w3.org/2001/XMLSchema' http://www.w3.org/2000/xmlns/:xsi='http://www.w3.org/2001/XMLSchema-instance'><:arr><:GenSimpleStructOfUInt32><:something>111</></><:GenSimpleStructOfUInt32><:something>222</></><:GenSimpleStructOfUInt32><:something>333</></></></>", WriterText);
+		}
+
+		[Test]
+		[Category ("NotDotNet")]
+		// There is a bug in DotNet for this scenario, see comment below. 
+		[Category ("NotWorking")]
+		public void TestSerializeGenArrayList ()
+		{
+			GenArrayClass<GenListClass<string>> genarr = new GenArrayClass<GenListClass<string>> ();
+			Serialize (genarr);
+			Assert.AreEqual ("<:GenArrayClassOfGenListClassOfString http://www.w3.org/2000/xmlns/:xsd='http://www.w3.org/2001/XMLSchema' http://www.w3.org/2000/xmlns/:xsi='http://www.w3.org/2001/XMLSchema-instance'><:arr><:GenListClassOfString http://www.w3.org/2001/XMLSchema-instance:nil='true'></><:GenListClassOfString http://www.w3.org/2001/XMLSchema-instance:nil='true'></><:GenListClassOfString http://www.w3.org/2001/XMLSchema-instance:nil='true'></></></>", WriterText);
+
+			GenListClass<string> genlist1 = new GenListClass<string> ();
+			genlist1.somelist.Add ("list1-val1");
+			genlist1.somelist.Add ("list1-val2");
+			genarr.arr[0] = genlist1;
+			GenListClass<string> genlist2 = new GenListClass<string> ();
+			genlist2.somelist.Add ("list2-val1");
+			genlist2.somelist.Add ("list2-val2");
+			genlist2.somelist.Add ("list2-val3");
+			genlist2.somelist.Add ("list2-val4");
+			genarr.arr[1] = genlist2;
+			GenListClass<string> genlist3 = new GenListClass<string> ();
+			genlist1.somelist.Add ("list3val");
+			genarr.arr[2] = genlist3;
+
+			Serialize (genarr);
+			Assert.AreEqual ("<:GenArrayClassOfGenListClassOfString http://www.w3.org/2000/xmlns/:xsd='http://www.w3.org/2001/XMLSchema' http://www.w3.org/2000/xmlns/:xsi='http://www.w3.org/2001/XMLSchema-instance'><:arr><:GenListClassOfString><:somelist><:string>list1-val1</><:string>list1-val2</><:GenListClassOfString><:somelist><:string>list2-val1</><:string>list2-val2</><:string>list2-val3</><:string>list2-val4</></><:GenListClassOfString><:somelist><:string>list3val</></></></>", WriterText);
+			// Following is the DotNet result which is a bug, where member 
+			// of the third list is wrongly added to the first list.  
+			//Assert.AreEqual ("<:GenArrayClassOfGenListClassOfString http://www.w3.org/2000/xmlns/:xsd='http://www.w3.org/2001/XMLSchema' http://www.w3.org/2000/xmlns/:xsi='http://www.w3.org/2001/XMLSchema-instance'><:arr><:GenListClassOfString><:somelist><:string>list1-val1</><:string>list1-val2</><:string>list3val</></></><:GenListClassOfString><:somelist><:string>list2-val1</><:string>list2-val2</><:string>list2-val3</><:string>list2-val4</></></><:GenListClassOfString><:somelist></></></></>", WriterText);
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void TestSerializeGenComplexStruct ()
+		{
+			GenComplexStruct<int, string> complex = new GenComplexStruct<int, string> (0);
+			Serialize (complex);
+			Assert.AreEqual ("<:GenComplexStructOfInt32String http://www.w3.org/2000/xmlns/:xsd='http://www.w3.org/2001/XMLSchema' http://www.w3.org/2000/xmlns/:xsi='http://www.w3.org/2001/XMLSchema-instance'><:something>0</><:simpleclass><:something>0</></><:simplestruct><:something>0</></><:listclass><:somelist></></><:arrayclass><:arr><:int>0</><:int>0</><:int>0</></></><:twoclass><:something1>0</></><:derivedclass><:something2>0</><:another1>0</></><:derived2><:something1>0</><:another1>0</></><:nestedouter><:outer>0</></><:nestedinner><:something>0</></></>", WriterText);
+
+			complex.something = 123;
+			complex.simpleclass.something = 456;
+			complex.simplestruct.something = 789;
+			GenListClass<int> genlist = new GenListClass<int> ();
+			genlist.somelist.Add (100);
+			genlist.somelist.Add (200);
+			complex.listclass = genlist;
+			GenArrayClass<int> genarr = new GenArrayClass<int> ();
+			genarr.arr[0] = 11;
+			genarr.arr[1] = 22;
+			genarr.arr[2] = 33;
+			complex.arrayclass = genarr;
+			complex.twoclass.something1 = 10;
+			complex.twoclass.something2 = "Ten";
+			complex.derivedclass.another1 = 1;
+			complex.derivedclass.another2 = "one";
+			complex.derivedclass.something1 = "two";
+			complex.derivedclass.something2 = 2;
+			complex.derived2.another1 = 3;
+			complex.derived2.another2 = "three";
+			complex.derived2.something1 = 4;
+			complex.derived2.something2 = "four";
+			complex.nestedouter.outer = 5;
+			complex.nestedinner.inner = "six";
+			complex.nestedinner.something = 6;
+
+			Serialize (complex);
+			Assert.AreEqual ("<:GenComplexStructOfInt32String http://www.w3.org/2000/xmlns/:xsd='http://www.w3.org/2001/XMLSchema' http://www.w3.org/2000/xmlns/:xsi='http://www.w3.org/2001/XMLSchema-instance'><:something>123</><:simpleclass><:something>456</></><:simplestruct><:something>789</></><:listclass><:somelist><:int>100</><:int>200</></></><:arrayclass><:arr><:int>11</><:int>22</><:int>33</></></><:twoclass><:something1>10</><:something2>Ten</></><:derivedclass><:something1>two</><:something2>2</><:another1>1</><:another2>one</></><:derived2><:something1>4</><:something2>four</><:another1>3</><:another2>three</></><:nestedouter><:outer>5</></><:nestedinner><:inner>six</><:something>6</></></>", WriterText);
+		}
+
+		#endregion //GenericsSeralizationTests
+
 		public class XmlArrayOnInt
 		{
 			[XmlArray]
@@ -2242,25 +2584,25 @@ namespace MonoTests.System.XmlSerialization
 		public class XmlArrayOnArray
 		{
 			[XmlArray (Form = XmlSchemaForm.Unqualified)]
-			public string [] Sane = new string [] {"foo", "bar"};
+			public string[] Sane = new string[] { "foo", "bar" };
 
 			[XmlArray (Form = XmlSchemaForm.Unqualified)]
-			public ArrayItemInXmlArray [] Mids =
-				new ArrayItemInXmlArray [] {new ArrayItemInXmlArray ()};
+			public ArrayItemInXmlArray[] Mids =
+				new ArrayItemInXmlArray[] { new ArrayItemInXmlArray () };
 		}
 
-		[XmlType (Namespace="urn:gyabo")]
-		public class ArrayItemInXmlArray 
+		[XmlType (Namespace = "urn:gyabo")]
+		public class ArrayItemInXmlArray
 		{
 			[XmlArray (Form = XmlSchemaForm.Unqualified)]
-			public string [] Whee = new string [] {"foo", "bar"};
+			public string[] Whee = new string[] { "foo", "bar" };
 		}
 
 		[XmlRoot ("HexBinary")]
 		public class HexBinary
 		{
 			[XmlAttribute (DataType = "hexBinary")]
-			public byte [] Data = new byte [] {1, 2, 3};
+			public byte[] Data = new byte[] { 1, 2, 3 };
 		}
 
 		public class CDataTextNodesType
@@ -2316,8 +2658,8 @@ namespace MonoTests.System.XmlSerialization
 				ats.Sort ();
 
 				foreach (string name in ats) {
-					string [] nn = name.Split (' ');
-					GetInfoset (elem.Attributes [nn [0], nn [1]], sb);
+					string[] nn = name.Split (' ');
+					GetInfoset (elem.Attributes[nn[0], nn[1]], sb);
 				}
 
 				sb.Append (">");

Some files were not shown because too many files changed in this diff