public void Test_GetObjectList_Null(string json) { IObjectReader reader = GetReader(json); IReadOnlyList <IObjectReader> list = reader.GetObjectList("a"); Assert.That(list, Is.Null); }
public void Test_GetObjectList_SingleNull(string json) { IObjectReader reader = GetReader(json); IReadOnlyList <IObjectReader> list = reader.GetObjectList("a"); Assert.That(list, Is.Not.Null); Assert.That(list, Has.Count.EqualTo(1)); Assert.That(list [0], Is.Null); }
/// <summary> /// Read a collection of child objects. /// Call when expecting zero to many objects in an array. /// </summary> public IReadOnlyList <IObjectReader> GetObjectList(string key) { try { return(_inner.GetObjectList(key)); } catch { return(null); } }
public void Test_GetObjectList_Values(string json) { IObjectReader reader = GetReader(json); IReadOnlyList <IObjectReader> list = reader.GetObjectList("a"); Assert.That(list, Is.Not.Null); Assert.That(list, Has.Count.EqualTo(2)); Assert.That(list [0], Is.Not.Null); Assert.That(list [1], Is.Not.Null); Assert.That(list [0].GetInt("b"), Is.EqualTo(1)); Assert.That(list [1].GetInt("c"), Is.EqualTo(2)); }
public void Test_GetObjectList_SameInstance(string json) { IObjectReader reader = GetReader(json); Assert.That(reader.GetObjectList("a"), Is.SameAs(reader.GetObjectList("a"))); }