| 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 | |
|||||
A command processor for unit tests. It records every command and returns what the test says. It fills no ids and sets no timestamps, the test decides the whole answer.
public class FakeCommandProcessor : Cat.Commands.Abstractions.ICatCommandProcessorInheritance System.Object → FakeCommandProcessor
Implements ICatCommandProcessor
| Fields | |
|---|---|
| _responses |
| Properties | |
|---|---|
| Commands | Every command that was processed, in order. It holds commands with and without a result. |
| DefaultResponse | The response of a command without a result when the test set up nothing for its type. It starts as Ok(). |
| Methods | |
|---|---|
| Of<T>() | Gives the processed commands of one type, in order. |
| Process(ICatCommand) | Runs a command and blocks until it finishes. Prefer ProcessAsync(ICatCommand, CancellationToken) when you can. |
| Process<TResult>(ICatCommand<TResult>) | Runs a command that returns a result and blocks until it finishes. Prefer ProcessAsync<TResult>(ICatCommand<TResult>, CancellationToken) when you can. |
| ProcessAsync(ICatCommand, CancellationToken) | Runs a command. |
| ProcessAsync<TResult>(ICatCommand<TResult>, CancellationToken) | Runs a command that returns a result. |
| Reset() | Clears the recorded commands, the set up responses and the default response. |
| 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. |