共用方式為


BrokeredServiceContractTestBase<TInterface,TServiceMock>.AssertEventRaisedAsync 方法

定義

多載

AssertEventRaisedAsync(Action<TInterface,EventHandler>, Action<TInterface,EventHandler>, Action<TServiceMock>)

判斷提示事件是以預期的數據引發。

AssertEventRaisedAsync<TEventArgs>(Action<TInterface,EventHandler<TEventArgs>>, Action<TInterface,EventHandler<TEventArgs>>, Action<TServiceMock>, Action<TEventArgs>)

判斷提示事件是以預期的數據引發。

AssertEventRaisedAsync(Action<TInterface,EventHandler>, Action<TInterface,EventHandler>, Action<TServiceMock>)

判斷提示事件是以預期的數據引發。

protected System.Threading.Tasks.Task AssertEventRaisedAsync (Action<TInterface,EventHandler> addHandler, Action<TInterface,EventHandler> removeHandler, Action<TServiceMock> triggerEvent);
member this.AssertEventRaisedAsync : Action<'Interface, EventHandler (requires 'Interface : null)> * Action<'Interface, EventHandler (requires 'Interface : null)> * Action<#'Interface> -> System.Threading.Tasks.Task
Protected Function AssertEventRaisedAsync (addHandler As Action(Of TInterface, EventHandler), removeHandler As Action(Of TInterface, EventHandler), triggerEvent As Action(Of TServiceMock)) As Task

參數

addHandler
Action<TInterface,EventHandler>

委派,可將指定的處理程式新增至 上的 ClientProxy事件。

removeHandler
Action<TInterface,EventHandler>

委派,可以從 上的 ClientProxy事件中移除指定的處理程式。

triggerEvent
Action<TServiceMock>

直接呼叫 至 Service 的委派,以引發 事件。

傳回

Task應該由測試方法等候的 。

適用於

AssertEventRaisedAsync<TEventArgs>(Action<TInterface,EventHandler<TEventArgs>>, Action<TInterface,EventHandler<TEventArgs>>, Action<TServiceMock>, Action<TEventArgs>)

判斷提示事件是以預期的數據引發。

protected System.Threading.Tasks.Task AssertEventRaisedAsync<TEventArgs> (Action<TInterface,EventHandler<TEventArgs>> addHandler, Action<TInterface,EventHandler<TEventArgs>> removeHandler, Action<TServiceMock> triggerEvent, Action<TEventArgs> argsAssertions);
member this.AssertEventRaisedAsync : Action<'Interface, EventHandler<'EventArgs> (requires 'Interface : null)> * Action<'Interface, EventHandler<'EventArgs> (requires 'Interface : null)> * Action<#'Interface> * Action<'EventArgs> -> System.Threading.Tasks.Task
Protected Function AssertEventRaisedAsync(Of TEventArgs) (addHandler As Action(Of TInterface, EventHandler(Of TEventArgs)), removeHandler As Action(Of TInterface, EventHandler(Of TEventArgs)), triggerEvent As Action(Of TServiceMock), argsAssertions As Action(Of TEventArgs)) As Task

類型參數

TEventArgs

委派的 EventHandler<TEventArgs> 型別自變數。

參數

addHandler
Action<TInterface,EventHandler<TEventArgs>>

委派,可將指定的處理程式新增至 上的 ClientProxy事件。

removeHandler
Action<TInterface,EventHandler<TEventArgs>>

委派,可以從 上的 ClientProxy事件中移除指定的處理程式。

triggerEvent
Action<TServiceMock>

直接呼叫 至 Service 的委派,以引發 事件。

argsAssertions
Action<TEventArgs>

要執行的委派,其中包含與 事件一起傳送之數據上的判斷提示。

傳回

Task應該由測試方法等候的 。

適用於