2 // System.Xml.Serialization.SoapReflectionImporterTests
5 // Gert Driesen (drieseng@users.sourceforge.net)
11 using System.Collections;
12 using DefaultValueAttribute = System.ComponentModel.DefaultValueAttribute;
14 using System.Xml.Schema;
15 using System.Xml.Serialization;
17 using NUnit.Framework;
19 using MonoTests.System.Xml.TestClasses;
21 namespace MonoTests.System.XmlSerialization
24 public class SoapReflectionImporterTests
26 private const string SomeNamespace = "some:urn";
27 private const string AnotherNamespace = "another:urn";
28 private const string XmlSchemaNamespace = "http://www.w3.org/2001/XMLSchema";
29 private const string WsdlTypesNamespace = "http://microsoft.com/wsdl/types/";
31 // these Map methods re-create the SoapReflectionImporter at every call.
33 private XmlTypeMapping Map (Type t)
35 SoapReflectionImporter ri = new SoapReflectionImporter ();
36 XmlTypeMapping tm = ri.ImportTypeMapping (t);
41 private XmlTypeMapping Map (Type t, string ns)
43 SoapReflectionImporter ri = new SoapReflectionImporter (ns);
44 XmlTypeMapping tm = ri.ImportTypeMapping (t);
49 private XmlTypeMapping Map (Type t, SoapAttributeOverrides overrides)
51 SoapReflectionImporter ri = new SoapReflectionImporter(overrides);
52 XmlTypeMapping tm = ri.ImportTypeMapping(t);
57 private XmlMembersMapping MembersMap (Type t, SoapAttributeOverrides overrides,
58 XmlReflectionMember [] members, bool inContainer, bool writeAccessors)
60 SoapReflectionImporter ri = new SoapReflectionImporter (overrides);
61 XmlMembersMapping mm = ri.ImportMembersMapping (null, null, members,
62 inContainer, writeAccessors);
68 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
69 public void TestIntTypeMapping ()
71 XmlTypeMapping tm = Map (typeof (int));
72 Assert.AreEqual ("int", tm.ElementName, "#1");
73 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
74 Assert.AreEqual ("Int32", tm.TypeName, "#3");
75 Assert.AreEqual ("System.Int32", tm.TypeFullName, "#4");
79 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
80 public void TestIntTypeMapping_DefaultNamespace ()
82 XmlTypeMapping tm = Map (typeof (int), SomeNamespace);
83 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
85 tm = Map (typeof (int[]), SomeNamespace);
86 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
88 tm = Map (typeof (int[][]), SomeNamespace);
89 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
93 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
94 public void TestIntTypeMapping_Array ()
96 XmlTypeMapping tm = Map (typeof (int[]));
97 Assert.AreEqual ("ArrayOfInt", tm.ElementName, "#A1");
98 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
100 Assert.AreEqual ("ArrayOfInt32", tm.TypeName, "#A3");
102 Assert.AreEqual ("Int32[]", tm.TypeName, "#A3");
104 Assert.AreEqual ("System.Int32[]", tm.TypeFullName, "#A4");
106 tm = Map (typeof (int[][]));
107 Assert.AreEqual ("ArrayOfArrayOfInt", tm.ElementName, "#B1");
108 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
110 Assert.AreEqual ("ArrayOfArrayOfInt32", tm.TypeName, "#B3");
112 Assert.AreEqual ("Int32[][]", tm.TypeName, "#B3");
114 Assert.AreEqual ("System.Int32[][]", tm.TypeFullName, "#B4");
118 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
119 public void TestStringTypeMapping ()
121 XmlTypeMapping tm = Map (typeof (string));
122 Assert.AreEqual ("string", tm.ElementName, "#1");
123 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
124 Assert.AreEqual ("String", tm.TypeName, "#3");
125 Assert.AreEqual ("System.String", tm.TypeFullName, "#4");
129 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
130 public void TestStringTypeMapping_DefaultNamespace ()
132 XmlTypeMapping tm = Map (typeof (string), SomeNamespace);
133 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
135 tm = Map (typeof (string[]), SomeNamespace);
136 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
138 tm = Map (typeof (string[][]), SomeNamespace);
139 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
143 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
144 public void TestStringTypeMapping_Array ()
146 XmlTypeMapping tm = Map (typeof (string[]));
147 Assert.AreEqual ("ArrayOfString", tm.ElementName, "#A1");
148 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
150 Assert.AreEqual ("ArrayOfString", tm.TypeName, "#A3");
152 Assert.AreEqual ("String[]", tm.TypeName, "#A3");
154 Assert.AreEqual ("System.String[]", tm.TypeFullName, "#A4");
156 tm = Map (typeof (string[][]));
157 Assert.AreEqual ("ArrayOfArrayOfString", tm.ElementName, "#B1");
158 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
160 Assert.AreEqual ("ArrayOfArrayOfString", tm.TypeName, "#B3");
162 Assert.AreEqual ("String[][]", tm.TypeName, "#B3");
164 Assert.AreEqual ("System.String[][]", tm.TypeFullName, "#B4");
168 public void TestObjectTypeMapping ()
170 XmlTypeMapping tm = Map (typeof (object));
171 Assert.AreEqual ("anyType", tm.ElementName, "#1");
172 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
173 Assert.AreEqual ("Object", tm.TypeName, "#3");
174 Assert.AreEqual ("System.Object", tm.TypeFullName, "#4");
178 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
179 public void TestObjectTypeMapping_DefaultNamespace ()
181 XmlTypeMapping tm = Map (typeof (object), SomeNamespace);
182 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
184 tm = Map (typeof (object[]), SomeNamespace);
185 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
187 tm = Map (typeof (object[][]), SomeNamespace);
188 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
192 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
193 public void TestObjectTypeMapping_Array ()
195 XmlTypeMapping tm = Map (typeof (object[]));
196 Assert.AreEqual ("ArrayOfAnyType", tm.ElementName, "#A1");
197 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
199 Assert.AreEqual ("ArrayOfObject", tm.TypeName, "#A3");
201 Assert.AreEqual ("Object[]", tm.TypeName, "#A3");
203 Assert.AreEqual ("System.Object[]", tm.TypeFullName, "#A4");
205 tm = Map (typeof (object[][]));
206 Assert.AreEqual ("ArrayOfArrayOfAnyType", tm.ElementName, "#B1");
207 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
209 Assert.AreEqual ("ArrayOfArrayOfObject", tm.TypeName, "#B3");
211 Assert.AreEqual ("Object[][]", tm.TypeName, "#B3");
213 Assert.AreEqual ("System.Object[][]", tm.TypeFullName, "#B4");
217 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
218 public void TestByteTypeMapping ()
220 XmlTypeMapping tm = Map (typeof (byte));
221 Assert.AreEqual ("unsignedByte", tm.ElementName, "#1");
222 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
223 Assert.AreEqual ("Byte", tm.TypeName, "#3");
224 Assert.AreEqual ("System.Byte", tm.TypeFullName, "#4");
228 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
229 public void TestByteTypeMapping_DefaultNamespace ()
231 XmlTypeMapping tm = Map (typeof (byte), SomeNamespace);
232 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
234 tm = Map (typeof (byte[]), SomeNamespace);
235 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
237 tm = Map (typeof (byte[][]), SomeNamespace);
238 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
242 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
243 public void TestByteTypeMapping_Array ()
245 XmlTypeMapping tm = Map (typeof (byte[]));
246 Assert.AreEqual ("base64Binary", tm.ElementName, "#A1");
247 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#A2");
248 Assert.AreEqual ("Byte[]", tm.TypeName, "#A3");
249 Assert.AreEqual ("System.Byte[]", tm.TypeFullName, "#A4");
251 tm = Map (typeof (byte[][]));
252 Assert.AreEqual ("ArrayOfBase64Binary", tm.ElementName, "#B1");
253 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
255 Assert.AreEqual ("ArrayOfArrayOfByte", tm.TypeName, "#B3");
257 Assert.AreEqual ("Byte[][]", tm.TypeName, "#B3");
259 Assert.AreEqual ("System.Byte[][]", tm.TypeFullName, "#B4");
263 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
264 public void TestBoolTypeMapping ()
266 XmlTypeMapping tm = Map (typeof (bool));
267 Assert.AreEqual ("boolean", tm.ElementName, "#1");
268 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
269 Assert.AreEqual ("Boolean", tm.TypeName, "#3");
270 Assert.AreEqual ("System.Boolean", tm.TypeFullName, "#4");
274 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
275 public void TestBoolTypeMapping_DefaultNamespace ()
277 XmlTypeMapping tm = Map (typeof (bool), "http://somenamespace");
278 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
280 tm = Map (typeof (bool[]), SomeNamespace);
281 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
283 tm = Map (typeof (bool[][]), SomeNamespace);
284 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
288 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
289 public void TestShortTypeMapping ()
291 XmlTypeMapping tm = Map (typeof (short));
292 Assert.AreEqual ("short", tm.ElementName, "#1");
293 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
294 Assert.AreEqual ("Int16", tm.TypeName, "#3");
295 Assert.AreEqual ("System.Int16", tm.TypeFullName, "#4");
299 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
300 public void TestShortTypeMapping_DefaultNamespace ()
302 XmlTypeMapping tm = Map (typeof (short), SomeNamespace);
303 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
305 tm = Map (typeof (short[]), SomeNamespace);
306 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
308 tm = Map (typeof (short[][]), SomeNamespace);
309 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
313 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
314 public void TestUnsignedShortTypeMapping ()
316 XmlTypeMapping tm = Map (typeof (ushort));
317 Assert.AreEqual ("unsignedShort", tm.ElementName, "#1");
318 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
319 Assert.AreEqual ("UInt16", tm.TypeName, "#3");
320 Assert.AreEqual ("System.UInt16", tm.TypeFullName, "#4");
324 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
325 public void TestUnsignedShortTypeMapping_DefaultNamespace ()
327 XmlTypeMapping tm = Map (typeof (ushort), SomeNamespace);
328 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
330 tm = Map (typeof (ushort[]), SomeNamespace);
331 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
333 tm = Map (typeof (ushort[][]), SomeNamespace);
334 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
338 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
339 public void TestUIntTypeMapping ()
341 XmlTypeMapping tm = Map (typeof (uint));
342 Assert.AreEqual ("unsignedInt", tm.ElementName, "#1");
343 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
344 Assert.AreEqual ("UInt32", tm.TypeName, "#3");
345 Assert.AreEqual ("System.UInt32", tm.TypeFullName, "#4");
349 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
350 public void TestUIntTypeMapping_DefaultNamespace ()
352 XmlTypeMapping tm = Map (typeof (uint), SomeNamespace);
353 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
355 tm = Map (typeof (uint[]), SomeNamespace);
356 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
358 tm = Map (typeof (uint[][]), SomeNamespace);
359 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
363 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
364 public void TestLongTypeMapping ()
366 XmlTypeMapping tm = Map (typeof (long));
367 Assert.AreEqual ("long", tm.ElementName, "#1");
368 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
369 Assert.AreEqual ("Int64", tm.TypeName, "#3");
370 Assert.AreEqual ("System.Int64", tm.TypeFullName, "#4");
374 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
375 public void TestLongTypeMapping_DefaultNamespace ()
377 XmlTypeMapping tm = Map (typeof (long), SomeNamespace);
378 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
380 tm = Map (typeof (long[]), SomeNamespace);
381 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
383 tm = Map (typeof (long[][]), SomeNamespace);
384 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
388 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
389 public void TestULongTypeMapping ()
391 XmlTypeMapping tm = Map (typeof (ulong));
392 Assert.AreEqual ("unsignedLong", tm.ElementName, "#1");
393 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
394 Assert.AreEqual ("UInt64", tm.TypeName, "#3");
395 Assert.AreEqual ("System.UInt64", tm.TypeFullName, "#4");
399 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
400 public void TestULongTypeMapping_DefaultNamespace ()
402 XmlTypeMapping tm = Map (typeof (ulong), SomeNamespace);
403 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
405 tm = Map (typeof (ulong[]), SomeNamespace);
406 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
408 tm = Map (typeof (ulong[][]), SomeNamespace);
409 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
413 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
414 public void TestFloatTypeMapping ()
416 XmlTypeMapping tm = Map (typeof (float));
417 Assert.AreEqual ("float", tm.ElementName, "#1");
418 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
419 Assert.AreEqual ("Single", tm.TypeName, "#3");
420 Assert.AreEqual ("System.Single", tm.TypeFullName, "#4");
424 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
425 public void TestFloatTypeMapping_DefaultNamespace ()
427 XmlTypeMapping tm = Map (typeof (float), SomeNamespace);
428 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
430 tm = Map (typeof (float[]), SomeNamespace);
431 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
433 tm = Map (typeof (float[][]), SomeNamespace);
434 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
438 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
439 public void TestDoubleTypeMapping ()
441 XmlTypeMapping tm = Map (typeof (double));
442 Assert.AreEqual ("double", tm.ElementName, "#1");
443 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
444 Assert.AreEqual ("Double", tm.TypeName, "#3");
445 Assert.AreEqual ("System.Double", tm.TypeFullName, "#4");
449 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
450 public void TestDoubleTypeMapping_DefaultNamespace ()
452 XmlTypeMapping tm = Map (typeof (double), SomeNamespace);
453 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
455 tm = Map (typeof (double[]), SomeNamespace);
456 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
458 tm = Map (typeof (double[][]), SomeNamespace);
459 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
463 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
464 public void TestDateTimeTypeMapping ()
466 XmlTypeMapping tm = Map (typeof (DateTime));
467 Assert.AreEqual ("dateTime", tm.ElementName, "#1");
468 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
469 Assert.AreEqual ("DateTime", tm.TypeName, "#3");
470 Assert.AreEqual ("System.DateTime", tm.TypeFullName, "#4");
474 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
475 public void TestDateTimeTypeMapping_DefaultNamespace ()
477 XmlTypeMapping tm = Map (typeof (DateTime), SomeNamespace);
478 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
480 tm = Map (typeof (DateTime[]), SomeNamespace);
481 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
483 tm = Map (typeof (DateTime[][]), SomeNamespace);
484 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
488 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
489 public void TestDateTimeTypeMapping_Array ()
491 XmlTypeMapping tm = Map (typeof (DateTime[]));
492 Assert.AreEqual ("ArrayOfDateTime", tm.ElementName, "#A1");
493 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
495 Assert.AreEqual ("ArrayOfDateTime", tm.TypeName, "#A3");
497 Assert.AreEqual ("DateTime[]", tm.TypeName, "#A3");
499 Assert.AreEqual ("System.DateTime[]", tm.TypeFullName, "#A4");
501 tm = Map (typeof (DateTime[][]));
502 Assert.AreEqual ("ArrayOfArrayOfDateTime", tm.ElementName, "#B1");
503 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
505 Assert.AreEqual ("ArrayOfArrayOfDateTime", tm.TypeName, "#B3");
507 Assert.AreEqual ("DateTime[][]", tm.TypeName, "#B3");
509 Assert.AreEqual ("System.DateTime[][]", tm.TypeFullName, "#B4");
513 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
514 public void TestGuidTypeMapping ()
516 XmlTypeMapping tm = Map (typeof (Guid));
517 Assert.AreEqual ("guid", tm.ElementName, "#1");
518 Assert.AreEqual (WsdlTypesNamespace, tm.Namespace, "#2");
519 Assert.AreEqual ("Guid", tm.TypeName, "#3");
520 Assert.AreEqual ("System.Guid", tm.TypeFullName, "#4");
524 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
525 public void TestGuidTypeMapping_DefaultNamespace ()
527 XmlTypeMapping tm = Map (typeof (Guid), SomeNamespace);
528 Assert.AreEqual (WsdlTypesNamespace, tm.Namespace, "#1");
530 tm = Map (typeof (Guid[]), SomeNamespace);
531 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
533 tm = Map (typeof (Guid[][]), SomeNamespace);
534 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
538 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
539 public void TestGuidTypeMapping_Array ()
541 XmlTypeMapping tm = Map (typeof (Guid[]));
542 Assert.AreEqual ("ArrayOfGuid", tm.ElementName, "#A1");
543 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
545 Assert.AreEqual ("ArrayOfGuid", tm.TypeName, "#A3");
547 Assert.AreEqual ("Guid[]", tm.TypeName, "#A3");
549 Assert.AreEqual ("System.Guid[]", tm.TypeFullName, "#A4");
551 tm = Map (typeof (Guid[][]));
552 Assert.AreEqual ("ArrayOfArrayOfGuid", tm.ElementName, "#B1");
553 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
555 Assert.AreEqual ("ArrayOfArrayOfGuid", tm.TypeName, "#B3");
557 Assert.AreEqual ("Guid[][]", tm.TypeName, "#B3");
559 Assert.AreEqual ("System.Guid[][]", tm.TypeFullName, "#B4");
563 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
564 public void TestDecimalTypeMapping ()
566 XmlTypeMapping tm = Map (typeof (decimal));
567 Assert.AreEqual ("decimal", tm.ElementName, "#1");
568 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
569 Assert.AreEqual ("Decimal", tm.TypeName, "#3");
570 Assert.AreEqual ("System.Decimal", tm.TypeFullName, "#4");
574 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
575 public void TestDecimalTypeMapping_DefaultNamespace ()
577 XmlTypeMapping tm = Map (typeof (decimal), SomeNamespace);
578 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
580 tm = Map (typeof (decimal[]), SomeNamespace);
581 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
583 tm = Map (typeof (decimal[][]), SomeNamespace);
584 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
588 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
589 public void TestXmlQualifiedNameTypeMapping ()
591 XmlTypeMapping tm = Map (typeof (XmlQualifiedName));
592 Assert.AreEqual ("QName", tm.ElementName, "#1");
593 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
594 Assert.AreEqual ("XmlQualifiedName", tm.TypeName, "#3");
595 Assert.AreEqual ("System.Xml.XmlQualifiedName", tm.TypeFullName, "#4");
599 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
600 public void TestXmlQualifiedNameTypeMapping_DefaultNamespace ()
602 XmlTypeMapping tm = Map (typeof (XmlQualifiedName), SomeNamespace);
603 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
605 tm = Map (typeof (XmlQualifiedName[]), SomeNamespace);
606 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
608 tm = Map (typeof (XmlQualifiedName[][]), SomeNamespace);
609 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
613 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
614 public void TestXmlQualifiedNameTypeMapping_Array ()
616 XmlTypeMapping tm = Map (typeof (XmlQualifiedName[]));
617 Assert.AreEqual ("ArrayOfQName", tm.ElementName, "#A1");
618 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
620 Assert.AreEqual ("ArrayOfXmlQualifiedName", tm.TypeName, "#A3");
622 Assert.AreEqual ("XmlQualifiedName[]", tm.TypeName, "#A3");
624 Assert.AreEqual ("System.Xml.XmlQualifiedName[]", tm.TypeFullName, "#A4");
626 tm = Map (typeof (XmlQualifiedName[][]));
627 Assert.AreEqual ("ArrayOfArrayOfQName", tm.ElementName, "#B1");
628 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
630 Assert.AreEqual ("ArrayOfArrayOfXmlQualifiedName", tm.TypeName, "#B3");
632 Assert.AreEqual ("XmlQualifiedName[][]", tm.TypeName, "#B3");
634 Assert.AreEqual ("System.Xml.XmlQualifiedName[][]", tm.TypeFullName, "#B4");
638 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
639 public void TestSByteTypeMapping ()
641 XmlTypeMapping tm = Map (typeof (sbyte));
642 Assert.AreEqual ("byte", tm.ElementName, "#1");
643 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#2");
644 Assert.AreEqual ("SByte", tm.TypeName, "#3");
645 Assert.AreEqual ("System.SByte", tm.TypeFullName, "#4");
649 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
650 public void TestSByteTypeMapping_DefaultNamespace ()
652 XmlTypeMapping tm = Map (typeof (sbyte), SomeNamespace);
653 Assert.AreEqual (XmlSchemaNamespace, tm.Namespace, "#1");
655 tm = Map (typeof (sbyte[]), SomeNamespace);
656 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
658 tm = Map (typeof (sbyte[][]), SomeNamespace);
659 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
663 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
664 public void TestSByteTypeMapping_Array ()
666 XmlTypeMapping tm = Map (typeof (sbyte[]));
667 Assert.AreEqual ("ArrayOfByte", tm.ElementName, "#A1");
668 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
670 Assert.AreEqual ("ArrayOfSByte", tm.TypeName, "#A3");
672 Assert.AreEqual ("SByte[]", tm.TypeName, "#A3");
674 Assert.AreEqual ("System.SByte[]", tm.TypeFullName, "#A4");
676 tm = Map (typeof (sbyte[][]));
677 Assert.AreEqual ("ArrayOfArrayOfByte", tm.ElementName, "#B1");
678 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
680 Assert.AreEqual ("ArrayOfArrayOfSByte", tm.TypeName, "#B3");
682 Assert.AreEqual ("SByte[][]", tm.TypeName, "#B3");
684 Assert.AreEqual ("System.SByte[][]", tm.TypeFullName, "#B4");
688 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
689 public void TestCharTypeMapping()
691 XmlTypeMapping tm = Map (typeof (char));
692 Assert.AreEqual ("char", tm.ElementName, "#1");
693 Assert.AreEqual (WsdlTypesNamespace, tm.Namespace, "#2");
694 Assert.AreEqual ("Char", tm.TypeName, "#3");
695 Assert.AreEqual ("System.Char", tm.TypeFullName, "#4");
699 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
700 public void TestCharTypeMapping_DefaultNamespace ()
702 XmlTypeMapping tm = Map (typeof (char), SomeNamespace);
703 Assert.AreEqual (WsdlTypesNamespace, tm.Namespace, "#1");
705 tm = Map (typeof (char[]), SomeNamespace);
706 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
708 tm = Map (typeof (char[][]), SomeNamespace);
709 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
713 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
714 public void TestCharTypeMapping_Array ()
716 XmlTypeMapping tm = Map (typeof (char[]));
717 Assert.AreEqual ("ArrayOfChar", tm.ElementName, "#A1");
718 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
720 Assert.AreEqual ("ArrayOfChar", tm.TypeName, "#A3");
722 Assert.AreEqual ("Char[]", tm.TypeName, "#A3");
724 Assert.AreEqual ("System.Char[]", tm.TypeFullName, "#A4");
726 tm = Map (typeof (char[][]));
727 Assert.AreEqual ("ArrayOfArrayOfChar", tm.ElementName, "#B1");
728 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
730 Assert.AreEqual ("ArrayOfArrayOfChar", tm.TypeName, "#B3");
732 Assert.AreEqual ("Char[][]", tm.TypeName, "#B3");
734 Assert.AreEqual ("System.Char[][]", tm.TypeFullName, "#B4");
738 public void TestXmlNodeTypeMapping ()
741 Map (typeof (XmlNode));
743 } catch (NotSupportedException) {
744 // The type System.Xml.XmlNode may not be serialized with SOAP-encoded messages.
748 Map (typeof (XmlNode[]));
750 } catch (NotSupportedException) {
751 // The type System.Xml.XmlNode may not be serialized with SOAP-encoded messages.
755 Map (typeof (XmlNode[][]));
757 } catch (NotSupportedException) {
758 // The type System.Xml.XmlNode may not be serialized with SOAP-encoded messages.
763 public void TestXmlNodeTypeMapping_DefaultNamespace ()
766 Map (typeof (XmlNode), SomeNamespace);
768 } catch (NotSupportedException) {
769 // The type System.Xml.XmlNode may not be serialized with SOAP-encoded messages.
773 Map (typeof (XmlNode[]), SomeNamespace);
775 } catch (NotSupportedException) {
776 // The type System.Xml.XmlNode may not be serialized with SOAP-encoded messages.
780 Map (typeof (XmlNode[][]), SomeNamespace);
782 } catch (NotSupportedException) {
783 // The type System.Xml.XmlNode may not be serialized with SOAP-encoded messages.
788 public void TestXmlElementTypeMapping ()
791 Map (typeof (XmlElement));
793 } catch (NotSupportedException) {
794 // The type System.Xml.XmlElement may not be serialized with SOAP-encoded messages.
798 Map (typeof (XmlElement[]));
800 } catch (NotSupportedException) {
801 // The type System.Xml.XmlElement may not be serialized with SOAP-encoded messages.
805 Map (typeof (XmlElement[][]));
807 } catch (NotSupportedException) {
808 // The type System.Xml.XmlElement may not be serialized with SOAP-encoded messages.
813 public void TestXmlElementTypeMapping_DefaultNamespace ()
816 Map (typeof (XmlElement), SomeNamespace);
818 } catch (NotSupportedException) {
819 // The type System.Xml.XmlElement may not be serialized with SOAP-encoded messages.
823 Map (typeof (XmlElement[]), SomeNamespace);
825 } catch (NotSupportedException) {
826 // The type System.Xml.XmlElement may not be serialized with SOAP-encoded messages.
830 Map (typeof (XmlElement[][]), SomeNamespace);
832 } catch (NotSupportedException) {
833 // The type System.Xml.XmlElement may not be serialized with SOAP-encoded messages.
838 public void TestXmlNotationTypeMapping ()
841 Map (typeof (XmlNotation));
843 } catch (NotSupportedException) {
844 // The type System.Xml.XmlNotation may not be serialized with SOAP-encoded messages.
848 Map (typeof (XmlNotation[]));
850 } catch (NotSupportedException) {
851 // The type System.Xml.XmlNotation may not be serialized with SOAP-encoded messages.
855 Map (typeof (XmlNotation[][]));
857 } catch (NotSupportedException) {
858 // The type System.Xml.XmlNotation may not be serialized with SOAP-encoded messages.
863 public void TestXmlNotationTypeMapping_DefaultNamespace ()
866 Map (typeof (XmlNotation), SomeNamespace);
868 } catch (NotSupportedException) {
869 // The type System.Xml.XmlNotation may not be serialized with SOAP-encoded messages.
873 Map (typeof (XmlNotation[]), SomeNamespace);
875 } catch (NotSupportedException) {
876 // The type System.Xml.XmlNotation may not be serialized with SOAP-encoded messages.
880 Map (typeof (XmlNotation[][]), SomeNamespace);
882 } catch (NotSupportedException) {
883 // The type System.Xml.XmlNotation may not be serialized with SOAP-encoded messages.
888 [ExpectedException (typeof (NotSupportedException))]
889 public void TestXmlSerializableTypeMapping ()
891 Map (typeof (Employee));
895 [Category ("NotWorking")]
896 [ExpectedException (typeof (NotSupportedException))]
897 public void TestClassTypeMapping_NestedStruct ()
899 Map (typeof (NestedStruct));
903 [ExpectedException (typeof (ArgumentNullException))]
904 public void TestNullTypeMapping()
910 [ExpectedException (typeof (ArgumentNullException))]
911 public void TestNullTypeMapping_DefaultNamespace ()
913 Map (null, SomeNamespace);
917 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
918 public void TestStructTypeMapping ()
920 XmlTypeMapping tm = Map (typeof (TimeSpan));
921 Assert.AreEqual ("TimeSpan", tm.ElementName, "#1");
922 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
923 Assert.AreEqual ("TimeSpan", tm.TypeName, "#3");
924 Assert.AreEqual ("System.TimeSpan", tm.TypeFullName, "#4");
928 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
929 public void TestStructTypeMapping_DefaultNamespace ()
931 XmlTypeMapping tm = Map (typeof (TimeSpan), SomeNamespace);
932 Assert.AreEqual (SomeNamespace, tm.Namespace, "#1");
935 tm = Map (typeof (TimeSpan[]), SomeNamespace);
937 } catch (NotSupportedException) {
941 tm = Map (typeof (TimeSpan[][]), SomeNamespace);
943 } catch (NotSupportedException) {
948 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
949 [ExpectedException (typeof (NotSupportedException))] // Arrays of structs are not supported with encoded SOAP.
950 public void TestStructTypeMapping_Array ()
952 Map (typeof (TimeSpan[]));
956 public void TestEnumTypeMapping ()
958 XmlTypeMapping tm = Map (typeof (AttributeTargets));
959 Assert.AreEqual ("AttributeTargets", tm.ElementName, "#1");
960 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
961 Assert.AreEqual ("AttributeTargets", tm.TypeName, "#3");
962 Assert.AreEqual ("System.AttributeTargets", tm.TypeFullName, "#4");
966 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
967 public void TestEnumTypeMapping_DefaultNamespace ()
969 XmlTypeMapping tm = Map (typeof (AttributeTargets), SomeNamespace);
970 Assert.AreEqual (SomeNamespace, tm.Namespace, "#1");
972 tm = Map (typeof (AttributeTargets[]), SomeNamespace);
973 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
975 tm = Map (typeof (AttributeTargets[][]), SomeNamespace);
976 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
980 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
981 public void TestEnumTypeMapping_Array ()
983 XmlTypeMapping tm = Map (typeof (AttributeTargets[]));
984 Assert.AreEqual ("ArrayOfAttributeTargets", tm.ElementName, "#A1");
985 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
987 Assert.AreEqual ("ArrayOfAttributeTargets", tm.TypeName, "#A3");
989 Assert.AreEqual ("AttributeTargets[]", tm.TypeName, "#A3");
991 Assert.AreEqual ("System.AttributeTargets[]", tm.TypeFullName, "#A4");
993 tm = Map (typeof (AttributeTargets[][]));
994 Assert.AreEqual ("ArrayOfArrayOfAttributeTargets", tm.ElementName, "#B1");
995 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
997 Assert.AreEqual ("ArrayOfArrayOfAttributeTargets", tm.TypeName, "#B3");
999 Assert.AreEqual ("AttributeTargets[][]", tm.TypeName, "#B3");
1001 Assert.AreEqual ("System.AttributeTargets[][]", tm.TypeFullName, "#B4");
1005 public void TestClassTypeMapping()
1007 XmlTypeMapping tm = Map (typeof (SimpleClass));
1008 Assert.AreEqual ("SimpleClass", tm.ElementName, "#1");
1009 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
1010 Assert.AreEqual ("SimpleClass", tm.TypeName, "#3");
1011 Assert.AreEqual ("MonoTests.System.Xml.TestClasses.SimpleClass", tm.TypeFullName, "#4");
1015 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
1016 public void TestClassTypeMapping_DefaultNamespace ()
1018 XmlTypeMapping tm = Map (typeof (SimpleClass), SomeNamespace);
1019 Assert.AreEqual (SomeNamespace, tm.Namespace, "#1");
1021 tm = Map (typeof (SimpleClass[]), SomeNamespace);
1022 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
1024 tm = Map (typeof (SimpleClass[][]), SomeNamespace);
1025 Assert.AreEqual (SomeNamespace, tm.Namespace, "#3");
1029 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
1030 public void TestClassTypeMapping_Array ()
1032 XmlTypeMapping tm = Map (typeof (SimpleClass[]));
1033 Assert.AreEqual ("ArrayOfSimpleClass", tm.ElementName, "#A1");
1034 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
1036 Assert.AreEqual ("ArrayOfSimpleClass", tm.TypeName, "#A3");
1038 Assert.AreEqual ("SimpleClass[]", tm.TypeName, "#A3");
1040 Assert.AreEqual ("MonoTests.System.Xml.TestClasses.SimpleClass[]", tm.TypeFullName, "#A4");
1042 tm = Map (typeof (SimpleClass[][]));
1043 Assert.AreEqual ("ArrayOfArrayOfSimpleClass", tm.ElementName, "#B1");
1044 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
1046 Assert.AreEqual ("ArrayOfArrayOfSimpleClass", tm.TypeName, "#B3");
1048 Assert.AreEqual ("SimpleClass[][]", tm.TypeName, "#B3");
1050 Assert.AreEqual ("MonoTests.System.Xml.TestClasses.SimpleClass[][]", tm.TypeFullName, "#B4");
1055 [Category ("NotDotNet")] // wrong error message is reported in .NET 1.1
1057 public void TypeMapping_Attribute_ComplexType ()
1059 SoapAttributes attrs = new SoapAttributes (typeof (Field_Encoded).GetMember ("Names")[0]);
1060 attrs.SoapAttribute = new SoapAttributeAttribute (); // SoapAttribute cannot be used to encode complex types
1061 SoapAttributeOverrides overrides = new SoapAttributeOverrides ();
1062 overrides.Add (typeof (Field_Encoded), "Names", attrs);
1065 Map (typeof (Field_Encoded), overrides);
1066 Assert.Fail ("#A1");
1067 } catch (InvalidOperationException ex) {
1068 // Cannot serialize member 'Names' of type System.String[].
1069 // SoapAttribute cannot be used to encode complex types.
1070 Assert.IsNotNull (ex.Message, "#A2");
1071 Assert.IsTrue (ex.Message.IndexOf (typeof (string[]).FullName) != -1, "#A3");
1072 Assert.IsTrue (ex.Message.IndexOf ("SoapAttribute") != -1, "#A4");
1073 Assert.IsNull (ex.InnerException, "#A5");
1078 public void TypeMapping_Field ()
1080 XmlTypeMapping tm = Map (typeof (Field));
1081 Assert.AreEqual ("Field", tm.ElementName, "#1");
1082 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
1083 Assert.AreEqual ("Field", tm.TypeName, "#3");
1084 Assert.AreEqual ("MonoTests.System.Xml.TestClasses.Field", tm.TypeFullName, "#4");
1088 public void TypeMapping_Field_DefaultNamespace ()
1090 XmlTypeMapping tm = Map (typeof (Field), SomeNamespace);
1091 Assert.AreEqual ("Field", tm.ElementName, "#1");
1092 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
1093 Assert.AreEqual ("Field", tm.TypeName, "#3");
1094 Assert.AreEqual ("MonoTests.System.Xml.TestClasses.Field", tm.TypeFullName, "#4");
1098 public void TypeMapping_Field_Encoded ()
1100 XmlTypeMapping tm = Map (typeof (Field_Encoded));
1101 Assert.AreEqual ("field", tm.ElementName, "#1");
1102 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
1103 Assert.AreEqual ("Field_Encoded", tm.TypeName, "#3");
1104 Assert.AreEqual ("MonoTests.System.Xml.TestClasses.Field_Encoded", tm.TypeFullName, "#4");
1108 public void TypeMapping_Field_Encoded_DefaultNamespace ()
1110 XmlTypeMapping tm = Map (typeof (Field_Encoded), AnotherNamespace);
1111 Assert.AreEqual ("field", tm.ElementName, "#1");
1112 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
1113 Assert.AreEqual ("Field_Encoded", tm.TypeName, "#3");
1114 Assert.AreEqual ("MonoTests.System.Xml.TestClasses.Field_Encoded", tm.TypeFullName, "#4");
1118 public void TypeMapping_FlagEnum ()
1120 XmlTypeMapping tm = Map (typeof (FlagEnum));
1121 Assert.AreEqual ("FlagEnum", tm.ElementName, "#1");
1122 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
1123 Assert.AreEqual ("FlagEnum", tm.TypeName, "#3");
1124 Assert.AreEqual ("MonoTests.System.Xml.TestClasses.FlagEnum", tm.TypeFullName, "#4");
1128 public void TypeMapping_FlagEnum_DefaultNamespace ()
1130 XmlTypeMapping tm = Map (typeof (FlagEnum), SomeNamespace);
1131 Assert.AreEqual ("FlagEnum", tm.ElementName, "#1");
1132 Assert.AreEqual (SomeNamespace, tm.Namespace, "#2");
1133 Assert.AreEqual ("FlagEnum", tm.TypeName, "#3");
1134 Assert.AreEqual ("MonoTests.System.Xml.TestClasses.FlagEnum", tm.TypeFullName, "#4");
1138 [ExpectedException (typeof (NotSupportedException))]
1139 public void TypeMapping_IDictionary ()
1141 // The type MonoTests.System.Xml.TestClasses.DictionaryWithIndexer
1142 // is not supported because it implements IDictionary.
1143 Map (typeof (DictionaryWithIndexer));
1147 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
1148 public void TypeMapping_IEnumerable_SimpleClass ()
1150 XmlTypeMapping tm = Map (typeof (SimpleClassEnumerable));
1151 Assert.AreEqual ("ArrayOfSimpleClass", tm.ElementName, "#1");
1152 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
1153 Assert.AreEqual ("SimpleClassEnumerable", tm.TypeName, "#3");
1154 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerable", tm.TypeFullName, "#4");
1156 tm = Map (typeof (SimpleClassEnumerable[]));
1157 Assert.AreEqual ("ArrayOfArrayOfSimpleClass", tm.ElementName, "#A1");
1158 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
1160 Assert.AreEqual ("ArrayOfSimpleClassEnumerable", tm.TypeName, "#A3");
1162 Assert.AreEqual ("SimpleClassEnumerable[]", tm.TypeName, "#A3");
1164 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerable[]", tm.TypeFullName, "#A4");
1166 tm = Map (typeof (SimpleClassEnumerable[][]));
1167 Assert.AreEqual ("ArrayOfArrayOfArrayOfSimpleClass", tm.ElementName, "#B1");
1168 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
1170 Assert.AreEqual ("ArrayOfArrayOfSimpleClassEnumerable", tm.TypeName, "#B3");
1172 Assert.AreEqual ("SimpleClassEnumerable[][]", tm.TypeName, "#B3");
1174 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerable[][]", tm.TypeFullName, "#B4");
1178 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
1179 public void TypeMapping_IEnumerable_Object ()
1181 XmlTypeMapping tm = Map (typeof (ObjectEnumerable));
1182 Assert.AreEqual ("ArrayOfAnyType", tm.ElementName, "#1");
1183 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
1184 Assert.AreEqual ("ObjectEnumerable", tm.TypeName, "#3");
1185 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.ObjectEnumerable", tm.TypeFullName, "#4");
1187 tm = Map (typeof (ObjectEnumerable[]));
1188 Assert.AreEqual ("ArrayOfArrayOfAnyType", tm.ElementName, "#A1");
1189 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
1191 Assert.AreEqual ("ArrayOfObjectEnumerable", tm.TypeName, "#A3");
1193 Assert.AreEqual ("ObjectEnumerable[]", tm.TypeName, "#A3");
1195 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.ObjectEnumerable[]", tm.TypeFullName, "#A4");
1197 tm = Map (typeof (ObjectEnumerable[][]));
1198 Assert.AreEqual ("ArrayOfArrayOfArrayOfAnyType", tm.ElementName, "#B1");
1199 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
1201 Assert.AreEqual ("ArrayOfArrayOfObjectEnumerable", tm.TypeName, "#B3");
1203 Assert.AreEqual ("ObjectEnumerable[][]", tm.TypeName, "#B3");
1205 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.ObjectEnumerable[][]", tm.TypeFullName, "#B4");
1209 [ExpectedException (typeof (InvalidOperationException))]
1210 public void TypeMapping_IEnumerable_Object_NoMatchingAddMethod ()
1212 Map (typeof (ObjectEnumerableNoMatchingAddMethod));
1216 [ExpectedException (typeof (InvalidOperationException))]
1217 public void TypeMapping_IEnumerable_Object_NoMatchingAddMethod_Array ()
1219 Map (typeof (ObjectEnumerableNoMatchingAddMethod[]));
1223 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
1224 public void TypeMapping_IEnumerable_SimpleClass_PrivateCurrent ()
1226 XmlTypeMapping tm = Map (typeof (SimpleClassEnumerablePrivateCurrent));
1227 Assert.AreEqual ("ArrayOfAnyType", tm.ElementName, "#1");
1228 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
1229 Assert.AreEqual ("SimpleClassEnumerablePrivateCurrent", tm.TypeName, "#3");
1230 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerablePrivateCurrent", tm.TypeFullName, "#4");
1232 tm = Map (typeof (SimpleClassEnumerablePrivateCurrent[]));
1233 Assert.AreEqual ("ArrayOfArrayOfAnyType", tm.ElementName, "#A1");
1234 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
1236 Assert.AreEqual ("ArrayOfSimpleClassEnumerablePrivateCurrent", tm.TypeName, "#A3");
1238 Assert.AreEqual ("SimpleClassEnumerablePrivateCurrent[]", tm.TypeName, "#A3");
1240 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerablePrivateCurrent[]", tm.TypeFullName, "#A4");
1242 tm = Map (typeof (SimpleClassEnumerablePrivateCurrent[][]));
1243 Assert.AreEqual ("ArrayOfArrayOfArrayOfAnyType", tm.ElementName, "#B1");
1244 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
1246 Assert.AreEqual ("ArrayOfArrayOfSimpleClassEnumerablePrivateCurrent", tm.TypeName, "#B3");
1248 Assert.AreEqual ("SimpleClassEnumerablePrivateCurrent[][]", tm.TypeName, "#B3");
1250 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerablePrivateCurrent[][]", tm.TypeFullName, "#B4");
1254 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
1256 [Category ("NotDotNet")] // results in NullReferenceException in .NET 1.1 (SP1)
1258 public void TypeMapping_IEnumerable_SimpleClass_PrivateGetEnumerator ()
1260 XmlTypeMapping tm = Map (typeof (SimpleClassEnumerablePrivateGetEnumerator));
1261 Assert.AreEqual ("ArrayOfAnyType", tm.ElementName, "#1");
1262 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
1263 Assert.AreEqual ("SimpleClassEnumerablePrivateGetEnumerator", tm.TypeName, "#3");
1264 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerablePrivateGetEnumerator", tm.TypeFullName, "#4");
1266 tm = Map (typeof (SimpleClassEnumerablePrivateGetEnumerator[]));
1267 Assert.AreEqual ("ArrayOfArrayOfAnyType", tm.ElementName, "#A1");
1268 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
1270 Assert.AreEqual ("ArrayOfSimpleClassEnumerablePrivateGetEnumerator", tm.TypeName, "#A3");
1272 Assert.AreEqual ("SimpleClassEnumerablePrivateGetEnumerator[]", tm.TypeName, "#A3");
1274 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerablePrivateGetEnumerator[]", tm.TypeFullName, "#A4");
1276 tm = Map (typeof (SimpleClassEnumerablePrivateGetEnumerator[][]));
1277 Assert.AreEqual ("ArrayOfArrayOfArrayOfAnyType", tm.ElementName, "#B1");
1278 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
1280 Assert.AreEqual ("ArrayOfArrayOfSimpleClassEnumerablePrivateGetEnumerator", tm.TypeName, "#B3");
1282 Assert.AreEqual ("SimpleClassEnumerablePrivateGetEnumerator[][]", tm.TypeName, "#B3");
1284 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassEnumerablePrivateGetEnumerator[][]", tm.TypeFullName, "#B4");
1288 [ExpectedException (typeof (InvalidOperationException))]
1289 public void TypeMapping_ICollection_Object_NoMatchingAddMethod ()
1291 Map (typeof (ObjectCollectionNoMatchingAddMethod));
1295 [ExpectedException (typeof (InvalidOperationException))]
1296 public void TypeMapping_ICollection_Object_NoMatchingAddMethod_Array ()
1298 Map (typeof (ObjectCollectionNoMatchingAddMethod[]));
1302 [ExpectedException (typeof (InvalidOperationException))]
1303 public void TypeMapping_ICollection_SimpleClass_NoMatchingAddMethod ()
1305 Map (typeof (SimpleClassCollectionNoMatchingAddMethod));
1309 [ExpectedException (typeof (InvalidOperationException))]
1310 public void TypeMapping_ICollection_SimpleClass_NoMatchingAddMethod_Array ()
1312 Map (typeof (SimpleClassCollectionNoMatchingAddMethod[]));
1316 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
1317 public void TypeMapping_ICollection_SimpleClass ()
1319 XmlTypeMapping tm = Map (typeof (SimpleClassCollection));
1320 Assert.AreEqual ("ArrayOfSimpleClass", tm.ElementName, "#1");
1321 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
1322 Assert.AreEqual ("SimpleClassCollection", tm.TypeName, "#3");
1323 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassCollection", tm.TypeFullName, "#4");
1325 tm = Map (typeof (SimpleClassCollection[]));
1326 Assert.AreEqual ("ArrayOfArrayOfSimpleClass", tm.ElementName, "#A1");
1327 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
1329 Assert.AreEqual ("ArrayOfSimpleClassCollection", tm.TypeName, "#A3");
1331 Assert.AreEqual ("SimpleClassCollection[]", tm.TypeName, "#A3");
1333 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassCollection[]", tm.TypeFullName, "#A4");
1335 tm = Map (typeof (SimpleClassCollection[][]));
1336 Assert.AreEqual ("ArrayOfArrayOfArrayOfSimpleClass", tm.ElementName, "#B1");
1337 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
1339 Assert.AreEqual ("ArrayOfArrayOfSimpleClassCollection", tm.TypeName, "#B3");
1341 Assert.AreEqual ("SimpleClassCollection[][]", tm.TypeName, "#B3");
1343 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.SimpleClassCollection[][]", tm.TypeFullName, "#B4");
1347 [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
1348 public void TypeMapping_ICollection_Object ()
1350 XmlTypeMapping tm = Map (typeof (ObjectCollection));
1351 Assert.AreEqual ("ArrayOfAnyType", tm.ElementName, "#1");
1352 Assert.AreEqual (string.Empty, tm.Namespace, "#2");
1353 Assert.AreEqual ("ObjectCollection", tm.TypeName, "#3");
1354 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.ObjectCollection", tm.TypeFullName, "#4");
1356 tm = Map (typeof (ObjectCollection[]));
1357 Assert.AreEqual ("ArrayOfArrayOfAnyType", tm.ElementName, "#A1");
1358 Assert.AreEqual (string.Empty, tm.Namespace, "#A2");
1360 Assert.AreEqual ("ArrayOfObjectCollection", tm.TypeName, "#A3");
1362 Assert.AreEqual ("ObjectCollection[]", tm.TypeName, "#A3");
1364 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.ObjectCollection[]", tm.TypeFullName, "#A4");
1366 tm = Map (typeof (ObjectCollection[][]));
1367 Assert.AreEqual ("ArrayOfArrayOfArrayOfAnyType", tm.ElementName, "#B1");
1368 Assert.AreEqual (string.Empty, tm.Namespace, "#B2");
1370 Assert.AreEqual ("ArrayOfArrayOfObjectCollection", tm.TypeName, "#B3");
1372 Assert.AreEqual ("ObjectCollection[][]", tm.TypeName, "#B3");
1374 Assert.AreEqual ("MonoTests.System.XmlSerialization.SoapReflectionImporterTests.ObjectCollection[][]", tm.TypeFullName, "#B4");
1378 [ExpectedException (typeof (InvalidOperationException))]
1379 public void TypeMapping_ICollection_Object_NoIntIndexer ()
1381 Map (typeof (ObjectCollectionNoIntIndexer));
1385 [ExpectedException (typeof (InvalidOperationException))]
1386 public void TypeMapping_ICollection_Object_NoIntIndexer_Array ()
1388 Map (typeof (ObjectCollectionNoIntIndexer[]));
1392 [ExpectedException (typeof (InvalidOperationException))]
1393 public void TypeMapping_ICollection_SimpleClass_NoIntIndexer ()
1395 Map (typeof (SimpleClassCollectionNoIntIndexer));
1399 [ExpectedException (typeof (InvalidOperationException))]
1400 public void TypeMapping_ICollection_SimpleClass_NoIntIndexer_Array ()
1402 Map (typeof (SimpleClassCollectionNoIntIndexer[]));
1406 public void TypeMapping_InvalidDefault ()
1408 SoapAttributes attrs = new SoapAttributes (typeof (Field_Encoded).GetMember ("Modifiers")[0]);
1409 attrs.SoapDefaultValue = 2; // not a defined enum value
1410 SoapAttributeOverrides overrides = new SoapAttributeOverrides ();
1411 overrides.Add (typeof (Field_Encoded), "Modifiers", attrs);
1414 Map (typeof (Field_Encoded), overrides);
1415 Assert.Fail ("#A1");
1416 } catch (InvalidOperationException ex) {
1417 // Enum System.Int32 cannot be converted to MonoTests.System.Xml.TestClasses.MapModifiers
1418 Assert.IsNotNull (ex.Message, "#A2");
1419 Assert.IsTrue (ex.Message.IndexOf (typeof (int).FullName) != -1, "#A3");
1420 Assert.IsTrue (ex.Message.IndexOf (typeof (MapModifiers).FullName) != -1, "#A4");
1421 Assert.IsNull (ex.InnerException, "#A5");
1424 attrs.SoapDefaultValue = "2"; // not of the same type as the underlying enum type (System.Int32)
1427 Map (typeof (Field_Encoded), overrides);
1428 Assert.Fail ("#B1");
1429 } catch (InvalidOperationException ex) {
1430 // Enum System.String cannot be converted to MonoTests.System.Xml.TestClasses.MapModifiers
1431 Assert.IsNotNull (ex.Message, "#B2");
1432 Assert.IsTrue (ex.Message.IndexOf (typeof (string).FullName) != -1, "#B3");
1433 Assert.IsTrue (ex.Message.IndexOf (typeof (MapModifiers).FullName) != -1, "#B4");
1434 Assert.IsNull (ex.InnerException, "#B5");
1437 attrs.SoapDefaultValue = EnumDefaultValueNF.e2; // other enum type
1440 Map (typeof (Field_Encoded), overrides);
1441 Assert.Fail ("#C1");
1442 } catch (InvalidOperationException ex) {
1443 // Enum MonoTests.System.Xml.TestClasses.EnumDefaultValueNF cannot be converted to MonoTests.System.Xml.TestClasses.MapModifiers
1444 Assert.IsNotNull (ex.Message, "#C2");
1445 Assert.IsTrue (ex.Message.IndexOf (typeof (EnumDefaultValueNF).FullName) != -1, "#C3");
1446 Assert.IsTrue (ex.Message.IndexOf (typeof (MapModifiers).FullName) != -1, "#C4");
1447 Assert.IsNull (ex.InnerException, "#C5");
1450 attrs.SoapDefaultValue = (MapModifiers) 20; // non-existing enum value
1453 Map (typeof (Field_Encoded), overrides);
1454 Assert.Fail ("#D1");
1455 } catch (InvalidOperationException ex) {
1456 // Value '20' cannot be converted to MonoTests.System.Xml.TestClasses.MapModifiers
1457 Assert.IsNotNull (ex.Message, "#D2");
1458 Assert.IsTrue (ex.Message.IndexOf ("'20'") != -1, "#D3");
1459 Assert.IsTrue (ex.Message.IndexOf (typeof (MapModifiers).FullName) != -1, "#D4");
1460 Assert.IsNull (ex.InnerException, "#D5");
1465 [Category ("NotWorking")]
1466 public void TestImportMembersMapping()
1468 Type type = typeof (SimpleClass);
1469 SoapAttributes attrs = new SoapAttributes ();
1470 SoapAttributeOverrides overrides = new SoapAttributeOverrides ();
1471 overrides.Add (typeof (SimpleClass), attrs);
1473 XmlReflectionMember[] members = new XmlReflectionMember[0];
1474 XmlMembersMapping mm;
1477 mm = MembersMap(type, overrides, members, true, true);
1478 Assert.Fail("Should not be able to fetch an empty XmlMembersMapping");
1484 XmlReflectionMember rm = new XmlReflectionMember();
1485 rm.IsReturnValue = false;
1486 rm.MemberName = "something";
1487 rm.MemberType = typeof(string);
1488 members = new XmlReflectionMember[1];
1491 mm = MembersMap(type, overrides, members, false, false);
1493 Equals(mm.Count, 1);
1495 XmlMemberMapping smm = mm[0];
1496 Assert.IsFalse (smm.Any, "#1");
1497 Assert.AreEqual ("something", smm.ElementName, "#2");
1498 Assert.AreEqual ("something", smm.MemberName, "#3");
1499 Assert.IsNull (smm.Namespace, "#4");
1500 Assert.AreEqual ("System.String", smm.TypeFullName, "#5");
1501 Assert.AreEqual ("string", smm.TypeName, "#6");
1502 Assert.AreEqual (XmlSchemaNamespace, smm.TypeNamespace, "#7");
1505 rm = new XmlReflectionMember();
1506 rm.IsReturnValue = false;
1507 rm.MemberName = "nothing";
1508 rm.MemberType = typeof(string);
1509 members = new XmlReflectionMember[1];
1512 mm = MembersMap(type, overrides, members, false, false);
1513 Assert.AreEqual (1 , mm.Count, "#8");
1516 public class Employee : IXmlSerializable
1518 private string _firstName;
1519 private string _lastName;
1520 private string _address;
1522 public XmlSchema GetSchema ()
1527 public void WriteXml (XmlWriter writer)
1529 writer.WriteStartElement ("employee", "urn:devx-com");
1530 writer.WriteAttributeString ("firstName", _firstName);
1531 writer.WriteAttributeString ("lastName", _lastName);
1532 writer.WriteAttributeString ("address", _address);
1533 writer.WriteEndElement ();
1536 public void ReadXml (XmlReader reader)
1538 XmlNodeType type = reader.MoveToContent ();
1539 if (type == XmlNodeType.Element && reader.LocalName == "employee") {
1540 _firstName = reader["firstName"];
1541 _lastName = reader["lastName"];
1542 _address = reader["address"];
1547 public class NestedStruct
1549 public TimeSpan Period = TimeSpan.MaxValue;
1552 public class ObjectEnumerable : IEnumerable
1554 public void Add (int value)
1558 public void Add (object value)
1562 public IEnumerator GetEnumerator ()
1564 return new ArrayList ().GetEnumerator ();
1568 public class SimpleClassEnumerable : IEnumerable
1570 public void Add (int value)
1574 public void Add (object value)
1578 IEnumerator IEnumerable.GetEnumerator ()
1580 return GetEnumerator ();
1583 public SimpleClassEnumerator GetEnumerator ()
1585 return new SimpleClassEnumerator (new ArrayList ());
1589 public class SimpleClassEnumerablePrivateGetEnumerator : IEnumerable
1591 public void Add (object value)
1595 IEnumerator IEnumerable.GetEnumerator ()
1597 return new ArrayList ().GetEnumerator ();
1601 public class SimpleClassEnumerablePrivateCurrent : IEnumerable
1603 public void Add (object value)
1607 IEnumerator IEnumerable.GetEnumerator ()
1609 return GetEnumerator ();
1612 public NoCurrentEnumerator GetEnumerator ()
1614 return new NoCurrentEnumerator (new ArrayList ());
1618 // GetEnumerator().Current returns object, but there's no corresponding
1619 // Add (System.Object) method
1620 public class ObjectEnumerableNoMatchingAddMethod : IEnumerable
1622 public void Add (int value)
1626 public IEnumerator GetEnumerator ()
1628 return new ArrayList ().GetEnumerator ();
1632 // GetEnumerator().Current returns SimpleClass, but there's no
1633 // corresponding Add (SimpleClass) method
1634 public class SimpleClassCollectionNoMatchingAddMethod : ICollection
1636 public SimpleClass this[int index] {
1638 return (SimpleClass) _list[index];
1643 get { return _list.Count; }
1646 public bool IsSynchronized {
1647 get { return _list.IsSynchronized; }
1650 public object SyncRoot {
1651 get { return _list.SyncRoot; }
1654 public void CopyTo (Array array, int index)
1656 _list.CopyTo (array, index);
1659 IEnumerator IEnumerable.GetEnumerator()
1661 return GetEnumerator ();
1664 public SimpleClassEnumerator GetEnumerator ()
1666 return new SimpleClassEnumerator (_list);
1669 private ArrayList _list = new ArrayList ();
1672 // GetEnumerator().Current returns object, but there's no corresponding
1673 // Add (System.Object) method
1674 public class ObjectCollectionNoMatchingAddMethod : ICollection
1676 public object this[int index] {
1678 return _list[index];
1683 get { return _list.Count; }
1686 public bool IsSynchronized {
1687 get { return _list.IsSynchronized; }
1690 public object SyncRoot {
1691 get { return _list.SyncRoot; }
1694 public void CopyTo (Array array, int index)
1696 _list.CopyTo (array, index);
1699 IEnumerator IEnumerable.GetEnumerator ()
1701 return GetEnumerator ();
1704 public IEnumerator GetEnumerator ()
1706 return _list.GetEnumerator ();
1709 private ArrayList _list = new ArrayList ();
1712 // Does not have int indexer.
1713 public class SimpleClassCollectionNoIntIndexer : ICollection
1715 public SimpleClass this[string name] {
1717 return new SimpleClass ();
1722 get { return _list.Count; }
1725 public bool IsSynchronized {
1726 get { return _list.IsSynchronized; }
1729 public object SyncRoot {
1730 get { return _list.SyncRoot; }
1733 public void CopyTo (Array array, int index)
1735 _list.CopyTo (array, index);
1738 IEnumerator IEnumerable.GetEnumerator ()
1740 return GetEnumerator ();
1743 public SimpleClassEnumerator GetEnumerator ()
1745 return new SimpleClassEnumerator (_list);
1748 public void Add (SimpleClass value)
1753 private ArrayList _list = new ArrayList ();
1756 // Does not have int indexer.
1757 public class ObjectCollectionNoIntIndexer : ICollection
1759 public object this[string name] {
1761 return new SimpleClass ();
1766 get { return _list.Count; }
1769 public bool IsSynchronized {
1770 get { return _list.IsSynchronized; }
1773 public object SyncRoot {
1774 get { return _list.SyncRoot; }
1777 public void CopyTo (Array array, int index)
1779 _list.CopyTo (array, index);
1782 public IEnumerator GetEnumerator ()
1784 return _list.GetEnumerator ();
1787 public void Add (object value)
1792 private ArrayList _list = new ArrayList ();
1795 public class SimpleClassCollection : ICollection
1797 public SimpleClass this[int index] {
1799 return (SimpleClass) _list[index];
1804 get { return _list.Count; }
1807 public bool IsSynchronized {
1808 get { return _list.IsSynchronized; }
1811 public object SyncRoot {
1812 get { return _list.SyncRoot; }
1815 public void CopyTo (Array array, int index)
1817 _list.CopyTo (array, index);
1820 IEnumerator IEnumerable.GetEnumerator ()
1822 return GetEnumerator ();
1825 public SimpleClassEnumerator GetEnumerator ()
1827 return new SimpleClassEnumerator (_list);
1830 public void Add (SimpleClass value)
1835 private ArrayList _list = new ArrayList ();
1838 public class ObjectCollection : ICollection
1840 public object this[int name] {
1842 return new SimpleClass ();
1848 get { return _list.Count; }
1851 public bool IsSynchronized
1853 get { return _list.IsSynchronized; }
1856 public object SyncRoot
1858 get { return _list.SyncRoot; }
1861 public void CopyTo (Array array, int index)
1863 _list.CopyTo (array, index);
1866 public IEnumerator GetEnumerator ()
1868 return _list.GetEnumerator ();
1871 public void Add (object value)
1876 private ArrayList _list = new ArrayList ();
1879 public class SimpleClassEnumerator : IEnumerator
1881 internal SimpleClassEnumerator (ArrayList arguments)
1883 IEnumerable temp = (IEnumerable) (arguments);
1884 _baseEnumerator = temp.GetEnumerator ();
1886 public SimpleClass Current
1888 get { return (SimpleClass) _baseEnumerator.Current; }
1891 object IEnumerator.Current
1893 get { return _baseEnumerator.Current; }
1896 public bool MoveNext ()
1898 return _baseEnumerator.MoveNext ();
1901 bool IEnumerator.MoveNext ()
1903 return _baseEnumerator.MoveNext ();
1906 public void Reset ()
1908 _baseEnumerator.Reset ();
1911 void IEnumerator.Reset ()
1913 _baseEnumerator.Reset ();
1916 private IEnumerator _baseEnumerator;
1919 public class NoCurrentEnumerator : IEnumerator
1921 internal NoCurrentEnumerator (ArrayList arguments)
1923 IEnumerable temp = (IEnumerable) (arguments);
1924 _baseEnumerator = temp.GetEnumerator ();
1927 object IEnumerator.Current
1929 get { return _baseEnumerator.Current; }
1932 public bool MoveNext ()
1934 return _baseEnumerator.MoveNext ();
1937 bool IEnumerator.MoveNext ()
1939 return _baseEnumerator.MoveNext ();
1942 public void Reset ()
1944 _baseEnumerator.Reset ();
1947 void IEnumerator.Reset ()
1949 _baseEnumerator.Reset ();
1952 private IEnumerator _baseEnumerator;