Method RaisesAny
- Namespace
- Xunit
- Assembly
- xunit.v3.assert.dll
RaisesAny(Action<EventHandler>, Action<EventHandler>, Action)
Verifies that an event is raised.
public static Assert.RaisedEvent<EventArgs> RaisesAny(Action<EventHandler> attach, Action<EventHandler> detach, Action testCode)
Parameters
attachAction<EventHandler>Code to attach the event handler
detachAction<EventHandler>Code to detach the event handler
testCodeActionA delegate to the code to be tested
Returns
The event sender and arguments wrapped in an object
Exceptions
Thrown when the expected event was not raised.
RaisesAny<T>(Action<Action<T>>, Action<Action<T>>, Action)
Verifies that an event with the exact or a derived event args is raised.
public static Assert.RaisedEvent<T> RaisesAny<T>(Action<Action<T>> attach, Action<Action<T>> detach, Action testCode)
Parameters
attachAction<Action<T>>Code to attach the event handler
detachAction<Action<T>>Code to detach the event handler
testCodeActionA delegate to the code to be tested
Returns
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Exceptions
Thrown when the expected event was not raised.
RaisesAny<T>(Action<EventHandler<T>>, Action<EventHandler<T>>, Action)
Verifies that an event with the exact or a derived event args is raised.
public static Assert.RaisedEvent<T> RaisesAny<T>(Action<EventHandler<T>> attach, Action<EventHandler<T>> detach, Action testCode)
Parameters
attachAction<EventHandler<T>>Code to attach the event handler
detachAction<EventHandler<T>>Code to detach the event handler
testCodeActionA delegate to the code to be tested
Returns
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Exceptions
Thrown when the expected event was not raised.