Пример #1
0
 /// <summary>
 /// Asserts that the element does not have the specified class.
 /// </summary>
 /// <param name="elementHandle">An <see cref="ElementHandle"/></param>
 /// <param name="className">The class name</param>
 /// <param name="because">A phrase explaining why the assertion is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.</param>
 /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
 public static async Task ShouldNotHaveClassAsync(this ElementHandle elementHandle, string className, string because = null)
 {
     if (await elementHandle.HasClassAsync(className).ConfigureAwait(false))
     {
         Throw.ShouldNotHaveClass(elementHandle, className, because);
     }
 }
 /// <summary>
 /// Asserts that the element does not have the specified class.
 /// </summary>
 /// <param name="handle">An <see cref="ElementHandle"/></param>
 /// <param name="className">The class name</param>
 /// <param name="message">Optional failure message</param>
 public static async Task ShouldNotHaveClassAsync(this ElementHandle handle, string className, string message = null)
 {
     if (await handle.HasClassAsync(className).ConfigureAwait(false))
     {
         Throw.ShouldNotHaveClass(handle, message);
     }
 }
 /// <summary>
 /// Indicates whether the element has the specified class or not.
 /// </summary>
 /// <param name="handle">An <see cref="ElementHandle"/></param>
 /// <param name="className">The class name</param>
 /// <returns><c>true</c> if the element has the specified class</returns>
 public static bool HasClass(this ElementHandle handle, string className)
 {
     return(handle.HasClassAsync(className).Result());
 }