共用方式為


TestingUtils.WaitUntilAsync 方法

定義

多載

WaitUntilAsync(Func<Boolean,Task<Boolean>>, TimeSpan)

執行述詞,直到成功或逾時為止

WaitUntilAsync(Func<Boolean,Task<Boolean>>, TimeSpan, Nullable<TimeSpan>)

執行述詞,直到成功或逾時為止

WaitUntilAsync(Func<Boolean,Task<Boolean>>, TimeSpan)

執行述詞,直到成功或逾時為止

public static System.Threading.Tasks.Task WaitUntilAsync (Func<bool,System.Threading.Tasks.Task<bool>> predicate, TimeSpan timeout);
static member WaitUntilAsync : Func<bool, System.Threading.Tasks.Task<bool>> * TimeSpan -> System.Threading.Tasks.Task
Public Function WaitUntilAsync (predicate As Func(Of Boolean, Task(Of Boolean)), timeout As TimeSpan) As Task

參數

predicate
Func<Boolean,Task<Boolean>>

要執行的述詞

timeout
TimeSpan

逾時值

傳回

如果述詞成功,則為 True,否則為 false

適用於

WaitUntilAsync(Func<Boolean,Task<Boolean>>, TimeSpan, Nullable<TimeSpan>)

來源:
TestingUtils.cs

執行述詞,直到成功或逾時為止

public static System.Threading.Tasks.Task WaitUntilAsync (Func<bool,System.Threading.Tasks.Task<bool>> predicate, TimeSpan timeout, TimeSpan? delayOnFail = default);
static member WaitUntilAsync : Func<bool, System.Threading.Tasks.Task<bool>> * TimeSpan * Nullable<TimeSpan> -> System.Threading.Tasks.Task
Public Shared Function WaitUntilAsync (predicate As Func(Of Boolean, Task(Of Boolean)), timeout As TimeSpan, Optional delayOnFail As Nullable(Of TimeSpan) = Nothing) As Task

參數

predicate
Func<Boolean,Task<Boolean>>

要執行的述詞

timeout
TimeSpan

逾時值

delayOnFail
Nullable<TimeSpan>

失敗時延遲下一次呼叫的時間

傳回

如果述詞成功,則為 True,否則為 false

適用於