Commit Graph
12 Commits
Author SHA1 Message Date
Marek Safar 31cab6a76d Fixes build 2013-11-29 13:51:02 +01:00
Marek Safar c81c35a8c6 Fix more xml serializer tests 2012-05-31 13:23:55 +01:00
Miguel de Icaza 62d7430864 XmlSerializer: Add support to serialize nullable types when the XmlElement has explicity set the DataType
The existing code had a special code path for handling nullables that
ignored the DataType component.

This patch splits the nullable test away, allows the specified XmlDataType
to be probed and then performs the standard type lookup mechanism.

This allows this:

        [XmlElement ("MyNullableTime", DataType="time", IsNullable=true)]
        DateTime? myTime;

To be serialized as a "time" instead of a "datetime".

Fixes bug #329
2012-01-03 19:38:13 -05:00
Atsushi Eno 2f86157982 XmlSerializer code generator was generating wrong char literal.
Fixed bug #673019.
2011-04-28 15:41:27 +09:00
Atsushi Eno a1cc211652 2007-04-25 Atsushi Enomoto <[email protected]>
* XmlConvert.cs : in 2.0, use F instead of f in dateTime formatting.

	* XmlCustomFormatter.cs :
	  in 2.0, use F instead of f for dateTime formatting.

	* XmlSerializationWriterTests.cs, XmlSerializerTests.cs :
	  fixed wrong dateTime formatting tests.


svn path=/trunk/mcs/; revision=76268
2007-04-25 18:22:32 +00:00
Atsushi Eno 538b940300 2007-02-07 Atsushi Enomoto <[email protected]>
* XmlSerializationWriter.cs : WriteTypedPrimitive() does not support
	  XmlNode arrays.
	* XmlSerializationWriterInterpreter.cs,
	  SerializationCodeGenerator.cs : so they have to be handled here.

	* XmlSerializerTests.cs : added some XmlNode array/list tests.
	* XmlSerializationWriterTests.cs : removed more NotWorking. Added
	  WriteTypedPrimitive() error test for XmlNode.


svn path=/trunk/mcs/; revision=72448
2007-02-07 18:47:55 +00:00
Atsushi Eno 1552791781 2007-02-07 Atsushi Enomoto <[email protected]>
* XmlSerializationWriter.cs : WriteTypedPrimitive() infers the type
	  when the name is null (almost no need to do this, but it is easier
	  to remove NotWorking from extraneous tests and let them hush than
	  removing them).

	* XmlSerializationWriterTests.cs : removed some NotWorking.


svn path=/trunk/mcs/; revision=72436
2007-02-07 17:11:43 +00:00
Atsushi Eno 3b1767cacf eol-style:native.
svn path=/trunk/mcs/; revision=67663
2006-11-10 10:13:46 +00:00
Gert Driesen fe34bc872c * XmlSerializationWriterTests.cs: Use Assert instead of deprecated
Assertion class. Added tests for FromEnum, WriteXsiType, 
WriteTypedPrimitive and WritePotentiallyReferencingElement. Changed
accessibility of Reset and Content on XmlSerializationWriterTester
and added public Execute methods for WritePotentiallyReferencingElement
and WriteTypedPrimitive, to allow this class to be useful for tests
that have effect on the prefix for other tests.
* XmlSerializationReaderTests.cs: Added tests for ToEnum.
* System.Xml_test.dll.Sources: Added XmlSerializationReaderTests.cs.
* XmlSerializationWriter.cs: Implemented 2.0 version of FromEnum, and
CreateInvalidEnumValueException. Set eol-style to native.
* XmlCustomerFormatter.cs: Added FromEnum overload that takes name of
enum for which string value must be created. Set eol-style to native.
Modified FromEnum to behave more like MSFT's implementation:
- treat value as bit field.
- no longer return empty string if the value matches an id for which there's 
no corresponding name.
- if one of the ids has value 0 and there's a match for the enum value
(with a zero length XML name) or the enum value is 0, then return the 
corresponding XML for the id with value 0.
- in 2.0 profile, throw InvalidOperationException if no match is found
for (part of) the enum value.
Modifies ToEnum to match the MSFT implementation (as described in
.NET 2.0 SDK):
- Expect hashtable containing enum names as key, and corresponding
integral numbers as value.
- Do not report exception for whitespace-only value.
- Support space (MS docs are not clear about this) delimited list 
of names.
- typeName is only used to construct exception message.

svn path=/trunk/mcs/; revision=56700
2006-02-09 13:30:02 +00:00
Lluis Sanchez 06cd746bed * DeserializeTests.cs: Added test for empty enum deserialization (bug #55509).
* XmlAttributesTests.cs, XmlReflectionImporterTests.cs,
	  XmlSerializationWriterTests.cs, XmlSerializerTests.cs:
	  Simplified namespace hierarchy.
	* XmlSerializerTestClasses.cs: Added more test classes.

svn path=/trunk/mcs/; revision=23956
2004-03-12 15:55:33 +00:00
Lluis Sanchez 9f8ae02700 * DeserializeTests.cs, XmlAttributesTests.cs: Changed namespace.
* XmlSerializationWriterTests.cs, XmlSerializerTests.cs: Make xml compares
	  independent from the text format.

svn path=/trunk/mcs/; revision=21319
2003-12-18 12:55:37 +00:00
Atsushi Eno 305ab3083d 2003-05-10 Atsushi Enomoto <[email protected]>
* added XmlSerializationWriterTests.cs. (by Erik)

svn path=/trunk/mcs/; revision=14428
2003-05-09 19:11:25 +00:00