-Added missing XML documentation
-Fixed potential null reference error when getting attributes -Performance documentation
This commit is contained in:
@@ -1881,6 +1881,24 @@ Parameter name: arrayIndex",
|
||||
Assert.IsTrue(JToken.DeepEquals(b, a));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetValueBlogExample()
|
||||
{
|
||||
JObject o = JObject.Parse(@"{
|
||||
'name': 'Lower',
|
||||
'NAME': 'Upper'
|
||||
}");
|
||||
|
||||
string exactMatch = (string)o.GetValue("NAME", StringComparison.OrdinalIgnoreCase);
|
||||
// Upper
|
||||
|
||||
string ignoreCase = (string)o.GetValue("Name", StringComparison.OrdinalIgnoreCase);
|
||||
// Lower
|
||||
|
||||
Assert.AreEqual("Upper", exactMatch);
|
||||
Assert.AreEqual("Lower", ignoreCase);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetValue()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user