Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -102,9 +102,6 @@ namespace MonoTests.System.Xml
}
[Test]
#if !NET_2_0
[Category ("NotDotNet")]
#endif
public void AnyUriRelativePathContainsColon ()
{
XmlValidatingReader vr = new XmlValidatingReader (

View File

@@ -6,7 +6,6 @@
//
// (C) 2004 Novell Inc.
//
#if NET_2_0
using System;
using System.Collections;
@@ -316,4 +315,3 @@ type=""xsd:string"" use=""required""/>
}
}
}
#endif

View File

@@ -430,7 +430,6 @@ namespace MonoTests.System.Xml
XmlSchema schema = GetSchema ("Test/XmlFiles/xsd/extension-attr-redefine-1.xsd");
#if NET_2_0
XmlSchemaSet xss = new XmlSchemaSet ();
xss.Add (schema);
if (StrictMsCompliant) {
@@ -450,23 +449,6 @@ namespace MonoTests.System.Xml
settings.ValidationType = ValidationType.Schema;
settings.Schemas = xss;
XmlReader vr = XmlReader.Create (sr, settings);
#else
if (StrictMsCompliant) {
schema.Compile (null);
} else {
try {
schema.Compile (null);
Assert.Fail ();
} catch (XmlSchemaException) {
}
return;
}
XmlValidatingReader vr = new XmlValidatingReader (xml,
XmlNodeType.Document, null);
vr.Schemas.Add (schema);
vr.ValidationType = ValidationType.Schema;
#endif
try {
vr.Read ();
@@ -482,7 +464,6 @@ namespace MonoTests.System.Xml
XmlSchema schema = GetSchema ("Test/XmlFiles/xsd/extension-attr-redefine-2.xsd");
#if NET_2_0
XmlSchemaSet xss = new XmlSchemaSet ();
xss.Add (schema);
xss.Compile ();
@@ -493,14 +474,6 @@ namespace MonoTests.System.Xml
settings.ValidationType = ValidationType.Schema;
settings.Schemas = xss;
XmlReader vr = XmlReader.Create (sr, settings);
#else
schema.Compile (null);
XmlValidatingReader vr = new XmlValidatingReader (xml,
XmlNodeType.Document, null);
vr.Schemas.Add (schema);
vr.ValidationType = ValidationType.Schema;
#endif
while (vr.Read ()) ;
}
@@ -512,7 +485,6 @@ namespace MonoTests.System.Xml
XmlSchema schema = GetSchema ("Test/XmlFiles/xsd/extension-attr-redefine-3.xsd");
#if NET_2_0
XmlSchemaSet xss = new XmlSchemaSet ();
xss.Add (schema);
if (StrictMsCompliant) {
@@ -532,28 +504,10 @@ namespace MonoTests.System.Xml
settings.ValidationType = ValidationType.Schema;
settings.Schemas = xss;
XmlReader vr = XmlReader.Create (sr, settings);
#else
if (StrictMsCompliant) {
schema.Compile (null);
} else {
try {
schema.Compile (null);
Assert.Fail ();
} catch (XmlSchemaException) {
}
return;
}
XmlValidatingReader vr = new XmlValidatingReader (xml,
XmlNodeType.Document, null);
vr.Schemas.Add (schema);
vr.ValidationType = ValidationType.Schema;
#endif
while (vr.Read ()) ;
}
#if NET_2_0
internal class XmlTestResolver : XmlResolver
{
@@ -627,7 +581,6 @@ namespace MonoTests.System.Xml
// Parse the file.
while (reader.Read()) {}
}
#endif
[Test]
public void TestImportSchemaThatIncludesAnother ()

View File

@@ -24,7 +24,6 @@ namespace MonoTests.System.Xml
[TestFixture]
public class XmlSchemaTypeTests
{
#if NET_2_0
string [] all_types = new string [] {
"string", "boolean", "float", "double", "decimal",
"duration", "dateTime", "time", "date", "gYearMonth",
@@ -96,6 +95,5 @@ namespace MonoTests.System.Xml
}
}
#endif
}
}

View File

@@ -7,7 +7,6 @@
// (C) 2008 Novell Inc.
//
#if NET_2_0
using System;
using System.Collections;
@@ -454,4 +453,3 @@ namespace MonoTests.System.Xml
}
}
#endif

View File

@@ -40,7 +40,6 @@ namespace MonoTests.System.XmlSerialization
[TestFixture]
public class CodeIdentifiersTests
{
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
public void IgnoreCase ()
@@ -52,6 +51,5 @@ namespace MonoTests.System.XmlSerialization
Assert.IsTrue (c.IsInUse ("tEsT"), "#2");
Assert.AreEqual ("camelCase", c.MakeRightCase ("CAMELCASE"), "#3");
}
#endif
}
}

View File

@@ -280,7 +280,6 @@ namespace MonoTests.System.XmlSerialization
#region GenericsDeseralizationTests
#if NET_2_0
[Test]
public void TestDeserializeGenSimpleClassString ()
{
@@ -512,7 +511,6 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual ("six", complex.nestedinner.inner);
Assert.AreEqual (6, complex.nestedinner.something);
}
#endif
#endregion //GenericsDeseralizationTests

View File

@@ -20,11 +20,9 @@ namespace MonoTests.System.XmlSerialization
public class SoapAttributesTests
{
[Test]
#if NET_2_0
// in .NET 2.0, SoapDefaultValue should be null by default, but we need
// more tests before making this change
[Category ("NotDotNet")]
#endif
public void Defaults ()
{
SoapAttributes atts = new SoapAttributes ();

View File

@@ -95,21 +95,13 @@ namespace MonoTests.System.XmlSerialization
XmlTypeMapping tm = Map (typeof (int[]));
Assert.AreEqual ("ArrayOfInt", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfInt32", tm.TypeName, "#A3");
#else
Assert.AreEqual ("Int32[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("System.Int32[]", tm.TypeFullName, "#A4");
tm = Map (typeof (int[][]));
Assert.AreEqual ("ArrayOfArrayOfInt", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfInt32", tm.TypeName, "#B3");
#else
Assert.AreEqual ("Int32[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("System.Int32[][]", tm.TypeFullName, "#B4");
}
@@ -144,21 +136,13 @@ namespace MonoTests.System.XmlSerialization
XmlTypeMapping tm = Map (typeof (string[]));
Assert.AreEqual ("ArrayOfString", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfString", tm.TypeName, "#A3");
#else
Assert.AreEqual ("String[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("System.String[]", tm.TypeFullName, "#A4");
tm = Map (typeof (string[][]));
Assert.AreEqual ("ArrayOfArrayOfString", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfString", tm.TypeName, "#B3");
#else
Assert.AreEqual ("String[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("System.String[][]", tm.TypeFullName, "#B4");
}
@@ -193,21 +177,13 @@ namespace MonoTests.System.XmlSerialization
XmlTypeMapping tm = Map (typeof (object[]));
Assert.AreEqual ("ArrayOfAnyType", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfObject", tm.TypeName, "#A3");
#else
Assert.AreEqual ("Object[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("System.Object[]", tm.TypeFullName, "#A4");
tm = Map (typeof (object[][]));
Assert.AreEqual ("ArrayOfArrayOfAnyType", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfObject", tm.TypeName, "#B3");
#else
Assert.AreEqual ("Object[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("System.Object[][]", tm.TypeFullName, "#B4");
}
@@ -248,11 +224,7 @@ namespace MonoTests.System.XmlSerialization
tm = Map (typeof (byte[][]));
Assert.AreEqual ("ArrayOfBase64Binary", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfByte", tm.TypeName, "#B3");
#else
Assert.AreEqual ("Byte[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("System.Byte[][]", tm.TypeFullName, "#B4");
}
@@ -479,21 +451,13 @@ namespace MonoTests.System.XmlSerialization
XmlTypeMapping tm = Map (typeof (DateTime[]));
Assert.AreEqual ("ArrayOfDateTime", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfDateTime", tm.TypeName, "#A3");
#else
Assert.AreEqual ("DateTime[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("System.DateTime[]", tm.TypeFullName, "#A4");
tm = Map (typeof (DateTime[][]));
Assert.AreEqual ("ArrayOfArrayOfDateTime", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfDateTime", tm.TypeName, "#B3");
#else
Assert.AreEqual ("DateTime[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("System.DateTime[][]", tm.TypeFullName, "#B4");
}
@@ -528,21 +492,13 @@ namespace MonoTests.System.XmlSerialization
XmlTypeMapping tm = Map (typeof (Guid[]));
Assert.AreEqual ("ArrayOfGuid", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfGuid", tm.TypeName, "#A3");
#else
Assert.AreEqual ("Guid[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("System.Guid[]", tm.TypeFullName, "#A4");
tm = Map (typeof (Guid[][]));
Assert.AreEqual ("ArrayOfArrayOfGuid", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfGuid", tm.TypeName, "#B3");
#else
Assert.AreEqual ("Guid[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("System.Guid[][]", tm.TypeFullName, "#B4");
}
@@ -601,21 +557,13 @@ namespace MonoTests.System.XmlSerialization
XmlTypeMapping tm = Map (typeof (XmlQualifiedName[]));
Assert.AreEqual ("ArrayOfQName", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfXmlQualifiedName", tm.TypeName, "#A3");
#else
Assert.AreEqual ("XmlQualifiedName[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("System.Xml.XmlQualifiedName[]", tm.TypeFullName, "#A4");
tm = Map (typeof (XmlQualifiedName[][]));
Assert.AreEqual ("ArrayOfArrayOfQName", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfXmlQualifiedName", tm.TypeName, "#B3");
#else
Assert.AreEqual ("XmlQualifiedName[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("System.Xml.XmlQualifiedName[][]", tm.TypeFullName, "#B4");
}
@@ -650,21 +598,13 @@ namespace MonoTests.System.XmlSerialization
XmlTypeMapping tm = Map (typeof (sbyte[]));
Assert.AreEqual ("ArrayOfByte", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfSByte", tm.TypeName, "#A3");
#else
Assert.AreEqual ("SByte[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("System.SByte[]", tm.TypeFullName, "#A4");
tm = Map (typeof (sbyte[][]));
Assert.AreEqual ("ArrayOfArrayOfByte", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfSByte", tm.TypeName, "#B3");
#else
Assert.AreEqual ("SByte[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("System.SByte[][]", tm.TypeFullName, "#B4");
}
@@ -699,21 +639,13 @@ namespace MonoTests.System.XmlSerialization
XmlTypeMapping tm = Map (typeof (char[]));
Assert.AreEqual ("ArrayOfChar", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfChar", tm.TypeName, "#A3");
#else
Assert.AreEqual ("Char[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("System.Char[]", tm.TypeFullName, "#A4");
tm = Map (typeof (char[][]));
Assert.AreEqual ("ArrayOfArrayOfChar", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfChar", tm.TypeName, "#B3");
#else
Assert.AreEqual ("Char[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("System.Char[][]", tm.TypeFullName, "#B4");
}
@@ -966,21 +898,13 @@ namespace MonoTests.System.XmlSerialization
XmlTypeMapping tm = Map (typeof (AttributeTargets[]));
Assert.AreEqual ("ArrayOfAttributeTargets", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfAttributeTargets", tm.TypeName, "#A3");
#else
Assert.AreEqual ("AttributeTargets[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("System.AttributeTargets[]", tm.TypeFullName, "#A4");
tm = Map (typeof (AttributeTargets[][]));
Assert.AreEqual ("ArrayOfArrayOfAttributeTargets", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfAttributeTargets", tm.TypeName, "#B3");
#else
Assert.AreEqual ("AttributeTargets[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("System.AttributeTargets[][]", tm.TypeFullName, "#B4");
}
@@ -1015,28 +939,17 @@ namespace MonoTests.System.XmlSerialization
XmlTypeMapping tm = Map (typeof (SimpleClass[]));
Assert.AreEqual ("ArrayOfSimpleClass", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfSimpleClass", tm.TypeName, "#A3");
#else
Assert.AreEqual ("SimpleClass[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("MonoTests.System.Xml.TestClasses.SimpleClass[]", tm.TypeFullName, "#A4");
tm = Map (typeof (SimpleClass[][]));
Assert.AreEqual ("ArrayOfArrayOfSimpleClass", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfSimpleClass", tm.TypeName, "#B3");
#else
Assert.AreEqual ("SimpleClass[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("MonoTests.System.Xml.TestClasses.SimpleClass[][]", tm.TypeFullName, "#B4");
}
[Test]
#if ONLY_1_1
[Category ("NotDotNet")] // wrong error message is reported in .NET 1.1
#endif
public void TypeMapping_Attribute_ComplexType ()
{
SoapAttributes attrs = new SoapAttributes (typeof (Field_Encoded).GetMember ("Names")[0]);
@@ -1139,21 +1052,13 @@ namespace MonoTests.System.XmlSerialization
tm = Map (typeof (SimpleClassEnumerable[]));
Assert.AreEqual ("ArrayOfArrayOfSimpleClass", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfSimpleClassEnumerable", tm.TypeName, "#A3");
#else
Assert.AreEqual ("SimpleClassEnumerable[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerable[]", tm.TypeFullName, "#A4");
tm = Map (typeof (SimpleClassEnumerable[][]));
Assert.AreEqual ("ArrayOfArrayOfArrayOfSimpleClass", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfSimpleClassEnumerable", tm.TypeName, "#B3");
#else
Assert.AreEqual ("SimpleClassEnumerable[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerable[][]", tm.TypeFullName, "#B4");
}
@@ -1170,21 +1075,13 @@ namespace MonoTests.System.XmlSerialization
tm = Map (typeof (ObjectEnumerable[]));
Assert.AreEqual ("ArrayOfArrayOfAnyType", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfObjectEnumerable", tm.TypeName, "#A3");
#else
Assert.AreEqual ("ObjectEnumerable[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.ObjectEnumerable[]", tm.TypeFullName, "#A4");
tm = Map (typeof (ObjectEnumerable[][]));
Assert.AreEqual ("ArrayOfArrayOfArrayOfAnyType", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfObjectEnumerable", tm.TypeName, "#B3");
#else
Assert.AreEqual ("ObjectEnumerable[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.ObjectEnumerable[][]", tm.TypeFullName, "#B4");
}
@@ -1215,29 +1112,18 @@ namespace MonoTests.System.XmlSerialization
tm = Map (typeof (SimpleClassEnumerablePrivateCurrent[]));
Assert.AreEqual ("ArrayOfArrayOfAnyType", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfSimpleClassEnumerablePrivateCurrent", tm.TypeName, "#A3");
#else
Assert.AreEqual ("SimpleClassEnumerablePrivateCurrent[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerablePrivateCurrent[]", tm.TypeFullName, "#A4");
tm = Map (typeof (SimpleClassEnumerablePrivateCurrent[][]));
Assert.AreEqual ("ArrayOfArrayOfArrayOfAnyType", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfSimpleClassEnumerablePrivateCurrent", tm.TypeName, "#B3");
#else
Assert.AreEqual ("SimpleClassEnumerablePrivateCurrent[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerablePrivateCurrent[][]", tm.TypeFullName, "#B4");
}
[Test]
[Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
#if ONLY_1_1
[Category ("NotDotNet")] // results in NullReferenceException in .NET 1.1 (SP1)
#endif
public void TypeMapping_IEnumerable_SimpleClass_PrivateGetEnumerator ()
{
XmlTypeMapping tm = Map (typeof (SimpleClassEnumerablePrivateGetEnumerator));
@@ -1249,21 +1135,13 @@ namespace MonoTests.System.XmlSerialization
tm = Map (typeof (SimpleClassEnumerablePrivateGetEnumerator[]));
Assert.AreEqual ("ArrayOfArrayOfAnyType", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfSimpleClassEnumerablePrivateGetEnumerator", tm.TypeName, "#A3");
#else
Assert.AreEqual ("SimpleClassEnumerablePrivateGetEnumerator[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerablePrivateGetEnumerator[]", tm.TypeFullName, "#A4");
tm = Map (typeof (SimpleClassEnumerablePrivateGetEnumerator[][]));
Assert.AreEqual ("ArrayOfArrayOfArrayOfAnyType", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfSimpleClassEnumerablePrivateGetEnumerator", tm.TypeName, "#B3");
#else
Assert.AreEqual ("SimpleClassEnumerablePrivateGetEnumerator[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerablePrivateGetEnumerator[][]", tm.TypeFullName, "#B4");
}
@@ -1308,21 +1186,13 @@ namespace MonoTests.System.XmlSerialization
tm = Map (typeof (SimpleClassCollection[]));
Assert.AreEqual ("ArrayOfArrayOfSimpleClass", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfSimpleClassCollection", tm.TypeName, "#A3");
#else
Assert.AreEqual ("SimpleClassCollection[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassCollection[]", tm.TypeFullName, "#A4");
tm = Map (typeof (SimpleClassCollection[][]));
Assert.AreEqual ("ArrayOfArrayOfArrayOfSimpleClass", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfSimpleClassCollection", tm.TypeName, "#B3");
#else
Assert.AreEqual ("SimpleClassCollection[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassCollection[][]", tm.TypeFullName, "#B4");
}
@@ -1339,21 +1209,13 @@ namespace MonoTests.System.XmlSerialization
tm = Map (typeof (ObjectCollection[]));
Assert.AreEqual ("ArrayOfArrayOfAnyType", tm.ElementName, "#A1");
Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
#if NET_2_0
Assert.AreEqual ("ArrayOfObjectCollection", tm.TypeName, "#A3");
#else
Assert.AreEqual ("ObjectCollection[]", tm.TypeName, "#A3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.ObjectCollection[]", tm.TypeFullName, "#A4");
tm = Map (typeof (ObjectCollection[][]));
Assert.AreEqual ("ArrayOfArrayOfArrayOfAnyType", tm.ElementName, "#B1");
Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
#if NET_2_0
Assert.AreEqual ("ArrayOfArrayOfObjectCollection", tm.TypeName, "#B3");
#else
Assert.AreEqual ("ObjectCollection[][]", tm.TypeName, "#B3");
#endif
Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.ObjectCollection[][]", tm.TypeFullName, "#B4");
}

View File

@@ -16,9 +16,7 @@ using System.CodeDom.Compiler;
using System.Collections;
using System.Globalization;
using System.IO;
#if NET_2_0
using System.Reflection;
#endif
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
@@ -48,7 +46,6 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format(CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
"[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
@@ -68,14 +65,6 @@ namespace MonoTests.System.XmlSerialization
" }}{0}" +
" }}{0}" +
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
#else
"[System.Xml.Serialization.XmlRootAttribute(Namespace=\"\", IsNullable=true)]{0}" +
"public class ArrayClass {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" public object names;{0}" +
"}}{0}", Environment.NewLine), sw.ToString (), "#2");
#endif
codeNamespace = ExportCode (typeof (ArrayClass[]));
@@ -87,7 +76,6 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
"[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
@@ -106,13 +94,6 @@ namespace MonoTests.System.XmlSerialization
" }}{0}" +
" }}{0}" +
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#4");
#else
"public class ArrayClass {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" public object names;{0}" +
"}}{0}", Environment.NewLine), sw.ToString (), "#4");
#endif
}
[Test]
@@ -129,7 +110,6 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
"[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
@@ -149,14 +129,6 @@ namespace MonoTests.System.XmlSerialization
" }}{0}" +
" }}{0}" +
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
#else
"[System.Xml.Serialization.XmlRootAttribute(Namespace=\"\", IsNullable=true)]{0}" +
"public class ArrayContainer {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" public object[] items;{0}" +
"}}{0}", Environment.NewLine), sw.ToString (), "#2");
#endif
}
[Test]
@@ -173,7 +145,6 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
"[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
@@ -193,14 +164,6 @@ namespace MonoTests.System.XmlSerialization
" }}{0}" +
" }}{0}" +
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
#else
"[System.Xml.Serialization.XmlRootAttribute(Namespace=\"\", IsNullable=true)]{0}" +
"public class CDataContainer {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" public System.Xml.XmlCDataSection cdata;{0}" +
"}}{0}", Environment.NewLine), sw.ToString (), "#2");
#endif
}
[Test]
@@ -219,7 +182,6 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
"[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
@@ -243,18 +205,6 @@ namespace MonoTests.System.XmlSerialization
" }}{0}" +
" }}{0}" +
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
#else
"[System.Xml.Serialization.XmlRootAttribute(Namespace=\"\", IsNullable=true)]{0}" +
"public class Choices {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlElementAttribute(\"ChoiceZero\", typeof(string))]{0}" +
" [System.Xml.Serialization.XmlElementAttribute(\"ChoiceTwo\", typeof(string))]{0}" +
" [System.Xml.Serialization.XmlElementAttribute(\"ChoiceOne\", typeof(string))]{0}" +
" [System.Xml.Serialization.XmlChoiceIdentifierAttribute(\"ItemType\")]{0}" +
" public string MyChoice;{0}" +
"}}{0}", Environment.NewLine), sw.ToString (), "#2");
#endif
}
[Test]
@@ -272,7 +222,6 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
"[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
@@ -431,68 +380,12 @@ namespace MonoTests.System.XmlSerialization
" this.streetField = value;{0}" +
" }}{0}" +
" }}{0}" +
#else
"[System.Xml.Serialization.XmlRootAttribute(\"field\", Namespace=\"\", IsNullable=true)]{0}" +
"public class Field {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"flag1\")]{0}" +
" [System.ComponentModel.DefaultValueAttribute(MonoTests.System.Xml.TestClasses.FlagEnum.e1)]{0}" +
" public MonoTests.System.Xml.TestClasses.FlagEnum Flags1 = MonoTests.System.Xml.TestClasses.FlagEnum.e1;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"flag2\")]{0}" +
" [System.ComponentModel.DefaultValueAttribute(MonoTests.System.Xml.TestClasses.FlagEnum.e1)]{0}" +
" public MonoTests.System.Xml.TestClasses.FlagEnum Flags2 = MonoTests.System.Xml.TestClasses.FlagEnum.e1;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"flag3\", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]{0}" +
" [System.ComponentModel.DefaultValueAttribute((MonoTests.System.Xml.TestClasses.FlagEnum.e1 | MonoTests.System.Xml.TestClasses.FlagEnum.e2))]{0}" +
" public MonoTests.System.Xml.TestClasses.FlagEnum Flags3 = (MonoTests.System.Xml.TestClasses.FlagEnum.e1 | MonoTests.System.Xml.TestClasses.FlagEnum.e2);{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"flag4\")]{0}" +
" public MonoTests.System.Xml.TestClasses.FlagEnum Flags4;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"modifiers\")]{0}" +
" public MonoTests.System.Xml.TestClasses.MapModifiers Modifiers;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"modifiers2\")]{0}" +
" public MonoTests.System.Xml.TestClasses.MapModifiers Modifiers2;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"modifiers3\")]{0}" +
" [System.ComponentModel.DefaultValueAttribute(MonoTests.System.Xml.TestClasses.MapModifiers.Public)]{0}" +
" public MonoTests.System.Xml.TestClasses.MapModifiers Modifiers3 = MonoTests.System.Xml.TestClasses.MapModifiers.Public;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"modifiers4\")]{0}" +
" [System.ComponentModel.DefaultValueAttribute(MonoTests.System.Xml.TestClasses.MapModifiers.Protected)]{0}" +
" public MonoTests.System.Xml.TestClasses.MapModifiers Modifiers4 = MonoTests.System.Xml.TestClasses.MapModifiers.Protected;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"modifiers5\", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]{0}" +
" [System.ComponentModel.DefaultValueAttribute(MonoTests.System.Xml.TestClasses.MapModifiers.Public)]{0}" +
" public MonoTests.System.Xml.TestClasses.MapModifiers Modifiers5 = MonoTests.System.Xml.TestClasses.MapModifiers.Public;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"names\")]{0}" +
" public string[] Names;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"street\")]{0}" +
" public string Street;{0}" +
#endif
"}}{0}" +
"{0}" +
"/// <remarks/>{0}" +
"[System.FlagsAttribute()]{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
#endif
"public enum FlagEnum {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
@@ -510,10 +403,8 @@ namespace MonoTests.System.XmlSerialization
"{0}" +
"/// <remarks/>{0}" +
"[System.FlagsAttribute()]{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
#endif
"public enum MapModifiers {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
@@ -523,11 +414,7 @@ namespace MonoTests.System.XmlSerialization
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlEnumAttribute(\"protected\")]{0}" +
" Protected = 2,{0}" +
#if NET_2_0
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
#else
"}}{0}", Environment.NewLine), sw.ToString (), "#2");
#endif
}
[Test]
@@ -544,10 +431,8 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
#endif
"[System.Xml.Serialization.XmlTypeAttribute(IncludeInSchema=false)]{0}" +
"[System.Xml.Serialization.XmlRootAttribute(Namespace=\"\", IsNullable=false)]{0}" +
"public enum ItemChoiceType {{{0}" +
@@ -561,11 +446,7 @@ namespace MonoTests.System.XmlSerialization
" {0}" +
" /// <remarks/>{0}" +
" ChoiceTwo,{0}" +
#if NET_2_0
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
#else
"}}{0}", Environment.NewLine), sw.ToString (), "#2");
#endif
codeNamespace = ExportCode (typeof (ItemChoiceType[]));
Assert.IsNotNull (codeNamespace, "#3");
@@ -576,10 +457,8 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
#endif
"[System.Xml.Serialization.XmlTypeAttribute(IncludeInSchema=false)]{0}" +
"public enum ItemChoiceType {{{0}" +
" {0}" +
@@ -592,11 +471,7 @@ namespace MonoTests.System.XmlSerialization
" {0}" +
" /// <remarks/>{0}" +
" ChoiceTwo,{0}" +
#if NET_2_0
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#4");
#else
"}}{0}", Environment.NewLine), sw.ToString (), "#4");
#endif
}
[Test]
@@ -613,7 +488,6 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
"[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
@@ -653,21 +527,6 @@ namespace MonoTests.System.XmlSerialization
" }}{0}" +
" }}{0}" +
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
#else
"[System.Xml.Serialization.XmlRootAttribute(Namespace=\"\", IsNullable=true)]{0}" +
"public class ClassArrayContainer {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" public MonoTests.System.Xml.TestClasses.SimpleClass[] items;{0}" +
"}}{0}" +
"{0}" +
"/// <remarks/>{0}" +
"public class SimpleClass {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" public string something;{0}" +
"}}{0}", Environment.NewLine), sw.ToString (), "#2");
#endif
}
[Test]
@@ -685,7 +544,6 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
"[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
@@ -962,130 +820,6 @@ namespace MonoTests.System.XmlSerialization
" /// <remarks/>{0}" +
" e4 = 4,{0}" +
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
#else
"[System.Xml.Serialization.XmlTypeAttribute(Namespace=\"urn:aNS\")]{0}" +
"[System.Xml.Serialization.XmlRootAttribute(\"root\", Namespace=\"urn:aNS\", IsNullable=false)]{0}" +
"public class Root {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" public MonoTests.System.Xml.TestClasses.OptionalValueTypeContainer OptionalValue;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" public MonoTests.System.Xml.TestClasses.TestDefault Default;{0}" +
"}}{0}" +
"{0}" +
"/// <remarks/>{0}" +
"[System.Xml.Serialization.XmlTypeAttribute(TypeName=\"optionalValueType\", Namespace=\"some:urn\")]{0}" +
"public class OptionalValueTypeContainer {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.ComponentModel.DefaultValueAttribute((MonoTests.System.Xml.TestClasses.FlagEnum.e1 | MonoTests.System.Xml.TestClasses.FlagEnum.e4))]{0}" +
" public MonoTests.System.Xml.TestClasses.FlagEnum Attributes = (MonoTests.System.Xml.TestClasses.FlagEnum.e1 | MonoTests.System.Xml.TestClasses.FlagEnum.e4);{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.ComponentModel.DefaultValueAttribute(MonoTests.System.Xml.TestClasses.FlagEnum.e1)]{0}" +
" public MonoTests.System.Xml.TestClasses.FlagEnum Flags = MonoTests.System.Xml.TestClasses.FlagEnum.e1;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlIgnoreAttribute()]{0}" +
" public bool FlagsSpecified;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.ComponentModel.DefaultValueAttribute(false)]{0}" +
" public bool IsEmpty = false;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlIgnoreAttribute()]{0}" +
" public bool IsEmptySpecified;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.ComponentModel.DefaultValueAttribute(false)]{0}" +
" public bool IsNull = false;{0}" +
"}}{0}" +
"{0}" +
"/// <remarks/>{0}" +
"[System.Xml.Serialization.XmlTypeAttribute(Namespace=\"some:urn\")]{0}" +
"[System.FlagsAttribute()]{0}" +
"public enum FlagEnum {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlEnumAttribute(\"one\")]{0}" +
" e1 = 1,{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlEnumAttribute(\"two\")]{0}" +
" e2 = 2,{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlEnumAttribute(\"four\")]{0}" +
" e4 = 4,{0}" +
"}}{0}" +
"{0}" +
"/// <remarks/>{0}" +
"[System.Xml.Serialization.XmlTypeAttribute(Namespace=\"urn:myNS\")]{0}" +
"public class TestDefault {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" public string str;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.ComponentModel.DefaultValueAttribute(\"Default Value\")]{0}" +
" public string strDefault = \"Default Value\";{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.ComponentModel.DefaultValueAttribute(true)]{0}" +
" public bool boolT = true;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.ComponentModel.DefaultValueAttribute(false)]{0}" +
" public bool boolF = false;{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.ComponentModel.DefaultValueAttribute(typeof(System.Decimal), \"10\")]{0}" +
" public System.Decimal decimalval = ((System.Decimal)(10m));{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.ComponentModel.DefaultValueAttribute((MonoTests.System.Xml.TestClasses.FlagEnum.e1 | MonoTests.System.Xml.TestClasses.FlagEnum.e4))]{0}" +
" public MonoTests.System.Xml.TestClasses.FlagEnum flag = (MonoTests.System.Xml.TestClasses.FlagEnum.e1 | MonoTests.System.Xml.TestClasses.FlagEnum.e4);{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.ComponentModel.DefaultValueAttribute((MonoTests.System.Xml.TestClasses.FlagEnum_Encoded.e1 | MonoTests.System.Xml.TestClasses.FlagEnum_Encoded.e4))]{0}" +
" public MonoTests.System.Xml.TestClasses.FlagEnum_Encoded flagencoded = (MonoTests.System.Xml.TestClasses.FlagEnum_Encoded.e1 | MonoTests.System.Xml.TestClasses.FlagEnum_Encoded.e4);{0}" +
"}}{0}" +
"{0}" +
"/// <remarks/>{0}" +
"[System.Xml.Serialization.XmlTypeAttribute(Namespace=\"urn:myNS\")]{0}" +
"[System.FlagsAttribute()]{0}" +
"public enum FlagEnum {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlEnumAttribute(\"one\")]{0}" +
" e1 = 1,{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlEnumAttribute(\"two\")]{0}" +
" e2 = 2,{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlEnumAttribute(\"four\")]{0}" +
" e4 = 4,{0}" +
"}}{0}" +
"{0}" +
"/// <remarks/>{0}" +
"[System.Xml.Serialization.XmlTypeAttribute(Namespace=\"urn:myNS\")]{0}" +
"[System.FlagsAttribute()]{0}" +
"public enum FlagEnum_Encoded {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" e1 = 1,{0}" +
" {0}" +
" /// <remarks/>{0}" +
" e2 = 2,{0}" +
" {0}" +
" /// <remarks/>{0}" +
" e4 = 4,{0}" +
"}}{0}", Environment.NewLine), sw.ToString (), "#2");
#endif
}
[Test]
@@ -1102,7 +836,6 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"{0}{0}" +
"/// <remarks/>{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
"[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
@@ -1123,15 +856,6 @@ namespace MonoTests.System.XmlSerialization
" }}{0}" +
" }}{0}" +
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
#else
"[System.Xml.Serialization.XmlRootAttribute(\"simple\", Namespace=\"\", IsNullable=true)]{0}" +
"public class SimpleClassWithXmlAttributes {{{0}" +
" {0}" +
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlAttributeAttribute(\"member\")]{0}" +
" public string something;{0}" +
"}}{0}", Environment.NewLine), sw.ToString (), "#2");
#endif
}
[Test]
@@ -1185,10 +909,8 @@ namespace MonoTests.System.XmlSerialization
"{0}{0}" +
"/// <remarks/>{0}" +
"[System.FlagsAttribute()]{0}" +
#if NET_2_0
"[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
"[System.SerializableAttribute()]{0}" +
#endif
"[System.Xml.Serialization.XmlRootAttribute(Namespace=\"\", IsNullable=false)]{0}" +
"public enum ZeroFlagEnum {{{0}" +
" {0}" +
@@ -1203,11 +925,7 @@ namespace MonoTests.System.XmlSerialization
" /// <remarks/>{0}" +
" [System.Xml.Serialization.XmlEnumAttribute(\"tns:t<w>o\")]{0}" +
" e2 = 4,{0}" +
#if NET_2_0
"}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
#else
"}}{0}", Environment.NewLine), sw.ToString (), "#2");
#endif
}
[Test]
@@ -1287,7 +1005,6 @@ namespace MonoTests.System.XmlSerialization
return codeNamespace;
}
#if NET_2_0
string XmlFileVersion {
get {
Assembly xmlAsm = typeof (XmlDocument).Assembly;
@@ -1296,7 +1013,6 @@ namespace MonoTests.System.XmlSerialization
return afv.Version;
}
}
#endif
[XmlRootAttribute ("root", Namespace="urn:aNS", IsNullable=false)]
public class Root

View File

@@ -1 +1 @@
fc55852869da82e5aaa0c3273a4f12edf38665a2
4cef24da1e897dc4550fc598b5a566a07dffe288

View File

@@ -210,17 +210,6 @@ namespace MonoTests.System.Xml.Serialization
Assert.AreEqual ("System.String", map.TypeFullName, "#A4");
Assert.AreEqual ("String", map.TypeName, "#A5");
#if ONLY_1_1
schemas = ExportType (typeof (char));
importer = new XmlSchemaImporter (schemas);
map = importer.ImportTypeMapping (new XmlQualifiedName ("char", "NSChar"));
Assert.IsNotNull (map, "#B1");
Assert.AreEqual ("char", map.ElementName, "#B2");
Assert.AreEqual ("NSChar", map.Namespace, "#B3");
Assert.AreEqual ("System.Char", map.TypeFullName, "#B4");
Assert.AreEqual ("Char", map.TypeName, "#B5");
#endif
}
[Test]
@@ -486,17 +475,6 @@ namespace MonoTests.System.Xml.Serialization
Assert.AreEqual ("System.String", map.TypeFullName, "#A4");
Assert.AreEqual ("String", map.TypeName, "#A5");
#if ONLY_1_1
schemas = ExportType (typeof (Guid));
importer = new XmlSchemaImporter (schemas);
map = importer.ImportTypeMapping (new XmlQualifiedName ("guid", "NSGuid"));
Assert.IsNotNull (map, "#B1");
Assert.AreEqual ("guid", map.ElementName, "#B2");
Assert.AreEqual ("NSGuid", map.Namespace, "#B3");
Assert.AreEqual ("System.Guid", map.TypeFullName, "#B4");
Assert.AreEqual ("Guid", map.TypeName, "#B5");
#endif
}
[Test]
@@ -943,7 +921,6 @@ namespace MonoTests.System.Xml.Serialization
CodeTypeDeclaration type = FindType (codeNamespace, "TranslationStatus");
Assert.IsNotNull (type, "#10");
#if NET_2_0
CodeMemberProperty property = FindMember (type, "Value") as CodeMemberProperty;
Assert.IsNotNull (property, "#A1");
Assert.IsTrue (property.HasGet, "#A2");
@@ -963,15 +940,6 @@ namespace MonoTests.System.Xml.Serialization
field = FindMember (type, "languageField") as CodeMemberField;
Assert.IsNotNull (field, "#B5");
Assert.AreEqual ("System.Int32", field.Type.BaseType, "#B6");
#else
CodeMemberField field = FindMember (type, "Value") as CodeMemberField;
Assert.IsNotNull (field, "#A1");
Assert.AreEqual ("StatusType", field.Type.BaseType, "#A2");
field = FindMember (type, "Language") as CodeMemberField;
Assert.IsNotNull (field, "#B1");
Assert.AreEqual ("System.Int32", field.Type.BaseType, "#B2");
#endif
}
XmlSchemaImporter CreateSchemaImporter (string xsd)
@@ -999,14 +967,9 @@ namespace MonoTests.System.Xml.Serialization
XmlSchemaImporter imp = CreateSchemaImporter (xsd);
XmlTypeMapping map = imp.ImportTypeMapping (new XmlQualifiedName ("Root"));
CodeNamespace cns = ExportCode (map);
#if NET_2_0
CodeMemberProperty p = (CodeMemberProperty) FindMember (FindType (cns, "Root"), "Bar");
Assert.AreEqual (1, p.Type.TypeArguments.Count, "2.0 #1");
Assert.AreEqual ("System.Int32", p.Type.TypeArguments [0].BaseType, "2.0 #2");
#else
CodeMemberField f = (CodeMemberField) FindMember (FindType (cns, "Root"), "Bar");
Assert.AreEqual ("System.Int32", f.Type.BaseType, "1.x #1");
#endif
}
[Test]
@@ -1037,7 +1000,6 @@ namespace MonoTests.System.Xml.Serialization
Assert.AreEqual ("A", a.ElementName, "#4-1"); // ... element name?
Assert.IsTrue (a.CheckSpecified, "#4-2");
#if NET_2_0
Assert.IsNull (map.TypeName, "#4-3"); // null at this state
Assert.IsNull (map.TypeNamespace, "#4-4"); // null at this state
@@ -1051,7 +1013,6 @@ namespace MonoTests.System.Xml.Serialization
Assert.AreEqual (null, map.TypeName, "#5-3"); // filled after ExportExportMembersMapping().
Assert.AreEqual (null, map.TypeNamespace, "#5-4"); // filled after ExportMembersMapping().
// table contains some internal stuff that does not make sense in any public API.
#endif
}
CodeNamespace ExportCode (XmlTypeMapping map)

View File

@@ -123,9 +123,6 @@ namespace MonoTests.System.XmlSerialization
}
[Test]
#if ONLY_1_1
[Category ("NotDotNet")] // hangs on .NET 1.1
#endif
public void HandleOutAttributeParameters ()
{
XmlReflectionMember m = new XmlReflectionMember ();

View File

@@ -130,11 +130,7 @@ namespace MonoTests.System.XmlSerialization
public void TestFromDateTime()
{
DateTime d = new DateTime();
#if NET_2_0
Assert.AreEqual ("0001-01-01T00:00:00", FromDateTime (d));
#else
Assert.AreEqual ("0001-01-01T00:00:00.0000000", FromDateTime (d).Substring (0, 27));
#endif
}
[Test] // bug #77500
@@ -202,7 +198,6 @@ namespace MonoTests.System.XmlSerialization
long[] ids = {1, 2, 3, 4};
string[] values = {"one", "two", "three", "four"};
#if NET_2_0
try {
FromEnum (8, values, ids);
Assert.Fail ("#A1");
@@ -212,11 +207,7 @@ namespace MonoTests.System.XmlSerialization
Assert.IsTrue (ex.Message.IndexOf ("'8'") != -1, "#A4");
Assert.IsNull (ex.InnerException, "#A5");
}
#else
Assert.AreEqual ("8", FromEnum (8, values, ids), "#A6");
#endif
#if NET_2_0
try {
FromEnum (8, values, ids, "Some.Type.Name");
Assert.Fail ("#B1");
@@ -227,7 +218,6 @@ namespace MonoTests.System.XmlSerialization
Assert.IsTrue (ex.Message.IndexOf ("Some.Type.Name") != -1, "#B5");
Assert.IsNull (ex.InnerException, "#B6");
}
#endif
}
[Test]
@@ -776,15 +766,9 @@ namespace MonoTests.System.XmlSerialization
xsw.ExecuteWriteTypedPrimitive ("x", ANamespace, dateTime, false);
// FIXME: This is a bad test case. The following switch
// should be applied to the entire test.
#if NET_2_0
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"<x xmlns='{0}'>1973-08-13T00:00:00</x>", ANamespace),
xsw.Content, "#1");
#else
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"<x xmlns='{0}'>{1}</x>", ANamespace, FromDateTime (dateTime)),
xsw.Content, "#1");
#endif
xsw.Reset ();
xsw.ExecuteWriteTypedPrimitive ("x", string.Empty, dateTime, false);

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections;
using System.Xml.Serialization;
@@ -119,4 +118,3 @@ namespace MonoTests.System.XmlSerialization
}
}
}
#endif

View File

@@ -13,9 +13,7 @@
using System;
using System.Collections;
#if NET_2_0
using System.Collections.Generic;
#endif
using System.ComponentModel;
using System.Xml;
using System.Xml.Schema;
@@ -68,7 +66,6 @@ namespace MonoTests.System.Xml.TestClasses
#region GenericsTestClasses
#if NET_2_0
public class GenSimpleClass<T>
{
public T something = default (T);
@@ -166,7 +163,6 @@ namespace MonoTests.System.Xml.TestClasses
bb
}
#endif
#endregion // GenericsTestClasses

View File

@@ -1 +1 @@
ef6ba78867fa3b99cb16bbe347f37608795cc92a
dd9daa2f49ee069b61b98e305123c007a3f827ae

View File

@@ -7,7 +7,6 @@
// Copyright (C) 2005 Novell, Inc. http://www.novell.com
//
#if NET_2_0
using System;
using System.Xml;
@@ -792,4 +791,3 @@ namespace MonoTests.System.Xml.XPath
}
}
#endif

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