-Added serialized/deserialized JSON when verbose tracing

-Fixed not using default serializer settings with primitive values and JToken.ToObject
-Fixed error writing BigIntegers with JsonWriter.WriteToken
This commit is contained in:
James Newton-King
2013-05-19 22:34:21 +12:00
parent 32f326e46a
commit f68794d206
19 changed files with 996 additions and 97 deletions
@@ -44,6 +44,7 @@ using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq;
#endif
using Newtonsoft.Json.Tests.Serialization;
namespace Newtonsoft.Json.Tests.Linq
{
@@ -63,6 +64,30 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(typeof(decimal), v.Value.GetType());
}
[Test]
public void ToObjectWithDefaultSettings()
{
try
{
JsonConvert.DefaultSettings = () =>
{
return new JsonSerializerSettings
{
Converters = { new MetroStringConverter() }
};
};
JValue v = new JValue(":::STRING:::");
string s = v.ToObject<string>();
Assert.AreEqual("string", s);
}
finally
{
JsonConvert.DefaultSettings = null;
}
}
[Test]
public void ChangeValue()
{