[corlib] ExecutionContext and other contexts from reference sources. Fixes #28793...
[mono.git] / mcs / class / System.XML / Test / System.Xml.Schema / XmlSchemaTypeTests.cs
1 //
2 // System.Xml.XmlSchemaSetTests.cs
3 //
4 // Author:
5 //      Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // (C) 2004 Novell Inc.
8 //
9
10 using System;
11 using System.Collections;
12 using System.IO;
13 using System.Xml;
14 using System.Xml.Schema;
15 using NUnit.Framework;
16
17 using QName = System.Xml.XmlQualifiedName;
18 using SimpleType = System.Xml.Schema.XmlSchemaSimpleType;
19 using SimpleRest = System.Xml.Schema.XmlSchemaSimpleTypeRestriction;
20 using AssertType = NUnit.Framework.Assert;
21
22 namespace MonoTests.System.Xml
23 {
24         [TestFixture]
25         public class XmlSchemaTypeTests
26         {
27                 string [] all_types = new string [] {
28                         "string", "boolean", "float", "double", "decimal", 
29                         "duration", "dateTime", "time", "date", "gYearMonth", 
30                         "gYear", "gMonthDay", "gDay", "gMonth", "hexBinary", 
31                         "base64Binary", "anyURI", "QName", "NOTATION", 
32                         "normalizedString", "token", "language", "IDREFS",
33                         "ENTITIES", "NMTOKEN", "NMTOKENS", "Name", "NCName",
34                         "ID", "IDREF", "ENTITY", "integer",
35                         "nonPositiveInteger", "negativeInteger", "long",
36                         "int", "short", "byte", "nonNegativeInteger",
37                         "unsignedLong", "unsignedInt", "unsignedShort",
38                         "unsignedByte", "positiveInteger"
39                         };
40
41                 XmlTypeCode [] type_codes = new XmlTypeCode [] {
42                         XmlTypeCode.String,
43                         XmlTypeCode.Boolean,
44                         XmlTypeCode.Float,
45                         XmlTypeCode.Double,
46                         XmlTypeCode.Decimal,
47                         XmlTypeCode.Duration,
48                         XmlTypeCode.DateTime,
49                         XmlTypeCode.Time,
50                         XmlTypeCode.Date,
51                         XmlTypeCode.GYearMonth,
52                         XmlTypeCode.GYear,
53                         XmlTypeCode.GMonthDay,
54                         XmlTypeCode.GDay,
55                         XmlTypeCode.GMonth,
56                         XmlTypeCode.HexBinary,
57                         XmlTypeCode.Base64Binary,
58                         XmlTypeCode.AnyUri,
59                         XmlTypeCode.QName,
60                         XmlTypeCode.Notation,
61                         XmlTypeCode.NormalizedString,
62                         XmlTypeCode.Token,
63                         XmlTypeCode.Language,
64                         XmlTypeCode.Idref, // IDREFS (LAMESPEC)
65                         XmlTypeCode.Entity, // ENTITIES (LAMESPEC)
66                         XmlTypeCode.NmToken,
67                         XmlTypeCode.NmToken, // NMTOKENS (LAMESPEC)
68                         XmlTypeCode.Name,
69                         XmlTypeCode.NCName,
70                         XmlTypeCode.Id,
71                         XmlTypeCode.Idref,
72                         XmlTypeCode.Entity,
73                         XmlTypeCode.Integer,
74                         XmlTypeCode.NonPositiveInteger,
75                         XmlTypeCode.NegativeInteger,
76                         XmlTypeCode.Long,
77                         XmlTypeCode.Int,
78                         XmlTypeCode.Short,
79                         XmlTypeCode.Byte,
80                         XmlTypeCode.NonNegativeInteger,
81                         XmlTypeCode.UnsignedLong,
82                         XmlTypeCode.UnsignedInt,
83                         XmlTypeCode.UnsignedShort,
84                         XmlTypeCode.UnsignedByte,
85                         XmlTypeCode.PositiveInteger};
86
87                 [Test]
88                 public void TypeCode ()
89                 {
90                         for (int i = 0; i < all_types.Length; i++) {
91                                 string name = all_types [i];
92                                 QName qname = new QName (name, XmlSchema.Namespace);
93                                 Assert.AreEqual (type_codes [i],
94                                         XmlSchemaType.GetBuiltInSimpleType (qname).TypeCode, name);
95                         }
96                 }
97
98         }
99 }