+2008-11-18 Raja R Harinath <harinath@hurrynot.org>
+
+ Fix #420862
+ * XmlConstants.cs (QnUnsignedShort): Rename from QnUsigned short
+ and fix the value too.
+ * XmlSchemaWriter.cs (XmlQualifiedName): Update to changes.
+
2008-09-27 Raja R Harinath <harinath@hurrynot.org>
* DataView.cs: Convert into a partial class and sequester
public static XmlQualifiedName QnSbyte = new XmlQualifiedName ("byte", XmlSchema.Namespace);
public static XmlQualifiedName QnFloat = new XmlQualifiedName ("float", XmlSchema.Namespace);
public static XmlQualifiedName QnDuration = new XmlQualifiedName ("duration", XmlSchema.Namespace);
- public static XmlQualifiedName QnUsignedShort = new XmlQualifiedName ("usignedShort", XmlSchema.Namespace);
+ public static XmlQualifiedName QnUnsignedShort = new XmlQualifiedName ("unsignedShort", XmlSchema.Namespace);
public static XmlQualifiedName QnUnsignedInt = new XmlQualifiedName ("unsignedInt", XmlSchema.Namespace);
public static XmlQualifiedName QnUnsignedLong = new XmlQualifiedName ("unsignedLong", XmlSchema.Namespace);
public static XmlQualifiedName QnUri = new XmlQualifiedName ("anyURI", XmlSchema.Namespace);
case TypeCode.Double: return XmlConstants.QnDouble;
case TypeCode.SByte: return XmlConstants.QnSbyte;
case TypeCode.Single: return XmlConstants.QnFloat;
- case TypeCode.UInt16: return XmlConstants.QnUsignedShort;
+ case TypeCode.UInt16: return XmlConstants.QnUnsignedShort;
case TypeCode.UInt32: return XmlConstants.QnUnsignedInt;
case TypeCode.UInt64: return XmlConstants.QnUnsignedLong;
}
+2008-11-18 Raja R Harinath <harinath@hurrynot.org>
+
+ * DataSetTest.cs (Bug420862): New test.
+
2008-09-16 brandin claar <brandin.claar@gmail.com>
* BinarySerializationTest.cs (TestDefaultValues): New.
using NUnit.Framework;
using System;
using System.Xml;
+using System.Xml.Schema;
using System.Xml.Serialization;
using System.IO;
using System.Data;
"deserialization after modification oes not give current values");
}
+ [Test]
+ public void Bug420862 ()
+ {
+ DataSet ds = new DataSet ("d");
+ DataTable dt = ds.Tables.Add ("t");
+ dt.Columns.Add ("c", typeof (ushort));
+
+ XmlSchema xs = XmlSchema.Read (new StringReader (ds.GetXmlSchema ()), null);
+ xs.Compile (null);
+
+ // follow the nesting of the schema in the foreach
+ foreach (XmlSchemaElement d in xs.Items) {
+ Assert.AreEqual ("d", d.Name);
+ XmlSchemaChoice dsc = (XmlSchemaChoice) ((XmlSchemaComplexType) d.SchemaType).Particle;
+ foreach (XmlSchemaElement t in dsc.Items) {
+ Assert.AreEqual ("t", t.Name);
+ XmlSchemaSequence tss = (XmlSchemaSequence) ((XmlSchemaComplexType) t.SchemaType).Particle;
+ foreach (XmlSchemaElement c in tss.Items) {
+ Assert.AreEqual ("c", c.Name);
+ Assert.AreEqual ("unsignedShort", c.SchemaTypeName.Name);
+ return;
+ }
+ }
+ }
+ Assert.Fail ();
+ }
+
/// <summary>
/// Test for testing DataSet.Clear method with foriegn key relations
/// This is expected to clear all the related datatable rows also