/// <summary> /// Asserts that the element does not exist. /// </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>The <see cref="ElementHandle"/> for method chaining</returns> public static ElementHandle ShouldNotExist(this ElementHandle elementHandle, string because = null) { if (elementHandle.Exists()) { Throw.ShouldNotExist(elementHandle, because); } return(elementHandle); }
/// <summary> /// Asserts that the element does not exist. /// </summary> /// <param name="handle">An <see cref="ElementHandle"/></param> /// <param name="message">Optional failure message</param> /// <returns>The <see cref="ElementHandle"/> for method chaining</returns> public static ElementHandle ShouldNotExist(this ElementHandle handle, string message = null) { if (handle.Exists()) { Throw.ShouldNotExist(handle, message); } return(handle); }