Exemple #1
0
 public static AndConnector <QueryWrapper> ShouldContain(this QueryWrapper query, string contents, StringComparison comparisonType = StringComparison.InvariantCulture)
 {
     return(query.AllShouldContain(contents, comparisonType));
 }
 /// <summary>
 /// Asserts that an element or element should exist one, and only once
 /// </summary>
 public static AndConnector <NodeWrapper> ShouldExistOnce(this QueryWrapper query)
 {
     return(new AndConnector <NodeWrapper>(Asserts.Single(query)));
 }
        /// <summary>
        /// Asserts that an element or element should exist exactly the specified number of times
        /// <param name="expectedNumberOfOccurrences">The expected number of times the element should exist</param>
        /// </summary>
        public static AndConnector <QueryWrapper> ShouldExistExactly(this QueryWrapper query, int expectedNumberOfOccurrences)
        {
            var nodeWrappers = Asserts.Exactly(query, expectedNumberOfOccurrences);

            return(new AndConnector <QueryWrapper>(nodeWrappers as QueryWrapper));
        }
Exemple #4
0
        /// <summary>
        /// Asserts that an element does not exist
        /// </summary>
        public static AndConnector <QueryWrapper> ShouldNotExist(this QueryWrapper query)
        {
            Asserts.False(query.Any());

            return(new AndConnector <QueryWrapper>(query));
        }