-Fixed JTokenWriter sometimes losing types when writing JToken

This commit is contained in:
James Newton-King
2016-04-29 16:21:41 +12:00
parent 81098652b3
commit 86c2f80311
6 changed files with 167 additions and 9 deletions
@@ -55,6 +55,19 @@ namespace Newtonsoft.Json.Tests.Linq
[TestFixture]
public class LinqToJsonTest : TestFixtureBase
{
[Test]
public void ToObject_Guid()
{
JObject anon = new JObject
{
["id"] = Guid.NewGuid()
};
Assert.AreEqual(JTokenType.Guid, anon["id"].Type);
Dictionary<string, JToken> dict = anon.ToObject<Dictionary<string, JToken>>();
Assert.AreEqual(JTokenType.Guid, dict["id"].Type);
}
public class TestClass_ULong
{
public ulong Value { get; set; }