-Rewrote LINQ to JSON internals to use lists and dictionaries rather than a linked list

-Moved JPropertyDescriptor to Newtonsoft.Json.Linq namespace
This commit is contained in:
JamesNK
2011-05-28 00:46:38 +00:00
parent cc44f53c1a
commit b3cc3e88ac
19 changed files with 337 additions and 337 deletions
@@ -29,7 +29,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Newtonsoft.Json.Linq.ComponentModel;
using Newtonsoft.Json.Linq;
namespace Newtonsoft.Json.Tests.Linq.ComponentModel
@@ -165,7 +165,7 @@ Parameter name: arrayIndex")]
}
[Test]
[ExpectedException(typeof(ArgumentOutOfRangeException), ExpectedMessage = @"index is equal to or greater than Count.
[ExpectedException(typeof(ArgumentOutOfRangeException), ExpectedMessage = @"Index is equal to or greater than Count.
Parameter name: index")]
public void RemoveAtOutOfRangeIndexShouldError()
{
@@ -174,7 +174,7 @@ Parameter name: index")]
}
[Test]
[ExpectedException(typeof(ArgumentOutOfRangeException), ExpectedMessage = @"index is less than 0.
[ExpectedException(typeof(ArgumentOutOfRangeException), ExpectedMessage = @"Index is less than 0.
Parameter name: index")]
public void RemoveAtNegativeIndexShouldError()
{
@@ -253,7 +253,7 @@ Parameter name: index")]
}
[Test]
[ExpectedException(typeof(ArgumentOutOfRangeException), ExpectedMessage = @"Specified argument was out of the range of valid values.
[ExpectedException(typeof(ArgumentOutOfRangeException), ExpectedMessage = @"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index")]
public void InsertNegativeIndexShouldThrow()
{
@@ -262,7 +262,7 @@ Parameter name: index")]
}
[Test]
[ExpectedException(typeof(ArgumentOutOfRangeException), ExpectedMessage = @"Specified argument was out of the range of valid values.
[ExpectedException(typeof(ArgumentOutOfRangeException), ExpectedMessage = @"Index must be within the bounds of the List.
Parameter name: index")]
public void InsertOutOfRangeIndexShouldThrow()
{
@@ -121,6 +121,31 @@ namespace Newtonsoft.Json.Tests
return result;
}
[Test]
public void BuildJObject()
{
JObject o = new JObject();
for (int i = 0; i < 200; i++)
{
o[i.ToString()] = i;
}
string jsonText = o.ToString();
// this is extremely slow with 5000 interations
int interations = 100;
TimeOperation(() =>
{
JObject oo = null;
for (int i = 0; i < interations; i++)
{
oo = JObject.Parse(jsonText);
}
return oo;
}, "JObject");
}
private void SerializeSize(object value)
{
// this is extremely slow with 5000 interations
@@ -41,5 +41,5 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.2.0")]
#if !PocketPC
[assembly: AssemblyFileVersion("4.0.2.13722")]
[assembly: AssemblyFileVersion("4.0.2.13728")]
#endif