/// <summary> /// Waits until Regex query is printed on session output and /// executes handler /// </summary> /// <param name="query">expected output in RegEx</param> /// <param name="handler">action to be performed</param> /// <exception cref="System.TimeoutException">Thrown when query is not find for given /// amount of time</exception> public void ExpectMatch(string query, ExpectedHandler handler) { ExpectMatch(query, (s) => handler()); }
/// <summary> /// Waits until query is printed on session output and /// executes handler /// </summary> /// <param name="query">expected output in RegEx</param> /// <param name="handler">action to be performed</param> /// <exception cref="System.TimeoutException">Thrown when query is not find for given /// amount of time</exception> public async Task ExpectMatchAsync(string query, ExpectedHandler handler) { await ExpectMatchAsync(query, s => handler()).ConfigureAwait(false); }
public async Task ExpectAsync(Regex regex, ExpectedHandler handler) { await ExpectAsync(new RegexMatcher(regex), s => handler()).ConfigureAwait(false); }
/// <summary> /// Timeout value in miliseconds for Expect function /// </summary> /// <summary> /// Waits until query is printed on session output and /// executes handler /// </summary> /// <param name="query">expected output</param> /// <param name="handler">action to be performed</param> /// <exception cref="System.TimeoutException">Thrown when query is not find for given /// amount of time</exception> public async Task ExpectAsync(string query, ExpectedHandler handler) { await ExpectAsync(new StringContainsMatcher(query), s => handler()).ConfigureAwait(false); }
public void Expect(Regex regex, ExpectedHandler handler, Int32 timeout = 0) { Expect(new RegexMatcher(regex), (s) => handler(), timeout); }
/// <summary> /// Waits until query is printed on session output and /// executes handler /// </summary> /// <param name="query">expected output</param> /// <param name="handler">action to be performed</param> /// <param name="timeout">read time, unit: miliseconds</param> /// <exception cref="System.TimeoutException">Thrown when query is not find for given /// amount of time</exception> public void Expect(string query, ExpectedHandler handler, Int32 timeout = 0) { Expect(new StringContainsMatcher(query), (s) => handler(), timeout); }