Share via


BrokeredServiceContractTestBase<TInterface,TServiceMock>.AssertEventRaisedAsync Method

Definition

Overloads

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

Asserts that an event is raised with expected data.

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

Asserts that an event is raised with expected data.

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

Asserts that an event is raised with expected data.

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

Parameters

addHandler
Action<TInterface,EventHandler>

The delegate that can add the given handler to the event on the ClientProxy.

removeHandler
Action<TInterface,EventHandler>

The delegate that can remove the given handler from the event on the ClientProxy.

triggerEvent
Action<TServiceMock>

The delegate that calls directly into the Service to raise the event.

Returns

A Task that should be awaited by the test method.

Applies to

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

Asserts that an event is raised with expected data.

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

Type Parameters

TEventArgs

The type argument for the EventHandler<TEventArgs> delegate.

Parameters

addHandler
Action<TInterface,EventHandler<TEventArgs>>

The delegate that can add the given handler to the event on the ClientProxy.

removeHandler
Action<TInterface,EventHandler<TEventArgs>>

The delegate that can remove the given handler from the event on the ClientProxy.

triggerEvent
Action<TServiceMock>

The delegate that calls directly into the Service to raise the event.

argsAssertions
Action<TEventArgs>

A delegate to execute that contains assertions on the data sent with the event.

Returns

A Task that should be awaited by the test method.

Applies to