+2006-11-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlSchemaImporter.cs : ImportTypeMapping() raises exception when
+ the argument name is not bound to any elements.
+
2006-11-07 Atsushi Enomoto <atsushi@ximian.com>
* XmlCustomFormatter.cs : consider null base64 byte array value.
XmlSchemaType stype;
XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (name, typeof (XmlSchemaElement));
- if (!LocateElement (elem, out qname, out stype)) return null;
+ if (!LocateElement (elem, out qname, out stype))
+ throw new InvalidOperationException (String.Format ("'{0}' is missing.", name));
if (stype == null) {
// Importing a primitive type
+2006-11-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlSchemaImporterTests.cs : added ImportTypeMapping() test for
+ nonexistent name.
+
2006-11-02 Atsushi Enomoto <atsushi@ximian.com>
* CodeIdentifiersTests.cs : new test.
return qnames;
}
+
+ [Test]
+ [ExpectedException (typeof (InvalidOperationException))]
+ public void ImportTypeMappingNonExistent ()
+ {
+ XmlSchemas xss = new XmlSchemas ();
+ xss.Add (new XmlSchema ());
+ XmlSchemaImporter imp = new XmlSchemaImporter (xss);
+ imp.ImportTypeMapping (new XmlQualifiedName ("foo"));
+ }
}
}