Class EventAsserts
- Namespace
- Asserts
- Assembly
- xunit.v3.assert.dll
public class EventAsserts
- Inheritance
-
EventAsserts
- Inherited Members
Methods
Raises(Action<Action>, Action<Action>, Action)
Verifies that an event is raised.
public static void Raises(Action<Action> attach, Action<Action> detach, Action testCode)
Parameters
attachAction<Action>Code to attach the event handler
detachAction<Action>Code to detach the event handler
testCodeActionA delegate to the code to be tested
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.
RaisesAny(Action<EventHandler>, Action<EventHandler>, Action)
Verifies that an event is raised.
public static EventAsserts.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
- EventAsserts.RaisedEvent<EventArgs>
The event sender and arguments wrapped in an object
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.
RaisesAnyAsync(Action<EventHandler>, Action<EventHandler>, Func<Task>)
Verifies that an event is raised.
public static Task<EventAsserts.RaisedEvent<EventArgs>> RaisesAnyAsync(Action<EventHandler> attach, Action<EventHandler> detach, Func<Task> testCode)
Parameters
attachAction<EventHandler>Code to attach the event handler
detachAction<EventHandler>Code to detach the event handler
testCodeFunc<Task>A delegate to the code to be tested
Returns
- Task<EventAsserts.RaisedEvent<EventArgs>>
The event sender and arguments wrapped in an object
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.
RaisesAnyAsync<T>(Action<Action<T>>, Action<Action<T>>, Func<Task>)
Verifies that an event with the exact or a derived event args is raised.
public static Task<EventAsserts.RaisedEvent<T>> RaisesAnyAsync<T>(Action<Action<T>> attach, Action<Action<T>> detach, Func<Task> testCode)
Parameters
attachAction<Action<T>>Code to attach the event handler
detachAction<Action<T>>Code to detach the event handler
testCodeFunc<Task>A delegate to the code to be tested
Returns
- Task<EventAsserts.RaisedEvent<T>>
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.
RaisesAnyAsync<T>(Action<EventHandler<T>>, Action<EventHandler<T>>, Func<Task>)
Verifies that an event with the exact or a derived event args is raised.
public static Task<EventAsserts.RaisedEvent<T>> RaisesAnyAsync<T>(Action<EventHandler<T>> attach, Action<EventHandler<T>> detach, Func<Task> testCode)
Parameters
attachAction<EventHandler<T>>Code to attach the event handler
detachAction<EventHandler<T>>Code to detach the event handler
testCodeFunc<Task>A delegate to the code to be tested
Returns
- Task<EventAsserts.RaisedEvent<T>>
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
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 EventAsserts.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
- EventAsserts.RaisedEvent<T>
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
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 EventAsserts.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
- EventAsserts.RaisedEvent<T>
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.
RaisesAsync(Action<Action>, Action<Action>, Func<Task>)
Verifies that an event is raised.
public static Task RaisesAsync(Action<Action> attach, Action<Action> detach, Func<Task> testCode)
Parameters
attachAction<Action>Code to attach the event handler
detachAction<Action>Code to detach the event handler
testCodeFunc<Task>A delegate to the code to be tested
Returns
- Task
The event sender and arguments wrapped in an object
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.
RaisesAsync<T>(Action<Action<T>>, Action<Action<T>>, Func<Task>)
Verifies that an event with the exact event args (and not a derived type) is raised.
public static Task<EventAsserts.RaisedEvent<T>> RaisesAsync<T>(Action<Action<T>> attach, Action<Action<T>> detach, Func<Task> testCode)
Parameters
attachAction<Action<T>>Code to attach the event handler
detachAction<Action<T>>Code to detach the event handler
testCodeFunc<Task>A delegate to the code to be tested
Returns
- Task<EventAsserts.RaisedEvent<T>>
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.
RaisesAsync<T>(Action<EventHandler<T>>, Action<EventHandler<T>>, Func<Task>)
Verifies that an event with the exact event args (and not a derived type) is raised.
public static Task<EventAsserts.RaisedEvent<T>> RaisesAsync<T>(Action<EventHandler<T>> attach, Action<EventHandler<T>> detach, Func<Task> testCode)
Parameters
attachAction<EventHandler<T>>Code to attach the event handler
detachAction<EventHandler<T>>Code to detach the event handler
testCodeFunc<Task>A delegate to the code to be tested
Returns
- Task<EventAsserts.RaisedEvent<T>>
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.
Raises<T>(Action<Action<T>>, Action<Action<T>>, Action)
Verifies that an event with the exact event args is raised.
public static EventAsserts.RaisedEvent<T> Raises<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
- EventAsserts.RaisedEvent<T>
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.
Raises<T>(Action<EventHandler<T>>, Action<EventHandler<T>>, Action)
Verifies that an event with the exact event args is raised.
public static EventAsserts.RaisedEvent<T> Raises<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
- EventAsserts.RaisedEvent<T>
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.
Raises<T>(Func<RaisedEvent<T>?>, Action, Action, Action)
Verifies that an event with the exact event args is raised.
public static EventAsserts.RaisedEvent<T> Raises<T>(Func<EventAsserts.RaisedEvent<T>?> handler, Action attach, Action detach, Action testCode)
Parameters
handlerFunc<EventAsserts.RaisedEvent<T>>Code returning the raised event
attachActionCode to attach the event handler
detachActionCode to detach the event handler
testCodeActionA delegate to the code to be tested
Returns
- EventAsserts.RaisedEvent<T>
The event sender and arguments wrapped in an object
Type Parameters
TThe type of the event arguments to expect
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- RaisesException
Thrown when the expected event was not raised.