-Changed JObject to enumerate over KeyValuePair<string, JToken> rather than JToken. Breaking change.
This commit is contained in:
@@ -353,5 +353,18 @@ Parameter name: index")]
|
||||
]
|
||||
}", result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Iterate()
|
||||
{
|
||||
JArray a = new JArray(1, 2, 3, 4, 5);
|
||||
|
||||
int i = 1;
|
||||
foreach (JToken token in a)
|
||||
{
|
||||
Assert.AreEqual(i, (int)token);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user