diff options
Diffstat (limited to 'mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaDatatypeTests.cs')
-rw-r--r-- | mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaDatatypeTests.cs | 63 |
1 files changed, 11 insertions, 52 deletions
diff --git a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaDatatypeTests.cs b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaDatatypeTests.cs index 71ca0e43c03..e7420bf4a67 100644 --- a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaDatatypeTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaDatatypeTests.cs @@ -24,7 +24,7 @@ using AssertType = NUnit.Framework.Assert; namespace MonoTests.System.Xml { [TestFixture] - public class XmlSchemaDatatypeTests + public class XmlSchemaDatatypeTests : Assertion { private XmlSchema GetSchema (string path) { @@ -41,27 +41,25 @@ namespace MonoTests.System.Xml { XmlSchemaElement element = schema.Items [index] as XmlSchemaElement; XmlSchemaDatatype dataType = element.ElementType as XmlSchemaDatatype; - Assert.AreEqual (tokenizedType, dataType.TokenizedType, "#1"); - Assert.AreEqual (type, dataType.ValueType, "#2"); - Assert.AreEqual (parsedValue, dataType.ParseValue (rawValue, null, null), "#3"); + AssertEquals (tokenizedType, dataType.TokenizedType); + AssertEquals (type, dataType.ValueType); + AssertEquals (parsedValue, dataType.ParseValue (rawValue, null, null)); } [Test] - [Ignore ("The behavior has been inconsistent between versions, so it is not worthy of testing.")] - // Note that it could also apply to BaseTypeName (since if - // it is xs:anyType and BaseType is empty, BaseTypeName - // should be xs:anyType). + [Category ("NotWorking")] // ContentTypeParticle impl. difference. public void TestAnyType () { XmlSchema schema = GetSchema ("Test/XmlFiles/xsd/datatypesTest.xsd"); schema.Compile (null); XmlSchemaElement any = schema.Elements [QName ("e00", "urn:bar")] as XmlSchemaElement; XmlSchemaComplexType cType = any.ElementType as XmlSchemaComplexType; - Assert.AreEqual (typeof (XmlSchemaComplexType), cType.GetType (), "#1"); - Assert.IsNotNull (cType, "#2"); - Assert.AreEqual (XmlQualifiedName.Empty, cType.QualifiedName, "#3"); - Assert.IsNull (cType.BaseSchemaType, "#4"); // In MS.NET 2.0 its null. In 1.1 it is not null. - Assert.IsNotNull (cType.ContentTypeParticle, "#5"); + AssertEquals (typeof (XmlSchemaComplexType), cType.GetType ()); + AssertNotNull (cType); + AssertEquals (XmlQualifiedName.Empty, cType.QualifiedName); + AssertNull (cType.BaseSchemaType); + // In MS.NET its type is "XmlSchemaParticle.EmptyParticle" + AssertNotNull (cType.ContentTypeParticle); } [Test] @@ -82,45 +80,6 @@ namespace MonoTests.System.Xml // AssertDatatype (schema, 6, XmlTokenizedType.NMTOKEN, typeof (string []), "f o o", new string [] {"f", "o", "o"}); } - [Test] - public void AnyUriRelativePath () - { - XmlValidatingReader vr = new XmlValidatingReader ( - new XmlTextReader ( - // relative path value that contains ':' should be still valid. - "<root>../copy/myserver/</root>", - XmlNodeType.Document, null)); - vr.Schemas.Add (XmlSchema.Read ( - new XmlTextReader ("<xs:schema xmlns:xs='" - + XmlSchema.Namespace + - "'><xs:element name='root' type='xs:anyURI' /></xs:schema>", - XmlNodeType.Document, null), null)); - vr.Read (); - vr.Read (); - vr.Read (); - } - - [Test] -#if !NET_2_0 - [Category ("NotDotNet")] -#endif - public void AnyUriRelativePathContainsColon () - { - XmlValidatingReader vr = new XmlValidatingReader ( - new XmlTextReader ( - // relative path value that contains ':' should be still valid. - "<root>../copy/myserver/c:/foo</root>", - XmlNodeType.Document, null)); - vr.Schemas.Add (XmlSchema.Read ( - new XmlTextReader ("<xs:schema xmlns:xs='" - + XmlSchema.Namespace + - "'><xs:element name='root' type='xs:anyURI' /></xs:schema>", - XmlNodeType.Document, null), null)); - vr.Read (); - vr.Read (); - vr.Read (); - } - #if NET_2_0 string [] allTypes = new string [] { "string", "boolean", "float", "double", "decimal", |