-Fixed converting BigInteger to IConvertable type when deserializing

-Updated build and NuGet files for upgraded builds
This commit is contained in:
James Newton-King
2013-03-24 21:37:29 +13:00
parent d9d96b3e5c
commit e5ee60497e
6 changed files with 72 additions and 47 deletions
@@ -7500,13 +7500,27 @@ Parameter name: value",
}", json);
}
[Test]
public void ReadTooLargeInteger()
{
string json = @"[999999999999999999999999999999999999999999999999]";
IList<BigInteger> l = JsonConvert.DeserializeObject<IList<BigInteger>>(json);
Assert.AreEqual(BigInteger.Parse("999999999999999999999999999999999999999999999999"), l[0]);
ExceptionAssert.Throws<JsonSerializationException>(
"Error converting value 999999999999999999999999999999999999999999999999 to type 'System.Int64'. Path '[0]', line 1, position 49.",
() => JsonConvert.DeserializeObject<IList<long>>(json));
}
[Test]
public void ReadStringFloatingPointSymbols()
{
string json = @"[
'NaN',
'Infinity',
'-Infinity'
""NaN"",
""Infinity"",
""-Infinity""
]";
IList<float> floats = JsonConvert.DeserializeObject<IList<float>>(json);