Class TestingExtensions
extension methods for registering fake/test/mock command and event handlers for integration testing
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public static class TestingExtensions
Methods
RegisterTestCommandHandler<TCommand, THandler>(IServiceCollection)
register test/fake/mock command handlers for integration testing commands that don't return a result
Declaration
public static void RegisterTestCommandHandler<TCommand, THandler>(this IServiceCollection s) where TCommand : ICommand where THandler : class, ICommandHandler<TCommand>
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | s |
Type Parameters
Name | Description |
---|---|
TCommand | the type of the command model to register a test handler for |
THandler | the type of the test command handler |
RegisterTestCommandHandler<TCommand, THandler, TResult>(IServiceCollection)
register test/fake/mock command handlers for integration testing commands that returns a result
Declaration
public static void RegisterTestCommandHandler<TCommand, THandler, TResult>(this IServiceCollection s) where TCommand : ICommand<TResult> where THandler : class, ICommandHandler<TCommand, TResult>
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | s |
Type Parameters
Name | Description |
---|---|
TCommand | the type of the command model to register a test handler for |
THandler | the type of the test command handler |
TResult | the type of the result |
RegisterTestEventHandler<TEvent, THandler>(IServiceCollection)
register test/fake/mock event handlers for integration testing events
Declaration
public static void RegisterTestEventHandler<TEvent, THandler>(this IServiceCollection s) where TEvent : IEvent where THandler : class, IEventHandler<TEvent>
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | s |
Type Parameters
Name | Description |
---|---|
TEvent | the type of the event model to register a test handler for |
THandler | the type of the test event handler |