public void LeaveAxis() { var root = "//div"; var relative = "self::*[@id='myid']"; Assert.AreEqual("//div/self::*[@id='myid']", XPathBuilder.Concat(root, relative)); }
public void ConcatAsDescendant() { var root = "//div"; var relative = "*[@id='myid']"; Assert.AreEqual("//div/descendant::*[@id='myid']", XPathBuilder.Concat(root, relative)); }
public void RelativeIsEmpty() { var root = "//*[@id='aaa1']"; var relative = ""; Assert.AreEqual("//*[@id='aaa1']", XPathBuilder.Concat(root, relative)); }
public void ConcatTests(string root, string relative, string expectedResult) { // .Act var actualResult = XPathBuilder.Concat(root, relative); // .Assert Assert.AreEqual(expectedResult, actualResult, "Invalid concatenation result."); }
public void MultipleRootXpath() { var root = "//*[@id='aaa1'] | //*[@id='aaa2']"; var relative = "*[@id='bbb']"; Assert.AreEqual("//*[@id='aaa1']/descendant::*[@id='bbb']|//*[@id='aaa2']/descendant::*[@id='bbb']", XPathBuilder.Concat(root, relative)); }
public void MakeRelative() { var root = "//*[@id='aaa1']"; var relative = "//*[@id='bbb']"; Assert.AreEqual("//*[@id='aaa1']/descendant::*[@id='bbb']", XPathBuilder.Concat(root, relative)); }
public void RootIsEmpty(string root) { var relative = "div"; Assert.AreEqual("//div", XPathBuilder.Concat(root, relative)); }