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测试方法应等待的 。