-Added additional ToString overloads to JValue

-Fixed poor error message when dynamic type cannot be created during deserialization
-Fixed error when setting a null value on a dynamic type during deserialization
-Fixed JsonTextReader.ReadAsDecimal not attempting to convert string values to decimal
This commit is contained in:
JamesNK
2011-02-24 10:14:08 +00:00
parent 1824aa4b59
commit 71446e9772
8 changed files with 169 additions and 11 deletions
@@ -185,7 +185,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual("", d.Null.ToString());
Assert.AreEqual("1", d.Integer.ToString());
Assert.AreEqual("1.1", d.Float.ToString());
Assert.AreEqual("1.1", d.Float.ToString(CultureInfo.InvariantCulture));
Assert.AreEqual("12/29/2000 23:51:10", d.DateTime.ToString(null, CultureInfo.InvariantCulture));
Assert.AreEqual("True", d.Boolean.ToString());
Assert.AreEqual("A string lol!", d.String.ToString());
@@ -25,6 +25,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using NUnit.Framework;
@@ -285,7 +286,7 @@ keyword such as type of business.""
1264118400000
)", o.Property("Establised").Value.ToString());
Assert.AreEqual(@"""Width"": 1.1", o.Property("Width").ToString());
Assert.AreEqual(@"1.1", o.Property("Width").Value.ToString());
Assert.AreEqual(@"1.1", ((JValue)o.Property("Width").Value).ToString(CultureInfo.InvariantCulture));
Assert.AreEqual(@"""Open"": false", o.Property("Open").ToString());
Assert.AreEqual(@"False", o.Property("Open").Value.ToString());