Skip to content

Latest commit

 

History

History
164 lines (108 loc) · 10.9 KB

FakeCommandProcessor.Respond.md

File metadata and controls

164 lines (108 loc) · 10.9 KB
Clean Architecture Toolkit for .NET
Clean Architecture Toolkit is a clean, modular architecture foundation for .NET applications.
It embraces SOLID principles and focuses on maintainability, testability, and scalability through clear boundaries and pluggable design.

|   HOME   |   REPO OVERVIEW   |   DEMO   |   CAT.UNITTESTING   |

Code Reference

FakeCommandProcessor.Respond Method

Overloads
Respond<TCommand,TResult>(ICatResponse<TResult>) Sets the response for a command with a result.
Respond<TCommand,TResult>(Func<TCommand,ICatResponse<TResult>>) Sets the response for a command with a result, built from the command.
Respond<TCommand>(ICatResponse) Sets the response for a command without a result.
Respond<TCommand>(Func<TCommand,ICatResponse>) Sets the response for a command without a result, built from the command.

FakeCommandProcessor.Respond<TCommand,TResult>(ICatResponse<TResult>) Method

Sets the response for a command with a result.

public Cat.UnitTesting.Commands.FakeCommandProcessor Respond<TCommand,TResult>(Cat.Responses.Abstractions.ICatResponse<TResult> response)
    where TCommand : Cat.Commands.Abstractions.ICatCommand<TResult>;

Type parameters

TCommand

The command type.

TResult

The type of the result.

Parameters

response Cat.Responses.Abstractions.ICatResponse<TResult>

The response every command of this type gets.

Returns

FakeCommandProcessor
The fake, so calls can be chained.

FakeCommandProcessor.Respond<TCommand,TResult>(Func<TCommand,ICatResponse<TResult>>) Method

Sets the response for a command with a result, built from the command.

public Cat.UnitTesting.Commands.FakeCommandProcessor Respond<TCommand,TResult>(System.Func<TCommand,Cat.Responses.Abstractions.ICatResponse<TResult>> respond)
    where TCommand : Cat.Commands.Abstractions.ICatCommand<TResult>;

Type parameters

TCommand

The command type.

TResult

The type of the result.

Parameters

respond System.Func<TCommand,Cat.Responses.Abstractions.ICatResponse<TResult>>

Builds the response from the command.

Returns

FakeCommandProcessor
The fake, so calls can be chained.

FakeCommandProcessor.Respond<TCommand>(ICatResponse) Method

Sets the response for a command without a result.

public Cat.UnitTesting.Commands.FakeCommandProcessor Respond<TCommand>(Cat.Responses.Abstractions.ICatResponse response)
    where TCommand : Cat.Commands.Abstractions.ICatCommand;

Type parameters

TCommand

The command type.

Parameters

response ICatResponse

The response every command of this type gets.

Returns

FakeCommandProcessor
The fake, so calls can be chained.

FakeCommandProcessor.Respond<TCommand>(Func<TCommand,ICatResponse>) Method

Sets the response for a command without a result, built from the command.

public Cat.UnitTesting.Commands.FakeCommandProcessor Respond<TCommand>(System.Func<TCommand,Cat.Responses.Abstractions.ICatResponse> respond)
    where TCommand : Cat.Commands.Abstractions.ICatCommand;

Type parameters

TCommand

The command type.

Parameters

respond System.Func<TCommand,ICatResponse>

Builds the response. It can also change the command, as a real handler would.

Returns

FakeCommandProcessor
The fake, so calls can be chained.