diff options
author | Lluis Sanchez <lluis@novell.com> | 2005-12-01 15:22:13 +0300 |
---|---|---|
committer | Lluis Sanchez <lluis@novell.com> | 2005-12-01 15:22:13 +0300 |
commit | a238942f0eaa6a4d5f663ea75070ff0eb2044d27 (patch) | |
tree | b74848ad56fb63c60c515c67af3c0e27eeb2090f /mcs/class/System.XML | |
parent | 1e8f13ce21920681bd2c5aebb3b84843c7935098 (diff) |
2005-12-01 Lluis Sanchez Gual <lluis@novell.com>
* XmlSerializerTestClasses.cs:
* XmlSerializerTests.cs: Added tests for bug #76860.
svn path=/trunk/mcs/; revision=53761
Diffstat (limited to 'mcs/class/System.XML')
3 files changed, 39 insertions, 1 deletions
diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog b/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog index 34485630352..b9dc33b6b59 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog @@ -1,3 +1,8 @@ +2005-12-01 Lluis Sanchez Gual <lluis@novell.com> + + * XmlSerializerTestClasses.cs: + * XmlSerializerTests.cs: Added tests for bug #76860. + 2005-11-24 Vladimir Krasnov <vladimirk@mainsoft.com> * XmlSerializerTestClasses.cs: added two enum types, without diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTestClasses.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTestClasses.cs index 050d3af4867..152ea480c17 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTestClasses.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTestClasses.cs @@ -266,5 +266,23 @@ namespace MonoTests.System.Xml.TestClasses public enum ItemsChoiceType {
In, Es
} + + public class ArrayAttributeWithType + { + [XmlAttribute (DataType="anyURI")] + public string[] at = new string [] { "a","b" }; + + [XmlAttribute (DataType="base64Binary")] + public byte[][] bin1 = new byte[][] { new byte[]{1,2}, new byte[]{1,2}}; + + [XmlAttribute (DataType="base64Binary")] + public byte[] bin2 = new byte[] { 1,2 }; + } + + public class ArrayAttributeWithWrongType + { + [XmlAttribute (DataType="int")] + public string[] at = new string [] { "a","b" }; + } }
diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs index f1938e0f4fb..cc46ba8ac85 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs @@ -786,7 +786,22 @@ namespace MonoTests.System.XmlSerialization Serialize (v); AssertEquals (Infoset("<?xml version=\"1.0\" encoding=\"utf-16\"?><CompositeValueType xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><In>1</In><Es>2</Es></CompositeValueType>"), WriterText); } - + + [Test] + public void TestArrayAttributeWithDataType () + { + Serialize (new ArrayAttributeWithType ()); + string res = "<ArrayAttributeWithType xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' "; + res += "at='a b' bin1='AQI= AQI=' bin2='AQI=' />";
+ AssertEquals (Infoset(res), WriterText);
+ } + + [Test] + [ExpectedException (typeof(InvalidOperationException))] + public void TestArrayAttributeWithWrongDataType () + { + Serialize (new ArrayAttributeWithWrongType ()); + } // Helper methods |