internal KeyValueEnumerator(DataModelList list) { _count = list._count; list.CreateArgs(out _args); _args.Index = -1; Current = default; }
public void ArrayTest() { // arrange var list = new DataModelList { new DataModelList { ["key1"] = "val1" }, new DataModelList { ["key2"] = "val2" } }; var root = new DataModelList { ["root"] = list }; /* list.Add("", "empty"); * list.Add(":#$%", "symbol"); * list.Add("b", true); * list.Add("n", 1.5); * list.Add("dttm", DateTime.UtcNow); * list.Add("nl", DataModelValue.Null); * list.Add("undef", default); * list.Add(null, default, default);*/ var nav = new DataModelXPathNavigator(root); // act var _ = (XPathNodeIterator?)nav.Evaluate("/root/node()"); // assert //Assert.AreEqual(expected: "e", xml); }
public override HttpContent?TryCreateHttpContent(WebRequest webRequest, string?contentType, DataModelList parameters, DataModelValue value) { if (!ContentTypeEquals(contentType, MediaTypeApplicationFormUrlEncoded)) { return(default);
public DataModelArrayWrapper(Engine engine, DataModelList list) : base(engine) { _list = list; var writable = list.Access == DataModelAccess.Writable; Extensible = writable; base.SetOwnProperty(propertyName: @"length", new PropertyDescriptor((uint)_list.Count, writable, enumerable: false, configurable: false)); }
private static XPathNodeIterator CreateIterator(DataModelList list, string key) { var navigator = new DataModelXPathNavigator(list); navigator.MoveToFirstChild(); while (navigator.Name != key) { var moved = navigator.MoveToNext(); Infra.Assert(moved); } return(new XPathSingleElementIterator(navigator)); }
public DataModelList GetProperties() { var properties = new DataModelList { { @"SessionId", SessionId }, { @"InvokeType", Type.ToString() } }; if (Source is { } source) { properties.Add(key: @"Source", source.ToString()); } properties.MakeDeepConstant(); return(properties); }
public DataModelList GetProperties() { var properties = new DataModelList(); if (Uri is { } uri) { properties.Add(key: @"Uri", uri.ToString()); } if (Scxml is { } scxml) { properties.Add(key: @"SCXML", scxml); } properties.MakeDeepConstant(); return(properties); }
public void RenderValidXml() { // arrange var root = new DataModelList { { "root", new DataModelList { { "item", "val1" }, { "item", "val2" } }, new DataModelList { "prefix", "namespace-uri", "attr1", "aVal1", "", "", "attr2", "aVal2", "pfx", "attr-ns", "myNs", "myNamespace", "", "http://www.w3.org/2000/xmlns/" } } }; // act var navigator = new DataModelXPathNavigator(root); // assert var xml = navigator.InnerXml; var value = XmlConverter.FromXml(xml); var n2 = new DataModelXPathNavigator(value); var xml2 = n2.InnerXml; var dataModelValue2 = XmlConverter.FromXml(xml2); var n3 = new DataModelXPathNavigator(dataModelValue2); var _ = n3.InnerXml; }
public virtual HttpContent?TryCreateHttpContent(WebRequest webRequest, string?contentType, DataModelList parameters, DataModelValue value) => default;
public virtual ValueTask <DataModelValue?> TryParseResponseAsync(WebResponse webResponse, DataModelList parameters, CancellationToken token) => default;
public override HttpContent?TryCreateHttpContent(WebRequest webRequest, string?contentType, DataModelList parameters, DataModelValue value) => ContentTypeEquals(contentType, MediaTypeApplicationJson) ? new HttpClientJsonHandlerHttpContent(value, MediaTypeApplicationJson) : default;
public virtual void PrepareRequest(WebRequest webRequest, string?contentType, DataModelList parameters, DataModelValue value) { }
public override async ValueTask <DataModelValue?> TryParseResponseAsync(WebResponse webResponse, DataModelList parameters, CancellationToken token) { if (webResponse is null) { throw new ArgumentNullException(nameof(webResponse)); } if (!ContentTypeEquals(webResponse.ContentType, MediaTypeApplicationJson)) { return(default);
public ListInfo(DataModelList dataModelList) => _dataModelList = dataModelList;
public DebugView(DataModelList dataModelList) => _dataModelList = dataModelList;
public override void PrepareRequest(WebRequest webRequest, string?contentType, DataModelList parameters, DataModelValue value) => AppendAcceptHeader(webRequest, MediaTypeApplicationJson);
public DataModelObjectWrapper(Engine engine, DataModelList list) : base(engine) { _list = list; Extensible = list.Access == DataModelAccess.Writable; }
internal KeyValuePairEnumerable(DataModelList list) => _list = list;
public void DataModelListNullTest() { // arrange DataModelList nullVal = default !;