-Added DateFormatHandling to control whether dates are written in the MS format or ISO format, with ISO as the default

-Added DateTimeZoneHandling to control reading and writing DateTime time zone details
-Added reader/writer specific Formatting, DateFormatHandling and DateTimeZoneHandling to JsonSerializerSettings
-Added feature of reader/writer specific settings to be set on JsonReader/JsonWriter when serializing
-Added ReadAsDate to JsonReader
-Added ReadAsString to JsonReader
-Changed JsonTextReader to automatically read ISO strings as dates
-Refactored ReadAsXXX methods and reduce code redundancy
-Removed unused JsonDateTimeSerializationMode
This commit is contained in:
James Newton-King
2012-03-04 18:10:20 +06:00
parent fb2a5998bc
commit fd760e3389
43 changed files with 1728 additions and 826 deletions
@@ -290,10 +290,10 @@ namespace Newtonsoft.Json.Tests.Serialization
e = ex;
}
Assert.AreEqual(@"Error converting value ""kjhkjhkjhkjh"" to type 'System.DateTime'. Line 1, position 16.", e.Message);
Assert.AreEqual(@"Could not convert string to DateTime: kjhkjhkjhkjh. Line 1, position 16.", e.Message);
Assert.AreEqual(1, errors.Count);
Assert.AreEqual(@"[0][0] - 0 - Error converting value ""kjhkjhkjhkjh"" to type 'System.DateTime'. Line 1, position 16.", errors[0]);
Assert.AreEqual(@"[0][0] - 0 - Could not convert string to DateTime: kjhkjhkjhkjh. Line 1, position 16.", errors[0]);
}
[Test]