Пример #1
0
        public void XPathMatcher_IsMatch_RejectOnMatch()
        {
            // Assign
            string xml     = @"
                    <todo-list>
                        <todo-item id='a1'>abc</todo-item>
                    </todo-list>";
            var    matcher = new XPathMatcher(MatchBehaviour.RejectOnMatch, false, "/todo-list[count(todo-item) = 1]");

            // Act
            double result = matcher.IsMatch(xml);

            // Assert
            Check.That(result).IsEqualTo(0.0);
        }
Пример #2
0
        public void XPathMatcher_IsMatch_AcceptOnMatch()
        {
            // Assign
            string xml     = @"
                    <todo-list>
                        <todo-item id='a1'>abc</todo-item>
                    </todo-list>";
            var    matcher = new XPathMatcher("/todo-list[count(todo-item) = 1]");

            // Act
            double result = matcher.IsMatch(xml);

            // Assert
            Check.That(result).IsEqualTo(1.0);
        }