public void CreateEnumerablePathSegmentFromSegmentText_Expected_EnumerableJsonPathSegment() { var path = new JsonPath(); var segment = path.CreatePathSegment("EnumerableData()"); const bool expected = true; var actual = segment.IsEnumarable; Assert.AreEqual(expected, actual); }
public void ToStringOnScalarSegment_WhereEnumerablesArentConsidered__Expected_ScalarFormat() { JsonPath path = new JsonPath(); IPathSegment segment = path.CreatePathSegment("Name"); string expected = "Name"; string actual = segment.ToString(false); Assert.AreEqual(expected, actual); }
public void CreateScalarPathSegmentFromSegmentText_Expected_ScalarJsonPathSegment() { var path = new JsonPath(); var segment = path.CreatePathSegment("Name"); const bool expected = false; var actual = segment.IsEnumarable; Assert.AreEqual(expected, actual); }
public void ToStringOnEnumerableSegment_WhereEnumerablesAreConsidered_Expected_ScalarFormat() { JsonPath path = new JsonPath(); IPathSegment segment = path.CreatePathSegment("Collection()"); string expected = "Collection()"; string actual = segment.ToString(true); Assert.AreEqual(expected, actual); }
public void ToStringOnScalarSegment_Expected_ScalarFormat() { JsonPath path = new JsonPath(); IPathSegment segment = path.CreatePathSegment("Name"); string expected = "Name"; string actual = segment.ToString(); Assert.AreEqual(expected, actual); }
public void ToStringOnEnumerableSegment_WhereEnumerablesArentConsidered_Expected_ScalarFormat() { var path = new JsonPath(); var segment = path.CreatePathSegment("Collection()"); const string expected = "Collection"; var actual = segment.ToString(false); Assert.AreEqual(expected, actual); }
public void ToStringOnEnumerableSegment_Expected_EnumerableFormat() { var path = new JsonPath(); var segment = path.CreatePathSegment("Collection()"); const string expected = "Collection()"; var actual = segment.ToString(); Assert.AreEqual(expected, actual); }
public void ToStringOnScalarSegment_WhereEnumerablesAreConsidered__Expected_ScalarFormat() { var path = new JsonPath(); var segment = path.CreatePathSegment("Name"); const string expected = "Name"; var actual = segment.ToString(true); Assert.AreEqual(expected, actual); }
public void CreateScalarPathSegmentFromJProperty_Expected_ScalarJsonPathSegment() { var jProperty = new JProperty("ScalarProperty", "ScalarValue"); var path = new JsonPath(); var segment = path.CreatePathSegment(jProperty); const bool expected = false; var actual = segment.IsEnumarable; Assert.AreEqual(expected, actual); }
public void CreateEnumerablePathSegmentFromJProperty_Expected_EnumerableJsonPathSegment() { var jProperty = new JProperty("EnumerableProperty", new JArray( new JObject(new JProperty("ScalarProperty", "ScalarValue"), new JProperty("ScalarProperty1", "ScalarValue1")))); var path = new JsonPath(); var segment = path.CreatePathSegment(jProperty); const bool expected = true; var actual = segment.IsEnumarable; Assert.AreEqual(expected, actual); }