-Fixed not erroring when reading undefined for nullable long

This commit is contained in:
James Newton-King
2017-07-23 13:50:49 +12:00
parent ad1a13728a
commit 403470d59a
8 changed files with 175 additions and 1 deletions
@@ -68,6 +68,30 @@ namespace Newtonsoft.Json.Tests.Linq
}
#endif
[Test]
public void ToObjectFromGuidToString()
{
JValue token = new JValue(new Guid("91274484-3b20-48b4-9d18-7d936b2cb88f"));
string value = token.ToObject<string>();
Assert.AreEqual("91274484-3b20-48b4-9d18-7d936b2cb88f", value);
}
[Test]
public void ToObjectFromIntegerToString()
{
JValue token = new JValue(1234);
string value = token.ToObject<string>();
Assert.AreEqual("1234", value);
}
[Test]
public void ToObjectFromStringToInteger()
{
JValue token = new JValue("1234");
int value = token.ToObject<int>();
Assert.AreEqual(1234, value);
}
[Test]
public void FromObjectGuid()
{