/// <summary> /// Asserts that any node contains the specified text /// </summary> public static AndConnector <QueryWrapper> AnyShouldContain(this QueryWrapper query, string contents, StringComparison comparisonType = StringComparison.Ordinal) { query.ShouldExist(); Asserts.Any(contents, query.Select(x => x.InnerText), x => x.IndexOf(contents, comparisonType) >= 0); return(new AndConnector <QueryWrapper>(query)); }
/// <summary> /// Asserts that all elements should be of a specific class /// </summary> public static AndConnector <QueryWrapper> ShouldBeOfClass(this QueryWrapper query, string className) { query.ShouldExist(); foreach (var node in query) { node.ShouldBeOfClass(className); } return(new AndConnector <QueryWrapper>(query)); }
/// <summary> /// Asserts that an element has a specific attribute with a specified value /// </summary> public static AndConnector <QueryWrapper> ShouldContainAttribute(this QueryWrapper query, string name, string value, StringComparison comparisonType = StringComparison.Ordinal) { query.ShouldExist(); foreach (var node in query) { node.ShouldContainAttribute(name, value); } return(new AndConnector <QueryWrapper>(query)); }
/// <summary> /// Asserts that an element has a specific attribute /// </summary> public static AndConnector <QueryWrapper> ShouldContainAttribute(this QueryWrapper query, string name) { query.ShouldExist(); foreach (var node in query) { node.ShouldContainAttribute(name); } return(new AndConnector <QueryWrapper>(query)); }