-Fixed converting BigInteger to IConvertable type when deserializing
-Updated build and NuGet files for upgraded builds
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user