Пример #1
0
 public void XpathEvaluatesMultiNodeExpression()
 {
     string expectedValue = "onetwo";
     XPath xpath = new XPath(MULTI_NODE_XPATH);
     Assert.Equal(expectedValue,
                  xpath.EvaluateXPath(MORE_COMPLEX_XML));
 }
Пример #2
0
 public void XpathEvaluatesCountExpression()
 {
     string expectedValue = "2";
     XPath xpath = new XPath(COUNT_XPATH);
     Assert.Equal(expectedValue,
                  xpath.EvaluateXPath(MORE_COMPLEX_XML));
 }
Пример #3
0
 public void XpathEvaluatesToEmptyStringForUnmatchedExpression()
 {
     string expectedValue = "";
     XPath xpath = new XPath(NONEXISTENT_XPATH);
     Assert.Equal(expectedValue,
                  xpath.EvaluateXPath(SIMPLE_XML));
 }
Пример #4
0
 public void XpathEvaluatesToTextValueForSimpleString()
 {
     string expectedValue = "one two";
     XPath xpath = new XPath(EXISTENT_XPATH);
     Assert.Equal(expectedValue,
                  xpath.EvaluateXPath(SIMPLE_XML));
 }
Пример #5
0
 public static void AssertXPathEvaluatesTo(string anXPathExpression, XmlInput inXml,
                                           string expectedValue)
 {
     XPath xpath = new XPath(anXPathExpression);
     Equal(expectedValue, xpath.EvaluateXPath(inXml));
 }
Пример #6
0
 public static void AssertXPathExists(string anXPathExpression, XmlInput inXml)
 {
     XPath xpath = new XPath(anXPathExpression);
     True(xpath.XPathExists(inXml));
 }
Пример #7
0
 public void XpathExistsFalseForUnmatchedExpression()
 {
     XPath xpath = new XPath(NONEXISTENT_XPATH);
     Assert.Equal(false,
                  xpath.XPathExists(SIMPLE_XML));
 }
Пример #8
0
 public void XpathExistsTrueForXpathThatExists()
 {
     XPath xpath = new XPath(EXISTENT_XPATH);
     Assert.Equal(true,
                  xpath.XPathExists(SIMPLE_XML));
 }