-Changed JObject to enumerate over KeyValuePair<string, JToken> rather than JToken. Breaking change.

This commit is contained in:
JamesNK
2009-04-27 08:49:08 +00:00
parent 6e205383c7
commit 52f8657106
5 changed files with 68 additions and 16 deletions
@@ -31,5 +31,18 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(2, (int)constructor.Children().ElementAt(1));
Assert.AreEqual(3, (int)constructor.Children().ElementAt(2));
}
[Test]
public void Iterate()
{
JConstructor c = new JConstructor("MrConstructor", 1, 2, 3, 4, 5);
int i = 1;
foreach (JToken token in c)
{
Assert.AreEqual(i, (int)token);
i++;
}
}
}
}