Esempio n. 1
0
        public void AddSelectAttribute()
        {
            var item       = ElementFactory.Local.FromXml("<Item type='Part' pagesize='250' action='get'></Item>").AssertItem();
            var selectNode = new SelectNode();

            selectNode.EnsurePath("id");
            selectNode.EnsurePath("state");
            selectNode.EnsurePath("keyed_name");

            item.Select().Set(selectNode);

            Assert.AreEqual("id,state,keyed_name", item.Select().Value);
        }
Esempio n. 2
0
        public void SelectNode_EnsurePath()
        {
            var node = new SelectNode();

            node.EnsurePath("first");
            node.EnsurePath("second", "thing");
            node.EnsurePath("second", "another2", "id");
            node.EnsurePath("second", "another2", "config_id");
            node.EnsurePath("no_paren");
            node.EnsurePath("third");
            node.EnsurePath("third", "stuff");
            node.EnsurePath("another", "id");
            var actual = node.ToString();

            Assert.AreEqual("first,second(thing,another2(id,config_id)),no_paren,third(stuff),another(id)", actual);
        }