BrokeredServiceContractTestBase<TInterface,TServiceMock>.AssertEventRaisedAsync 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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事件中移除指定的處理程式。
傳回
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事件中移除指定的處理程式。
- argsAssertions
- Action<TEventArgs>
要執行的委派,其中包含與 事件一起傳送之數據上的判斷提示。
傳回
Task應該由測試方法等候的 。