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); }