コード例 #1
0
 /// <summary>
 /// Asserts that the element is not checked.
 /// </summary>
 /// <param name="elementHandle">An <see cref="ElementHandle"/></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>
 /// <remarks><![CDATA[Elements: <command>, <input>]]></remarks>
 public static async Task ShouldNotBeCheckedAsync(this ElementHandle elementHandle, string because = null)
 {
     if (await elementHandle.IsCheckedAsync().ConfigureAwait(false))
     {
         Throw.ShouldNotBeChecked(elementHandle, because);
     }
 }
コード例 #2
0
 /// <summary>
 /// Asserts that the element is not checked.
 /// </summary>
 /// <param name="handle">An <see cref="ElementHandle"/></param>
 /// <param name="message">Optional failure message</param>
 /// <remarks><![CDATA[Elements: <command>, <input>]]></remarks>
 public static async Task ShouldNotBeCheckedAsync(this ElementHandle handle, string message = null)
 {
     if (await handle.IsCheckedAsync().ConfigureAwait(false))
     {
         Throw.ShouldNotBeChecked(handle, message);
     }
 }
コード例 #3
0
 /// <summary>
 /// Indicates whether the element is checked or not.
 /// </summary>
 /// <param name="handle">An <see cref="ElementHandle"/></param>
 /// <remarks><![CDATA[Elements: <command>, <input>]]></remarks>
 /// <returns><c>true</c> if the element is checked</returns>
 public static bool IsChecked(this ElementHandle handle)
 {
     return(handle.IsCheckedAsync().Result());
 }