Exemplo n.º 1
0
 public void XpathEvaluatesToTextValueForSimpleString()
 {
     string expectedValue = "one two";
     XPath xpath = new XPath(EXISTENT_XPATH);
     Assert.AreEqual(expectedValue,
                            xpath.EvaluateXPath(SIMPLE_XML));
 }
Exemplo n.º 2
0
 public void XpathEvaluatesToEmptyStringForUnmatchedExpression()
 {
     string expectedValue = "";
     XPath xpath = new XPath(NONEXISTENT_XPATH);
     Assert.AreEqual(expectedValue,
                            xpath.EvaluateXPath(SIMPLE_XML));
 }
Exemplo n.º 3
0
 public void XpathEvaluatesMultiNodeExpression()
 {
     string expectedValue = "onetwo";
     XPath xpath = new XPath(MULTI_NODE_XPATH);
     Assert.AreEqual(expectedValue,
                            xpath.EvaluateXPath(MORE_COMPLEX_XML));
 }
Exemplo n.º 4
0
 public void XpathEvaluatesCountExpression()
 {
     string expectedValue = "2";
     XPath xpath = new XPath(COUNT_XPATH);
     Assert.AreEqual(expectedValue,
                            xpath.EvaluateXPath(MORE_COMPLEX_XML));
 }
Exemplo n.º 5
0
 public static void XPathExists(string anXPathExpression, XmlInput inXml)
 {
     XPath xpath = new XPath(anXPathExpression);
     Assert.AreEqual(true, xpath.XPathExists(inXml));
 }
Exemplo n.º 6
0
 public static void XPathEvaluatesTo(string anXPathExpression, XmlInput inXml, 
     string expectedValue)
 {
     XPath xpath = new XPath(anXPathExpression);
     Assert.AreEqual(expectedValue, xpath.EvaluateXPath(inXml));
 }
Exemplo n.º 7
0
 public void XpathExistsTrueForXpathThatExists()
 {
     XPath xpath = new XPath(EXISTENT_XPATH);
     Assert.AreEqual(true,
                            xpath.XPathExists(SIMPLE_XML));
 }
Exemplo n.º 8
0
 public void XpathExistsFalseForUnmatchedExpression()
 {
     XPath xpath = new XPath(NONEXISTENT_XPATH);
     Assert.AreEqual(false,
                            xpath.XPathExists(SIMPLE_XML));
 }