-Increment version to 6.0.3
-Test
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Newtonsoft.Json</id>
|
||||
<version>6.0.2</version>
|
||||
<version>6.0.3</version>
|
||||
<title>Json.NET</title>
|
||||
<description>Json.NET is a popular high-performance JSON framework for .NET</description>
|
||||
<authors>James Newton-King</authors>
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
properties {
|
||||
$zipFileName = "Json60r2.zip"
|
||||
$zipFileName = "Json60r3.zip"
|
||||
$majorVersion = "6.0"
|
||||
$majorWithReleaseVersion = "6.0.2"
|
||||
$majorWithReleaseVersion = "6.0.3"
|
||||
$version = GetVersion $majorWithReleaseVersion
|
||||
$signAssemblies = $false
|
||||
$signKeyPath = "C:\Development\Releases\newtonsoft.snk"
|
||||
|
||||
@@ -7860,6 +7860,50 @@ Parameter name: value",
|
||||
Assert.AreEqual("abc", v.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DateFormatStringWithDateTimeAndCulture()
|
||||
{
|
||||
CultureInfo culture = new CultureInfo("tr-TR");
|
||||
|
||||
DateTime dt = new DateTime(2000, 12, 22);
|
||||
string dateFormatString = "yyyy'-pie-'MMM'-'dddd'-'dd";
|
||||
JsonSerializerSettings settings = new JsonSerializerSettings
|
||||
{
|
||||
DateFormatString = dateFormatString,
|
||||
Culture = culture
|
||||
};
|
||||
|
||||
string json = JsonConvert.SerializeObject(dt, settings);
|
||||
|
||||
Assert.AreEqual(@"""2000-pie-Ara-Cuma-22""", json);
|
||||
|
||||
DateTime dt1 = JsonConvert.DeserializeObject<DateTime>(json, settings);
|
||||
|
||||
Assert.AreEqual(dt, dt1);
|
||||
|
||||
JsonTextReader reader = new JsonTextReader(new StringReader(json))
|
||||
{
|
||||
DateFormatString = dateFormatString,
|
||||
Culture = culture
|
||||
};
|
||||
JValue v = (JValue)JToken.ReadFrom(reader);
|
||||
|
||||
Assert.AreEqual(JTokenType.Date, v.Type);
|
||||
Assert.AreEqual(typeof(DateTime), v.Value.GetType());
|
||||
Assert.AreEqual(dt, (DateTime)v.Value);
|
||||
|
||||
reader = new JsonTextReader(new StringReader(@"""2000-pie-Dec-Friday-22"""))
|
||||
{
|
||||
DateFormatString = dateFormatString,
|
||||
Culture = culture
|
||||
};
|
||||
v = (JValue)JToken.ReadFrom(reader);
|
||||
|
||||
Assert.AreEqual(JTokenType.String, v.Type);
|
||||
Assert.AreEqual(typeof(string), v.Value.GetType());
|
||||
Assert.AreEqual("2000-pie-Dec-Friday-22", v.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DateFormatStringWithDictionaryKey()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user