2 // XsdDataContractImporterTest.cs
5 // Ankit Jain <jankit@novell.com>
7 // Copyright (C) 2006 Novell, Inc. http://www.novell.com
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 // This test code contains tests for both DataContractSerializer and
32 // NetDataContractSerializer. The code could be mostly common.
37 using System.CodeDom.Compiler;
38 using System.Collections.Generic;
41 using System.Runtime.Serialization;
42 using System.ServiceModel.Description;
44 using System.Xml.Schema;
45 using System.Xml.Serialization;
46 using Microsoft.CSharp;
47 using NUnit.Framework;
49 using QName = System.Xml.XmlQualifiedName;
51 namespace MonoTests.System.Runtime.Serialization
54 public class XsdContractImporterTest
62 XmlReader xr = XmlTextReader.Create ("Test/System.Runtime.Serialization/one.xml");
63 metadata = MetadataSet.ReadFrom (xr);
67 private XmlSchemaSet NewXmlSchemaSet ()
69 xss = new XmlSchemaSet ();
70 foreach (MetadataSection section in metadata.MetadataSections)
71 if (section.Metadata is XmlSchema)
72 xss.Add (section.Metadata as XmlSchema);
74 Assert.AreEqual (3, xss.Schemas ().Count, "#1");
78 private XsdDataContractImporter GetImporter ()
80 CodeCompileUnit ccu = new CodeCompileUnit ();
81 return new XsdDataContractImporter (ccu);
85 public void CtorTest ()
87 XsdDataContractImporter xi = new XsdDataContractImporter ();
88 Assert.IsNotNull (xi.CodeCompileUnit, "#c01");
90 xi = new XsdDataContractImporter (null);
91 Assert.IsNotNull (xi.CodeCompileUnit, "#c02");
93 xi = new XsdDataContractImporter (new CodeCompileUnit ());
98 [ExpectedException (typeof (InvalidOperationException))]
99 public void GetCodeTypeReferenceTest ()
101 XsdDataContractImporter xsdi = GetImporter ();
102 xsdi.GetCodeTypeReference (new XmlQualifiedName ("dc", "http://schemas.datacontract.org/2004/07/"));
106 public void GetCodeTypeReferenceTest2 ()
110 Assert.IsFalse (xss.IsCompiled, "#g01");
112 XsdDataContractImporter xsdi = GetImporter ();
113 xsdi.Import (xss, new XmlQualifiedName ("dc", "http://schemas.datacontract.org/2004/07/"));
114 Assert.IsTrue (xss.IsCompiled, "#g02");
116 CodeTypeReference type = xsdi.GetCodeTypeReference (new XmlQualifiedName ("dc", "http://schemas.datacontract.org/2004/07/"));
118 //FIXME: How should this type ref be checked?
119 Assert.IsNotNull (type, "#g03");
120 Assert.AreEqual (type.BaseType, "dc", "#g04");
124 public void CanImportTest ()
127 XsdDataContractImporter xsdi = GetImporter ();
129 Assert.IsFalse (xss.IsCompiled, "#ci01");
131 Assert.IsTrue (xsdi.CanImport (xss, new XmlQualifiedName ("dc", "http://schemas.datacontract.org/2004/07/")), "#ci02");
132 Assert.IsTrue (xss.IsCompiled, "#ci03");
134 Assert.IsFalse (xsdi.CanImport (xss, new XmlQualifiedName ("Echo", "http://myns/echo")), "#ci04");
135 Assert.IsTrue (xsdi.CanImport (xss, new XmlQualifiedName ("int", "http://www.w3.org/2001/XMLSchema")), "#ci05");
137 Assert.IsTrue (xsdi.CanImport (xss), "#ci06");
139 Assert.IsTrue (xsdi.CanImport (xss,
140 xss.GlobalElements [new XmlQualifiedName ("dc", "http://schemas.datacontract.org/2004/07/")] as XmlSchemaElement),
143 Assert.IsTrue (xsdi.CanImport (xss,
144 xss.GlobalElements [new XmlQualifiedName ("Echo", "http://myns/echo")] as XmlSchemaElement),
149 public void CanImportTest2 ()
152 XsdDataContractImporter xsdi = GetImporter ();
154 List<XmlQualifiedName> names = new List<XmlQualifiedName> ();
155 names.Add (new XmlQualifiedName ("Echo", "http://myns/echo"));
156 Assert.IsFalse (xsdi.CanImport (xss, names), "#ci20");
158 names.Add (new XmlQualifiedName ("dc", "http://schemas.datacontract.org/2004/07/"));
159 Assert.IsFalse (xsdi.CanImport (xss, names), "#ci21");
162 names.Add (new XmlQualifiedName ("dc", "http://schemas.datacontract.org/2004/07/"));
163 Assert.IsTrue (xsdi.CanImport (xss, names), "#ci22");
167 [ExpectedException (typeof (ArgumentNullException))]
168 public void CanImportNullTest1 ()
170 XsdDataContractImporter xsdi = GetImporter ();
171 xsdi.CanImport (null);
175 [ExpectedException (typeof (ArgumentNullException))]
176 public void CanImportNullTest2 ()
178 XsdDataContractImporter xsdi = GetImporter ();
179 xsdi.CanImport (xss, (XmlQualifiedName) null);
183 [ExpectedException (typeof (ArgumentNullException))]
184 public void CanImportNullTest3 ()
186 XsdDataContractImporter xsdi = GetImporter ();
187 xsdi.CanImport (xss, (XmlSchemaElement) null);
191 [ExpectedException (typeof (ArgumentNullException))]
192 public void ImportTestNullSchemas ()
194 XsdDataContractImporter xsdi = GetImporter ();
199 [ExpectedException (typeof (ArgumentNullException))]
200 public void ImportTestNullSchemas2 ()
202 XsdDataContractImporter xsdi = GetImporter ();
203 xsdi.Import (null, new XmlQualifiedName ("foo"));
207 [ExpectedException (typeof (ArgumentNullException))]
208 public void ImportTestNullSchemas3 ()
210 XsdDataContractImporter xsdi = GetImporter ();
211 xsdi.Import (null, new List<XmlQualifiedName> ());
215 [ExpectedException (typeof (ArgumentNullException))]
216 public void ImportTestNullTypeName ()
218 XsdDataContractImporter xsdi = GetImporter ();
219 xsdi.Import (new XmlSchemaSet (), (XmlQualifiedName) null);
223 [ExpectedException (typeof (ArgumentNullException))]
224 public void ImportTestNullElement ()
226 XsdDataContractImporter xsdi = GetImporter ();
227 xsdi.Import (new XmlSchemaSet (), (XmlSchemaElement) null);
231 [ExpectedException (typeof (ArgumentNullException))]
232 public void ImportTestNullCollection ()
234 XsdDataContractImporter xsdi = GetImporter ();
235 xsdi.Import (new XmlSchemaSet (), (ICollection<XmlQualifiedName>) null);
239 [Category ("NotWorking")] // importing almost-invalid element. This test is almost missing the point.
240 public void ImportTest ()
242 XsdDataContractImporter xsdi = GetImporter ();
243 XmlSchemaElement element = new XmlSchemaElement();
244 Assert.IsTrue (xsdi.CanImport (xss, new QName ("dc", "http://schemas.datacontract.org/2004/07/")), "#i01");
245 Assert.IsTrue (xsdi.CanImport (xss, element), "#i01-2");
246 Assert.AreEqual (new XmlQualifiedName ("anyType", XmlSchema.Namespace), xsdi.Import (xss, element), "#i02");
248 CodeCompileUnit ccu = xsdi.CodeCompileUnit;
249 Assert.AreEqual (1, ccu.Namespaces.Count, "#i03");
250 Assert.AreEqual ("", ccu.Namespaces [0].Name, "#i04");
252 Assert.AreEqual (1, ccu.Namespaces [0].Types.Count, "#i05");
254 Dictionary<string, string> mbrs = new Dictionary<string, string> ();
255 mbrs.Add ("foo", "System.String");
256 CheckDC (ccu.Namespaces [0].Types [0], "dc", mbrs, "#i06");
260 public void ImportDataContract1 ()
263 Assert.IsFalse (xss.IsCompiled, "#i20");
265 XsdDataContractImporter xsdi = GetImporter ();
267 xsdi.Import (xss, new XmlQualifiedName ("dc", "http://schemas.datacontract.org/2004/07/"));
268 Assert.IsTrue (xss.IsCompiled, "#i21");
269 CodeCompileUnit ccu = xsdi.CodeCompileUnit;
271 Assert.AreEqual (1, ccu.Namespaces.Count, "#i22");
272 Assert.AreEqual ("", ccu.Namespaces [0].Name, "#i23");
274 Assert.AreEqual (1, ccu.Namespaces [0].Types.Count, "#i24");
276 Dictionary<string, string> mbrs = new Dictionary<string, string> ();
277 mbrs.Add ("foo", "System.String");
278 CheckDC (ccu.Namespaces [0].Types [0], "dc", mbrs, "#i25");
280 ccu.Namespaces.Clear ();
281 xsdi.Import (xss, new XmlQualifiedName ("dc", "http://schemas.datacontract.org/2004/07/"));
282 //Importing same data contract again with same importer
283 Assert.AreEqual (0, ccu.Namespaces.Count, "#i26");
287 public void ImportDataContract2 ()
290 XsdDataContractImporter xsdi = GetImporter ();
293 xsdi.Import (xss, xss.GlobalElements [new XmlQualifiedName ("Echo", "http://myns/echo")] as XmlSchemaElement);
294 CodeCompileUnit ccu = xsdi.CodeCompileUnit;
296 Assert.AreEqual (2, ccu.Namespaces.Count, "#i29");
297 Dictionary<string, string> args = new Dictionary<string, string> ();
298 args.Add ("msg", "System.String");
299 args.Add ("num", "System.Int32");
300 args.Add ("d", "dc");
302 CheckDC (ccu.Namespaces [0].Types [0], "Echo", args, "#i30");
305 args.Add ("foo", "System.String");
306 CheckDC (ccu.Namespaces [1].Types [0], "dc", args, "#i31");
308 ccu.Namespaces.Clear ();
309 xsdi.Import (xss, new XmlQualifiedName ("dc", "http://schemas.datacontract.org/2004/07/"));
310 Assert.AreEqual (0, ccu.Namespaces.Count);
314 [ExpectedException (typeof (InvalidDataContractException))]
315 public void ImportMessageEcho ()
317 XsdDataContractImporter xsdi = GetImporter ();
318 xsdi.Import (xss, new XmlQualifiedName ("Echo", "http://myns/echo"));
322 public void ImportAll ()
325 XsdDataContractImporter xsdi = GetImporter ();
327 CodeCompileUnit ccu = xsdi.CodeCompileUnit;
330 Assert.AreEqual (2, ccu.Namespaces.Count, "#i40");
331 Assert.AreEqual ("myns.echo", ccu.Namespaces [0].Name, "#i41");
332 Assert.AreEqual ("", ccu.Namespaces [1].Name, "#i42");
334 Assert.AreEqual (4, ccu.Namespaces [0].Types.Count, "#i43");
338 Dictionary <string, string> args = new Dictionary <string, string> ();
339 args.Add ("msg", "System.String");
340 args.Add ("num", "System.Int32");
341 args.Add ("d", "dc");
343 CheckDC (ccu.Namespaces [0].Types [0], "Echo", args, "#i44");
346 args.Add ("EchoResult", "System.String");
347 CheckDC (ccu.Namespaces [0].Types [1], "EchoResponse", args, "#i45");
350 args.Add ("it", "System.Int32");
351 args.Add ("prefix", "System.String");
352 CheckDC (ccu.Namespaces [0].Types [2], "DoubleIt", args, "#i46");
355 args.Add ("DoubleItResult", "System.String");
356 CheckDC (ccu.Namespaces [0].Types [3], "DoubleItResponse", args, "#i47");
360 args.Add ("foo", "System.String");
361 CheckDC (ccu.Namespaces [1].Types [0], "dc", args, "#i48");
363 ccu.Namespaces.Clear ();
365 //Importing same data contract again with same importer
366 Assert.AreEqual (0, ccu.Namespaces.Count, "#i49");
370 public void ImportSkipArrayOfPrimitives ()
372 var ccu = new CodeCompileUnit ();
373 var xdi = new XsdDataContractImporter (ccu);
374 var xss = new XmlSchemaSet ();
375 xss.Add (null, "Test/Resources/Schemas/schema1.xsd");
376 xss.Add (null, "Test/Resources/Schemas/schema2.xsd");
378 var sw = new StringWriter ();
379 new CSharpCodeProvider ().GenerateCodeFromCompileUnit (ccu, sw, null);
380 Assert.IsTrue (sw.ToString ().IndexOf ("ArrayOfint") < 0, "#1");
384 public void ImportGivesAppropriateNamespaces ()
386 var ccu = new CodeCompileUnit ();
387 var xdi = new XsdDataContractImporter (ccu);
388 var xss = new XmlSchemaSet ();
389 xss.Add (null, "Test/Resources/Schemas/schema1.xsd");
390 xss.Add (null, "Test/Resources/Schemas/schema2.xsd");
391 xss.Add (null, "Test/Resources/Schemas/schema3.xsd");
393 var sw = new StringWriter ();
394 bool t = false, te = false;
395 foreach (CodeNamespace cns in ccu.Namespaces) {
396 if (cns.Name == "tempuri.org")
398 else if (cns.Name == "tempuri.org.ext")
400 Assert.AreEqual ("GetSearchDataResponse", cns.Types [0].Name, "#1." + cns.Name);
402 Assert.IsTrue (t, "t");
403 Assert.IsTrue (t, "te");
406 CodeCompileUnit DoImport (params string [] schemaFiles)
408 return DoImport (false, schemaFiles);
411 CodeCompileUnit DoImport (bool xmlType, params string [] schemaFiles)
413 var ccu = new CodeCompileUnit ();
414 var xdi = new XsdDataContractImporter (ccu);
416 xdi.Options = new ImportOptions () { ImportXmlType = true };
417 var xss = new XmlSchemaSet ();
418 foreach (var schemaFile in schemaFiles)
419 xss.Add (null, schemaFile);
425 void DoCanImport (bool result, params string [] schemaFiles)
427 var ccu = new CodeCompileUnit ();
428 var xdi = new XsdDataContractImporter (ccu);
429 var xss = new XmlSchemaSet ();
430 foreach (var schemaFile in schemaFiles)
431 xss.Add (null, schemaFile);
432 Assert.AreEqual (result, xdi.CanImport (xss));
435 string GenerateCode (CodeCompileUnit ccu)
437 var sw = new StringWriter ();
438 new CSharpCodeProvider ().GenerateCodeFromCompileUnit (ccu, sw, null);
439 return sw.ToString ();
442 // FIXME: this set of tests need further assertion in each test case. Right now it just checks if things import or fail just fine.
445 public void ImportTestX0 ()
447 DoImport ("Test/Resources/Schemas/ns0.xsd");
451 public void ImportTestX0_2 ()
453 var ccu = DoImport (true, "Test/Resources/Schemas/ns0.xsd");
454 Assert.IsTrue (GenerateCode (ccu).IndexOf ("class") < 0, "#1");
458 public void ImportTestX1 ()
460 DoImport ("Test/Resources/Schemas/ns1.xsd");
464 public void ImportTestX1_2 ()
466 Assert.AreEqual (GenerateCode (DoImport ("Test/Resources/Schemas/ns1.xsd")), GenerateCode (DoImport (true, "Test/Resources/Schemas/ns1.xsd")), "#1");
470 public void ImportTestX2 ()
472 DoImport ("Test/Resources/Schemas/ns2.xsd");
476 public void ImportTestX2_2 ()
478 Assert.AreEqual (GenerateCode (DoImport ("Test/Resources/Schemas/ns2.xsd")), GenerateCode (DoImport (true, "Test/Resources/Schemas/ns2.xsd")), "#1");
482 [ExpectedException (typeof (InvalidDataContractException))]
483 public void ImportTestX3 ()
485 DoImport ("Test/Resources/Schemas/ns3.xsd");
489 [Category ("NotWorking")]
490 public void ImportTestX3_2 ()
492 var ccu = DoImport (true, "Test/Resources/Schemas/ns3.xsd");
493 var code = GenerateCode (ccu);
494 Assert.IsTrue (code.IndexOf ("class T2") > 0, "#1");
495 Assert.IsTrue (code.IndexOf ("IXmlSerializable") > 0, "#2");
496 Assert.IsTrue (code.IndexOf ("WriteXml") > 0, "#3");
497 Assert.IsTrue (code.IndexOf ("XmlRootAttribute(ElementName=\"E2\", Namespace=\"urn:bar\"") > 0, "#4");
498 Assert.IsTrue (code.IndexOf ("XmlSchemaProviderAttribute(\"ExportSchema\")") > 0, "#5");
502 [ExpectedException (typeof (InvalidDataContractException))]
503 public void ImportTestX4 ()
505 DoImport ("Test/Resources/Schemas/ns4.xsd");
509 [ExpectedException (typeof (InvalidDataContractException))]
510 public void ImportTestX5 ()
512 DoImport ("Test/Resources/Schemas/ns5.xsd");
516 public void ImportTestX6 ()
518 DoImport ("Test/Resources/Schemas/ns6.xsd",
519 "Test/Resources/Schemas/ns0.xsd");
523 [ExpectedException (typeof (InvalidDataContractException))]
524 public void ImportTestX7 ()
526 DoImport ("Test/Resources/Schemas/ns7.xsd",
527 "Test/Resources/Schemas/ns0.xsd");
531 [ExpectedException (typeof (InvalidDataContractException))]
532 public void ImportTestX8 ()
534 DoImport ("Test/Resources/Schemas/ns8.xsd");
538 [ExpectedException (typeof (InvalidDataContractException))]
539 public void ImportTestX9 ()
541 DoImport ("Test/Resources/Schemas/ns9.xsd");
545 public void ImportTestX10 ()
547 DoImport ("Test/Resources/Schemas/ns10.xsd");
551 [ExpectedException (typeof (InvalidDataContractException))]
552 public void ImportTestX11 ()
554 DoImport ("Test/Resources/Schemas/ns11.xsd");
558 [ExpectedException (typeof (InvalidDataContractException))]
559 public void ImportTestX12 ()
561 DoImport ("Test/Resources/Schemas/ns12.xsd");
565 [ExpectedException (typeof (InvalidDataContractException))]
566 public void ImportTestX13 ()
568 DoImport ("Test/Resources/Schemas/ns13.xsd");
572 public void ImportTestX14 ()
574 DoImport ("Test/Resources/Schemas/ns14.xsd");
578 [ExpectedException (typeof (InvalidDataContractException))]
579 public void ImportTestX15 ()
581 DoImport ("Test/Resources/Schemas/ns15.xsd");
585 public void ImportTestX16 ()
587 DoImport ("Test/Resources/Schemas/ns16.xsd");
591 [ExpectedException (typeof (InvalidDataContractException))]
592 public void ImportTestX17 ()
594 DoImport ("Test/Resources/Schemas/ns17.xsd");
598 public void ImportTestX18 ()
600 DoImport ("Test/Resources/Schemas/ns18.xsd");
604 [ExpectedException (typeof (InvalidDataContractException))]
605 public void ImportTestX19 ()
607 DoImport ("Test/Resources/Schemas/ns19.xsd");
611 [ExpectedException (typeof (InvalidDataContractException))]
612 public void ImportTestX20 ()
614 DoImport ("Test/Resources/Schemas/ns20.xsd");
618 public void ImportTestX21 ()
620 DoImport ("Test/Resources/Schemas/ns21.xsd");
624 public void ImportTestX22 ()
626 DoImport ("Test/Resources/Schemas/ns22.xsd");
630 public void ImportTestX23 ()
632 DoImport ("Test/Resources/Schemas/ns23.xsd");
635 [ExpectedException (typeof (InvalidDataContractException))]
637 public void ImportTestX24 ()
639 DoImport ("Test/Resources/Schemas/ns24.xsd");
643 public void ImportTestX25 ()
645 DoImport ("Test/Resources/Schemas/ns25.xsd");
649 public void ImportTestX26 ()
651 DoImport ("Test/Resources/Schemas/ns26.xsd");
655 public void ImportTestX27 ()
657 DoImport ("Test/Resources/Schemas/ns27.xsd");
661 public void ImportTestX28 ()
663 DoImport ("Test/Resources/Schemas/ns28.xsd");
667 [ExpectedException (typeof (InvalidDataContractException))]
668 public void ImportTestX29 ()
670 DoImport ("Test/Resources/Schemas/ns29.xsd");
674 public void ImportTestX30 ()
676 DoImport ("Test/Resources/Schemas/ns30.xsd");
680 public void ImportTestX31 ()
682 DoImport ("Test/Resources/Schemas/ns31.xsd");
686 public void ImportTestX32 ()
688 DoImport ("Test/Resources/Schemas/ns32.xsd");
692 public void ImportTestX33 ()
694 DoImport ("Test/Resources/Schemas/ns33.xsd");
698 public void ImportTestX34 ()
700 DoImport (true, "Test/Resources/Schemas/ns34.xsd", "Test/Resources/Schemas/ns34_2.xsd");
704 public void CanImportTestX34 ()
706 DoCanImport (false, "Test/Resources/Schemas/ns34.xsd", "Test/Resources/Schemas/ns34_2.xsd");
710 private void CheckDC (CodeTypeDeclaration type, string name, Dictionary<string, string> members, string msg)
713 Assert.AreEqual (name, type.Name, msg + "d");
714 //FIXME: Assert.AreEqual (MemberAttributes.Public, type.Attributes);
715 Assert.IsTrue (type.IsClass, msg + "e");
716 Assert.IsTrue (type.IsPartial, msg + "f");
718 CheckDataContractAttribute (type, msg);
719 CheckExtensionData (type, msg);
721 foreach (KeyValuePair<string, string> pair in members)
722 CheckDataMember (type, pair.Key, pair.Value, true, msg);
725 private void CheckExtensionData (CodeTypeDeclaration type, string msg)
727 CheckDataMember (type, "extensionDataField", "ExtensionData", "System.Runtime.Serialization.ExtensionDataObject", false, msg);
730 private void CheckDataMember (CodeTypeDeclaration type, string name, string type_name, bool check_attr, string msg)
732 CheckDataMember (type, name + "Field", name, type_name, check_attr, msg);
735 private void CheckDataMember (CodeTypeDeclaration type, string field_name, string prop_name, string type_name, bool check_attr, string msg)
738 CodeMemberProperty p = FindMember (type, prop_name) as CodeMemberProperty;
739 Assert.IsNotNull (p, msg + "-dm0");
740 Assert.IsTrue (p.HasGet, msg + "-dm1");
741 Assert.IsTrue (p.HasSet, msg + "-dm2");
742 Assert.AreEqual (type_name, p.Type.BaseType, msg + "-dm3");
744 CodeMemberField f = FindMember (type, field_name) as CodeMemberField;
745 Assert.IsNotNull (f, msg + "-dm4");
746 Assert.AreEqual (type_name, f.Type.BaseType, "-dm5");
749 CheckDataContractAttribute (type, msg);
752 private void CheckDataContractAttribute (CodeTypeDeclaration type, string msg)
754 // DebuggerStepThrouAttribute is insignificant. So, no reason to check the attribute count.
755 // Assert.AreEqual (3, type.CustomAttributes.Count, msg + "a");
757 // DebuggerStepThroughAttribute - skip it
759 //GeneratedCodeAttribute
760 var l = new List<CodeAttributeDeclaration> ();
761 foreach (CodeAttributeDeclaration a in type.CustomAttributes)
763 Assert.IsTrue (l.Any (a => a.Name == "System.CodeDom.Compiler.GeneratedCodeAttribute"), msg + "b");
765 var ca = l.FirstOrDefault (a => a.Name == "System.Runtime.Serialization.DataContractAttribute");
766 Assert.IsNotNull (ca, msg + "b");
767 Assert.AreEqual (2, ca.Arguments.Count, msg + "d");
770 CodeTypeMember FindMember (CodeTypeDeclaration type, string name)
772 foreach (CodeTypeMember m in type.Members)
779 public void ImportXsdBuiltInTypes ()
781 DoImport ("Test/Resources/Schemas/xml.xsd");