Raises(T) Method (MockedEvent, (T, ))

Moq 2.6

Specifies the mocked event that will be raised when the expectation is met.

Namespace:  Moq.Language
Assembly:  Moq (in Moq.dll) Version: 2.6.1014.1 (2.6.0.0)

Syntax

C#
IVerifies Raises<T>(
	MockedEvent eventHandler,
	Func<T, EventArgs> func
)

Parameters

eventHandler
Type: Moq..::.MockedEvent
The mocked event, retrieved from CreateEventHandler()()() or CreateEventHandler<(Of <(TEventArgs>)>)()()().
func
Type: Func<(Of <(T, EventArgs>)>)
A function that will build the EventArgs to pass when raising the event.

Type Parameters

T
Type of the argument received by the expected invocation.

See Also