-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:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user