public void Letting_Assert_String()
        {
            XmlDocument doc = new XmlDocument();
             doc.LoadXml("<foo>bar</foo>");
             XPathNavigator nav = doc.DocumentElement.CreateNavigator();

             XPathQueryLanguage query = new XPathQueryLanguage();
             object context = query.CreateMatchContext(null, doc);
             query.Let(context, "x", "'bar'");
             Assertion assert = new Assertion();
             assert.Test = ". = $x";
             Assert.IsTrue(query.Assert(assert, context, nav));

             context = query.CreateMatchContext(null, doc);
             query.Let(context, "x", "'foo'");
             Assert.IsFalse(query.Assert(assert, context, nav));
        }
        public void Asserting()
        {
            XPathQueryLanguage query = new XPathQueryLanguage();

             SchematronDocument a = Load("Schematron/Samples/All.sch");
             Rule rule = FindRule(a, "foo");
             Assertion assertion = (Assertion)rule.Assertions[0];

             XmlDocument doc;
             object matchContext;

             doc = new XmlDocument();
             doc.LoadXml("<doc><foo>bar</foo><foo>x</foo></doc>");
             matchContext = query.CreateMatchContext(a, doc);
             XPathNavigator nav = doc.DocumentElement.CreateNavigator();
             nav.MoveToFirstChild();
             Assert.IsTrue(query.Assert(assertion, matchContext, nav));

             nav.MoveToNext();
             Assert.IsFalse(query.Assert(assertion, matchContext, nav));
        }