Moq |
IRaise<(Of <(<'T>)>)>..::..Raises Method (Action<(Of <(<'T>)>)>, EventArgs) |
IRaise<(Of <(<'T>)>)> Interface Example See Also Send Feedback |
Specifies the event that will be raised
when the setup is met.
Namespace: Moq.Language
Assembly: Moq (in Moq.dll) Version: 4.0.10827.0 (4.0.0.0)
Syntax
Parameters
- eventExpression
- Type: System..::..Action<(Of <(<'T>)>)>
An expression that represents an event attach or detach action.
- args
- Type: System..::..EventArgs
The event arguments to pass for the raised event.
Examples
The following example shows how to raise an event when
the setup is met:
CopyC#
var mock = new Mock<IContainer>(); mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) .Raises(add => add.Added += null, EventArgs.Empty);