-Added BigInteger support

This commit is contained in:
James Newton-King
2013-03-16 19:06:05 +13:00
parent b81dfd352a
commit 1356c31670
24 changed files with 957 additions and 50 deletions
@@ -28,6 +28,9 @@ using System;
using System.Collections.Concurrent;
#endif
using System.Collections.Generic;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
using System.Numerics;
#endif
#if !SILVERLIGHT && !NET20 && !NETFX_CORE
using System.ComponentModel.DataAnnotations;
using System.Configuration;
@@ -7617,6 +7620,19 @@ Parameter name: value",
}
#endif
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
public void SerializeBigInteger()
{
BigInteger i = BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990");
string json = JsonConvert.SerializeObject(new [] {i}, Formatting.Indented);
Assert.AreEqual(@"[
123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990
]", json);
}
#endif
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE)
[Test]
public void DeserializeReadOnlyList()